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

#1 2010-06-03 17:09:06

infinitum3d
Scratcher
Registered: 2009-05-10
Posts: 100+

Stop All not working???

I have it set so that when the player health gets below 1, then the background changes to Game Over and the Stop All command occurs.

But you can still keep clicking and changing the variables even AFTER the StopAll command has occurred. When I go to presentation mode, even before I click the green flag, I can click the sprites to change the variables. How is that happening?

Offline

 

#2 2010-06-03 17:11:32

12three
Scratcher
Registered: 2008-06-12
Posts: 1000+

Re: Stop All not working???

If you are using the block <when[  ]clicked> , then that script will not stop because it only starts when you click the sprite, and isn't affected by the stop all script.

Offline

 

#3 2010-06-03 17:12:11

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: Stop All not working???

If it is activated by hat blocks, it overwrites stop all. Hat blocks, essentially replace clicking the green flag. Just like stop all, doesn't stop clicking the green flag, the same is for other hat blocks. The hat blocks are:
<when green flag clicked>
<when[  ]key pressed>
<when[  ]clicked>
<when I receive[


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#4 2010-06-03 17:15:28

infinitum3d
Scratcher
Registered: 2009-05-10
Posts: 100+

Re: Stop All not working???

OK. I guess I thought StopAll shut down ALL scripts until the Green Flag was clicked again, just like the StopSign. But those HAT blocks can still receive/send commands no matter what? Interesting. Now I have to figure out how to invalidate the hat blocks when the game ends... Challenge accepted (LOL).

Thanks!

Last edited by infinitum3d (2010-06-03 17:15:39)

Offline

 

#5 2010-06-03 17:20:43

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Stop All not working???

infinitum3d wrote:

OK. I guess I thought StopAll shut down ALL scripts until the Green Flag was clicked again, just like the StopSign. But those HAT blocks can still receive/send commands no matter what? Interesting. Now I have to figure out how to invalidate the hat blocks when the game ends... Challenge accepted (LOL).

Thanks!

You could make a variable which is set to 0 when the green flag is clicked, and set to 1 right before you stop all of the scripts. In the "when ... pressed" hat blocks, you can make it so that they only activate once if the variable is 0.

Of course, that doesn't solve the problem of when the user themselves clicks the Stop Sign. Maybe instead of hat blocks, you could use a "forever...if <mouse down> and <touching mouse-pointer>" block?

Offline

 

#6 2010-06-03 17:44:22

infinitum3d
Scratcher
Registered: 2009-05-10
Posts: 100+

Re: Stop All not working???

http://scratch.mit.edu/projects/infinitum3d/1097289

I added a variable (GameOn), so instead of running StopAll, it now sets the variable to false, which prevents the HAT block from working. Easier than I thought it would be.

EDIT: OOPS, I see coolstuff had the same idea LOL.

Thanks!

Last edited by infinitum3d (2010-06-03 17:44:48)

Offline

 

#7 2010-06-03 17:49:20

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Stop All not working???

infinitum3d wrote:

http://scratch.mit.edu/projects/infinitum3d/1097289

I added a variable (GameOn), so instead of running StopAll, it now sets the variable to false, which prevents the HAT block from working. Easier than I thought it would be.

EDIT: OOPS, I see coolstuff had the same idea LOL.

Thanks!

big_smile  Happy to help.

That works almost perfectly, except when the user stops the script themselves.

Offline

 

#8 2010-06-03 17:57:43

infinitum3d
Scratcher
Registered: 2009-05-10
Posts: 100+

Re: Stop All not working???

That works almost perfectly, except when the user stops the script themselves.

Yeah. I'm still not sure how to get around that. There is no "when stopSign clicked" command to set the variable to 0.

Offline

 

#9 2010-06-03 18:03:14

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Stop All not working???

I just realized something.....shouldn't this topic go in troubleshooting?


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#10 2010-06-03 18:11:18

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Stop All not working???

ScratchReallyROCKS wrote:

I just realized something.....shouldn't this topic go in troubleshooting?

Hm... I'm not sure!

Offline

 

#11 2010-06-03 18:12:37

infinitum3d
Scratcher
Registered: 2009-05-10
Posts: 100+

Re: Stop All not working???

I guess it could. It's not really a Scratch error, but I guess it could be considered a glitch...

Offline

 

Board footer