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

#1 2013-04-23 17:21:08

jakesyl
New Scratcher
Registered: 2013-03-05
Posts: 8

Variable not changing, can a variable be changed from multiple scripts

So here is the thing that changes the variable, trust me 3d is started during testing:
http://tinypic.com/r/2qs3xfo/4
Then I have these scripts that change up a variable by .5 every time.  The thing changes sizes but does not change the variable here is a pic of the script, please not lagless up can equal one through 5 i have diff scripts
http://tinypic.com/r/2vnht89/4

Offline

 

#2 2013-04-24 06:22:18

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Variable not changing, can a variable be changed from multiple scripts

Maybe try changing to broadcast and wait? It's probably just that the script is being launched again before it can reach the change Up by 0.5 bit.


http://i50.tinypic.com/ded8m.png

Offline

 

#3 2013-04-24 15:53:53

cauzality
New Scratcher
Registered: 2013-03-19
Posts: 44

Re: Variable not changing, can a variable be changed from multiple scripts

[note: i only looked at the second link]

both your stacks here trigger when they receive "up", you could combine them; i don't know but they may be interfering (active stacks will be outlined in white when you run your program if you want to check).

in the first stack, you cannot reach the

change [Up v] by [.5]
block because the highest level if block of the stack is only cleared if Up is greater than 16 and the if block with the change block in it is only cleared if Up is LESS than 16 - so it's unreachable.

likewise, in the second stack, all the other if blocks (if Up = 3, if Up = 6 and if Up = 9) are also unreachable since the only Up values that clear the top-level if block are those that are greater than 16.

Also, if Up is greater than 16, it will always be greater than 0 so you don't need to check that both are true.

***hope this helps, good luck

Offline

 

Board footer