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

#1 2011-05-19 22:32:24

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Something interesting with costumes

What if a sprite has some costumes, and there is a costume named 1? It's not possible now since Scratch would rename it to "11" or something, but what do you think would happen if I said for a sprite to go to costume 1? Would it go to costume #1 or the costume named 1?

For those of you wondering, the "change to costume/background []" block accepts a number and word.  tongue

Last edited by ihaveamac (2011-05-19 22:35:42)


~ihaveamac - visit ihaveamac.net

Offline

 

#2 2011-05-20 00:10:32

Sidharth
Scratcher
Registered: 2007-12-14
Posts: 100+

Re: Something interesting with costumes

ihaveamac wrote:

Would it go to costume #1 or the costume named 1?

It would go to costume 1, I believe.

(Atleast that is my guess  smile  )

Last edited by Sidharth (2011-05-20 00:10:57)


http://www.danasoft.com/citysign.jpg

Offline

 

#3 2011-05-20 06:47:25

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Something interesting with costumes

I don't know; maybe you should try it out and see?  tongue


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2011-05-20 09:32:49

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Something interesting with costumes

I will check the code. It depends on which it would try first.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#5 2011-05-20 09:37:21

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Something interesting with costumes

Couldn't find out, its in ScriptableScratchMorph costumeIndex:.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#6 2011-05-20 10:11:02

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: Something interesting with costumes

Harakou wrote:

I don't know; maybe you should try it out and see?  tongue

Read the post, it's not possible now.

Sidharth wrote:

ihaveamac wrote:

Would it go to costume #1 or the costume named 1?

It would go to costume 1, I believe.

(Atleast that is my guess  smile  )

Can you be more specific?


~ihaveamac - visit ihaveamac.net

Offline

 

#7 2011-05-20 15:53:05

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Something interesting with costumes

If you tell a sprite to set its costume to a variable set to "1" it goes to the first costume.

However, if you have eleven costumes, one of which is called "11," and tell it to set the costume to a variable set to "11" it goes to the costume labeled "11" instead of the eleventh costume.

So basically if you tell it to go to a number, if that number is a label it will go to the labeled costume, but if that number is not a label it will instead go to the numbered costume.

Final Verdict:  Name of costume has priority over number of costume.

Does that answer your question?

Last edited by Kileymeister (2011-05-20 16:00:46)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#8 2011-05-20 20:18:26

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Something interesting with costumes

ihaveamac wrote:

Harakou wrote:

I don't know; maybe you should try it out and see?  tongue

Read the post, it's not possible now.
Can you be more specific?

Oh, I see. Sorry, I was tired and sort of skimmed that, and didn't catch that part.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer