Discuss Scratch

megaman100
Scratcher
100+ posts

Ability to stop certain scripts or sprites

I got a new idea! We should have the ability to stop specific scripts.

stop script [script 1 v] in [myself v]:: control

If you want to know more about adding names to scripts check out my proposal about adding names to scripts here.

Last edited by megaman100 (Aug. 21, 2018 18:21:19)

TheAdriCoolManDude
Scratcher
1000+ posts

Ability to stop certain scripts or sprites

Just use the
stop [this script v]
under the script you wanna stop.
megaman100
Scratcher
100+ posts

Ability to stop certain scripts or sprites

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
TheAdriCoolManDude
Scratcher
1000+ posts

Ability to stop certain scripts or sprites

megaman100 wrote:

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
Just use the block I said and put it under the script you wanna stop.
megaman100
Scratcher
100+ posts

Ability to stop certain scripts or sprites

TheAdriCoolManDude wrote:

megaman100 wrote:

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
Just use the block I said and put it under the script you wanna stop.
It only works if it's in the same script that needs to be stopped.
TheAdriCoolManDude
Scratcher
1000+ posts

Ability to stop certain scripts or sprites

megaman100 wrote:

TheAdriCoolManDude wrote:

megaman100 wrote:

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
Just use the block I said and put it under the script you wanna stop.
It only works if it's in the same script that needs to be stopped.
Yeah, that is why we don't need it.
-FrozenFlame-
Scratcher
100+ posts

Ability to stop certain scripts or sprites

This can somewhat simply worked-around.

Create a variable. When the variable is set to something, then the script stops.
(stop?)

when green flag clicked
set [stop? v] to [no]
...
set [stop? v] to [yes]

//meanwhile on the other script

...
wait until <(stop?) = [yes]> //the same can be achieved with a forever loop and an if, or a repeat until
stop [this script v]
megaman100
Scratcher
100+ posts

Ability to stop certain scripts or sprites

TheAdriCoolManDude wrote:

megaman100 wrote:

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
Just use the block I said and put it under the script you wanna stop.
That's not the block we need! I'm suggesting a block that can be put inside a script that stops another script. Also, my suggestion can stop scripts in other sprites as well.

Last edited by megaman100 (Aug. 24, 2018 20:17:51)

JETJcoder
Scratcher
5 posts

Ability to stop certain scripts or sprites

it isn't needed, imagine if it did exist
how would the scripts be labeled?
it would be cool if it exist and was able to stop custom blocks
define custom
...
stop script [custom v]:: control stack

Last edited by JETJcoder (Aug. 24, 2018 21:26:19)

red_king_cyclops
Scratcher
500+ posts

Ability to stop certain scripts or sprites

megaman100 wrote:

TheAdriCoolManDude wrote:

megaman100 wrote:

TheAdriCoolManDude wrote:

Just use the
stop [this script v]
under the script you wanna stop.
That won't work! I'm suggesting a block that can stop other specific scripts.
Just use the block I said and put it under the script you wanna stop.
That's not the block we need! I'm suggesting a block that can be put inside a script that stops another script. Also, my suggestion can stop scripts in other sprites as well.
You could just use broadcasting:
when green flag clicked
...::grey
broadcast [stop v]
when I receive [stop v]
stop [other scripts in sprite v]
stop [this script v]
However, using broadcasting like this can only stop whole sprites.
acuccoder
Scratcher
85 posts

Ability to stop certain scripts or sprites

To stop the sprite use:
stop [other scripts in sprite v]
stop [this script v]
PicoMetrics
Scratcher
1000+ posts

Ability to stop certain scripts or sprites

JETJcoder wrote:

it isn't needed, imagine if it did exist
how would the scripts be labeled?
it would be cool if it exist and was able to stop custom blocks
define custom
...
stop script [custom v]:: control stack
But what if there was a forever loop with that custom in there? That wouldn't work!
off topic
the2000
Scratcher
1000+ posts

Ability to stop certain scripts or sprites

I support. Occasionally I find myself in situations where this would be a more convenient solution than what I had to do.

Powered by DjangoBB