Stop launched scripts, or maybe a specific hat block

So I have a few use cases for these blocks
The second one might be too complex to add but I’m putting it here anyway

So i want an option in the stop block to stop launched scripts in this sprite or all launched scripts in sprites, this is pretty self explanatory

The second one I have a concept for but again it might be too much to add


(I made this a while ago for scratch 3)
When you select the block a little tab would come out of the block, when you hold down on it a pnother tab would come out of all hat blocks
You drag an arrow and when it connects with a tab, when the block runs it would stop that specific hat block

This could also be done by adding ringed hat blocks and dropping them into the stop scripts block
image
This would stop all hat blocks of that type, possibly a “launch” hat block or an “always” hat block could be added that would stop launched scripts as well
But I think the functionality of those is definitely its own suggestion

Typically, a LAUNCHed script doesn't have a hat block; it's in a ring inside the LAUNCH block.

Anyway, none of this is (imho) what you really want. You just want to have each of the scripts you're going to want to stop to use THIS SCRIPT to put itself in a list of scripts (which you can do already) and then you want to be able to drag that list into the STOP block; that's the new feature you need.

But I'm guessing there's a better way, such as the old Scratch way, which is to set a Boolean variable to True when you want the scripts to stop, and have each script poll that variable and stop itself when it becomes true.

It seems like an awfully specific situation in which this feature would be necessary.

I do agree with this, the feature isn’t necessary for very much. But the few things it are used for it is unable to be worked around due to the lack of asynchronous functions (that I don’t think are possible in blockly)

What does Blockly have to do with this?

Nothing, I was just saying that I don’t think blockly supports truely asynchronous functions

Maybe it would help if you explained what you're really trying to do.

Well I have a clone trail that I need to keep running, but other scripts I need to not keep running, the clone trail is launched and the rest aren’t

Why won't it work to just set a flag and have those scripts stop themselves when the flag is set?

Because it uses broadcasts to trigger the script that launches the clones

So? It's up to you what's in those scripts. You can put in a test for one of several stop flags depending on which broadcast, if you want.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.