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

#26 2012-10-15 13:32:25

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: 5 kinds of variables

I do like this.

Offline

 

#27 2012-10-15 15:39:15

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: 5 kinds of variables

joefarebrother wrote:

kayybee wrote:

joefarebrother wrote:


It's what happened when I tested it before making this topic.

You're a tester? Oh. Never saw you on the forum.
But it's always been the way I described, so I don't know if you we're doing something differently. Look at my project the billion button. Look inside it and you'll see that each digit has its own variable. Or my particle test. The most recent one with gravity. The gravity wouldn't work if they all had the same variable...

I'm not a tester, I've just read this. At some point before I made this topic I did a test and local variables worked as sprite-specific, not clone-specific.

But I tested it and it did what I described so...

Offline

 

#28 2012-10-15 15:47:34

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: 5 kinds of variables

kayybee wrote:

joefarebrother wrote:

kayybee wrote:


You're a tester? Oh. Never saw you on the forum.
But it's always been the way I described, so I don't know if you we're doing something differently. Look at my project the billion button. Look inside it and you'll see that each digit has its own variable. Or my particle test. The most recent one with gravity. The gravity wouldn't work if they all had the same variable...

I'm not a tester, I've just read this. At some point before I made this topic I did a test and local variables worked as sprite-specific, not clone-specific.

But I tested it and it did what I described so...

OK, I'm just saying that the last time I tested it, they worked as sprite-specific. It must have changed since I tested it. I'll edit the OP.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#29 2012-10-15 19:55:57

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: 5 kinds of variables

joefarebrother wrote:

kayybee wrote:

joefarebrother wrote:


I'm not a tester, I've just read this. At some point before I made this topic I did a test and local variables worked as sprite-specific, not clone-specific.

But I tested it and it did what I described so...

OK, I'm just saying that the last time I tested it, they worked as sprite-specific. It must have changed since I tested it. I'll edit the OP.

I don't think they changed it because it also worked last week and before when I created my project the billion button and CPU made pico...

Offline

 

#30 2012-10-16 20:54:23

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: 5 kinds of variables

Stage local variables although I dont think it would be helpful.


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#31 2012-10-17 10:37:57

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: 5 kinds of variables

KrIsMa wrote:

Stage local variables although I don't think it would be helpful.

How many times have you made a project where there are tons of variables that are only needed in a few scripts? You probably make them local variables of the sprite, to avoid cluttering the pallet of globals. Now what if you had to do that with the stage?


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#32 2012-10-17 16:21:20

Akorlith
Scratcher
Registered: 2012-09-19
Posts: 18

Re: 5 kinds of variables

I think the best way of doing script specific variables would be a block called "Broadcast with arguments (args)". You could then refer to the arguments only in the "When I receive..." block.

Offline

 

#33 2012-10-18 10:57:06

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: 5 kinds of variables

Script variables block would be more useful, because you could save the results of a long calculation in a variable. How many times have you had to do this?

stuff
set [result v] to (long, complex calculation)
use (result) in the script, possibly more than once
more stuff
set [other result v] to (something else)
...
This will clutter up the variable pallet.

With your idea, you would have to do this:
stuff
broadcast [use the result v]  (long, complex calculation)
when i receive [use the result v] (result)
use the result
more stuff
broadcast [use the next result v] (another calculation)
when i receive [use the next result v] (result)
...
This clutters up the broadcast menu!
With a script variables block, you could do
script variables (result1) (result2)
as first example, but the pallet isn't cluttered!


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

Board footer