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

#1 2013-03-04 02:26:43

Nerdyboy6057
New Scratcher
Registered: 2013-03-02
Posts: 3

Variable Problems

I am currently developing a rather complicated project at the moment called BASIS, which you can check out here. It involves a lot of variables or metadata that needs to be conserved, but I'm not sure variables do the job right.

My problem is that I don't know if variables are reset at any point and if so when they are reset! I need to know if variables are permanent, as in they stay the same until something modifies them, or if they are reset, as in they are reset to 0 whenever the green flag is pressed. Please help!

Offline

 

#2 2013-03-04 02:46:56

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Variable Problems

Variables keep their value even after the green flag is pressed.  They are only reset to their original values when the page your game is on is refreshed.

When Scratch 2.0 is released there is a type of variable that is remembered even after you leave a game and later come back.  They are called "cloud" variables and they are stored on the Scratch servers.

Last edited by BoltBait (2013-03-04 02:48:25)


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#3 2013-03-04 02:57:38

Nerdyboy6057
New Scratcher
Registered: 2013-03-02
Posts: 3

Re: Variable Problems

BoltBait wrote:

Variables keep their value even after the green flag is pressed.  They are only reset to their original values when the page your game is on is refreshed.

When Scratch 2.0 is released there is a type of variable that is remembered even after you leave a game and later come back.  They are called "cloud" variables and they are stored on the Scratch servers.

Thanks for that. This will really help. However, I don't see the advantage of storing variables on the internet.

Offline

 

Board footer