This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-04-02 14:55:04

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

The Real Previous Costume Block

First, download the Scratch Source Code, or hack your copy of 1.4. (If you don't have 1.4, download the source code.)

Shift-click the loop in the "R" in the Scratch Logo.

Select "Turn Fill-screen off."

Click on the gray...
Select open from the menu that pops up...
Then browser.

Our Squeak programming goes in here.

First, follow this path:

Scratch-Objects,
ScratchSpriteMorph,
block specs,
blockspecs.

Then, find the "next costume" in the "looks" category.

Put beside it:

Code:

 ('previous costume' #- #prevCostume)

Right-click...
...and accept.

If it asks for you initials, type them in. (Or, if you want, type in Blah, blah blah.)

Now you have the block!

But...it doesn't work.

We need to call a function.

Switch to the "instance" side.

Then, follow this path:

ScriptableScratchMorph,
looks ops.
Then, type in

Code:

 prevCostume
    self costumeIndex: self costumeIndex - 1

You are done! The block works now!

Offline

 

#2 2010-04-02 16:45:54

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: The Real Previous Costume Block

This is a pretty pointless block. Just use 'switch to costume [costume # - 1]'. Do you really need THAT block to be a couple milliseconds faster? Reverse the order of the costumes!


nXIII

Offline

 

#3 2010-04-02 17:13:47

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: The Real Previous Costume Block

I didn't get 'block specs'


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#4 2010-04-02 17:55:16

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

Re: The Real Previous Costume Block

Are you using 1.3 or 1.4, midnightleopard?

nXIII, doesn't this look prettier than switch to costume costume-1?

Offline

 

#5 2010-04-02 19:01:33

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: The Real Previous Costume Block

somelia wrote:

Are you using 1.3 or 1.4, midnightleopard?

nXIII, doesn't this look prettier than switch to costume costume-1?

Not really.

Anyone who really needs this could use BYOB.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#6 2010-04-02 19:06:34

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

Re: The Real Previous Costume Block

True, but...i just felt like making this.   tongue

Offline

 

#7 2010-04-02 19:16:46

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: The Real Previous Costume Block

nXIII wrote:

This is a pretty pointless block. Just use 'switch to costume [costume # - 1]'. Do you really need THAT block to be a couple milliseconds faster? Reverse the order of the costumes!

I think it's a great block - I've often wished we had one, just for the symmetry.  And the instructions are so clearly written...I might even give it a try myself!

Thanks for taking the time to write this up so clearly and share it with us.  That's what makes Scratch such a great community - people willing to share their interests  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#8 2010-04-02 20:26:13

AnonymousTom
Scratcher
Registered: 2010-03-19
Posts: 100+

Re: The Real Previous Costume Block

Interesting, but It really isn't hacking. It's just modding the software. Great job finding how to do it.

Offline

 

#9 2010-04-03 19:25:48

urhungry
Scratcher
Registered: 2009-07-03
Posts: 1000+

Re: The Real Previous Costume Block

nice block. i added it to my scratch mod. thanks!

Offline

 

#10 2010-04-03 23:14:22

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: The Real Previous Costume Block

nXIII wrote:

This is a pretty pointless block. Just use 'switch to costume [costume # - 1]'. Do you really need THAT block to be a couple milliseconds faster? Reverse the order of the costumes!

You'd probably think we only need 1 "rotate X degrees" too.  tongue  But some users might not be able to figure that out by themselves, so adding it might be good...


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#11 2010-04-04 12:59:47

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: The Real Previous Costume Block

somelia wrote:

Are you using 1.3 or 1.4, midnightleopard?

nXIII, doesn't this look prettier than switch to costume costume-1?

1.4


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#12 2010-04-04 13:23:31

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

Re: The Real Previous Costume Block

Did you shift-click the loop in the "r"?

Offline

 

#13 2010-04-05 21:47:57

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: The Real Previous Costume Block

somelia wrote:

Did you shift-click the loop in the "r"?

you betcha


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#14 2010-04-08 14:43:15

jamopop
Scratcher
Registered: 2008-07-30
Posts: 100+

Re: The Real Previous Costume Block

somelia wrote:

First, download the Scratch Source Code, or hack your copy of 1.4. (If you don't have 1.4, download the source code.)

Shift-click the loop in the "R" in the Scratch Logo.

Select "Turn Fill-screen off."

Click on the gray...
Select open from the menu that pops up...
Then browser.

Our Squeak programming goes in here.

First, follow this path:

Scratch-Objects,
ScratchSpriteMorph,
block specs,
blockspecs.

Then, find the "next costume" in the "looks" category.

Put beside it:

Code:

 ('previous costume' #- #prevCostume)

Right-click...
...and accept.

If it asks for you initials, type them in. (Or, if you want, type in Blah, blah blah.)

Now you have the block!

But...it doesn't work.

We need to call a function.

Switch to the "instance" side.

Then, follow this path:

ScriptableScratchMorph,
looks ops.
Then, type in

Code:

 prevCostume
    self costumeIndex: self costumeIndex - 1

You are done! The block works now!

It broke my scratch can't access look's


"Life is a video game. No matter how good you get, you always end up getting zapped." -Shiregu Miyamoto

Offline

 

#15 2010-04-08 16:52:20

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

Re: The Real Previous Costume Block

jamopop wrote:

somelia wrote:

First, download the Scratch Source Code, or hack your copy of 1.4. (If you don't have 1.4, download the source code.)

Shift-click the loop in the "R" in the Scratch Logo.

Select "Turn Fill-screen off."

Click on the gray...
Select open from the menu that pops up...
Then browser.

Our Squeak programming goes in here.

First, follow this path:

Scratch-Objects,
ScratchSpriteMorph,
block specs,
blockspecs.

Then, find the "next costume" in the "looks" category.

Put beside it:

Code:

 ('previous costume' #- #prevCostume)

Right-click...
...and accept.

If it asks for you initials, type them in. (Or, if you want, type in Blah, blah blah.)

Now you have the block!

But...it doesn't work.

We need to call a function.

Switch to the "instance" side.

Then, follow this path:

ScriptableScratchMorph,
looks ops.
Then, type in

Code:

 prevCostume
    self costumeIndex: self costumeIndex - 1

You are done! The block works now!

It broke my scratch can't access look's

Be sure to follow the tutorial carefully. Re-install Scratch, and then try it again. Tell me if anything happens.

My Scratch broke when I activated Mesh, then I realized I had made a tiny mistake.

Offline

 

#16 2010-04-08 18:58:00

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: The Real Previous Costume Block

kay worx now


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#17 2010-04-08 19:46:01

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: The Real Previous Costume Block

guess what. replace the
'previous costume' #- #prevCostume)
previous costume with whatever you want. I put in lalala five, followed the other steps, and the block is called lalala five, but it carries out the previous costume function.

lol

Offline

 

#18 2010-04-08 20:45:51

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: The Real Previous Costume Block

laser100 wrote:

guess what. replace the
'previous costume' #- #prevCostume)
previous costume with whatever you want. I put in lalala five, followed the other steps, and the block is called lalala five, but it carries out the previous costume function.

lol

Ya, cause 'previous costume' is just the label  big_smile

incredible to play around with isn't it  big_smile

Try renaming ALL of your blocks :::::: big_smile


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#19 2010-04-09 12:29:58

pika100chu
Scratcher
Registered: 2009-07-26
Posts: 500+

Re: The Real Previous Costume Block

How do you save the block? When I exit Scratch, it vanishes and I have to make it all over again. Can you help? hmm

Offline

 

#20 2010-04-09 15:29:17

pika100chu
Scratcher
Registered: 2009-07-26
Posts: 500+

Re: The Real Previous Costume Block

Nevermind, I figured out how.

Offline

 

#21 2010-04-09 15:56:23

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: The Real Previous Costume Block

This Is A Great Tutorial! It's Really Simple To Make, But It's Very Good. Good Job!  big_smile

Offline

 

#22 2010-04-09 17:11:12

somelia
Scratcher
Registered: 2009-09-13
Posts: 1000+

Re: The Real Previous Costume Block

TheGameMaster1231 wrote:

This Is A Great Tutorial! It's Really Simple To Make, But It's Very Good. Good Job!  big_smile

Thank you!

Offline

 

Board footer