You know what would be usefull? Having scripts have numbers in order when you make them and a script number block for example: when i recive "stop this but not this"
stop script no. 1
Ive always wanted that block.
Offline
Being able to stop specific scripts is the first good argument I've seen for having humbers or labels for scripts.
There are currently 3 stop commands:
stop all scripts
stop this script
stop all sounds
People have asked for "stop all scripts in this sprite" before, but this is the first request I've seen for stopping a specific script.
The numbers or labels would have to be an integral part of the script, since scripts are often rearranged on the screen (for example, by the "cleanup" button).
Offline
i didnt know there was stop all sounds. oh must be new downloadeble one. well yeah i hope we get this block
Offline
yeah, that is something that would be good.
also a subroutine call wouldnt be bad.
Offline
subroutine call? you mean every like minute it would see if a script is working?
Offline
no, a block that says:
if i get triggered, then do:
this (in other area, or other sprite)
you could have it so that multiple soldiers die from the same things.
Offline
when im triggered? you mean like the flag clicked type of blocks? the curvy ones
Offline
no, like you put something in a special block that can be triggered by more than one thing
Offline
what grade are you in!
its really simple.
you put something in a block that is like a forever, or an if, but it gets triggered by something outside of that particular script.
it would look like this:
when green flag pressed
-forever:
--if: space pressed:
---activate: subroutine 1
-------------------------------
subroutine 1:
-play sound: duhh......
-------------------------------
Offline
well cant you do that with broadcasts
<when[space ]key pressed>
<broadcast[ subroutine 1
<when I receive[ subroutine1
<play sound[ dance!
Jeez what grade are you in? lololololololol
Offline
yeah, but it lags a lot.
and subroutines are for more than that.
i just gave a less complicated explanation.
at the end of a subroutine, it goes back to the script.
if you simply broadcast"done" then all things listening will do that.
if its a sub. then only triggered stuff will continue.
Offline
FPSFelix and Heybrian, please cool it! There's no reason to insult each other just because you feel the other one doesn't get the point of what you're trying to explain. I've been following this discussion with great interest, because you both have done a wonderful job of asking the right questions and suggesting possible solutions! It is fantastic and inspiring to watch both of you exploring programming techniques and language-design issues.
FPSFelix is right to point out that function calls are currently not a feature of Scratch, and Heybrian is right to point out, that you can accomplish the same results by using broadcast commands and variables. Both of these observations are insightful and show, that you are thinking about the language design of Scratch itself! Isn't it just great how Scratch provokes and promotes these kinds of discussions?
Offline