Discuss Scratch
- Discussion Forums
- » Suggestions
- » Delete All Clones on This Sprite
- LeDerpy123
-
1000+ posts
Delete All Clones on This Sprite
I think that there should be a block that deletes all clones for a certain sprite. I think this would be useful because in my new project, Splash OS 4 which is unshared, I need a way do delete all clones at once and there is no real way to do it from within the one script for the clone.
delete all clones on [this sprite v]What do you think?
- CodeLegend
-
500+ posts
Delete All Clones on This Sprite
This would be helpful for some new scratchers.
But in the meantime, you could have a different broadcast channel for each sprite, for instance:
It's okay if the real ‘host’ sprite runs a [delete this sprite] script, because nothing happens.
But in the meantime, you could have a different broadcast channel for each sprite, for instance:
broadcast [Delete Sprite1 Clones v]
when I receive [Delete Sprite1 Clones v]//this script is in Sprite1
delete this clone
It's okay if the real ‘host’ sprite runs a [delete this sprite] script, because nothing happens.
Last edited by CodeLegend (Nov. 28, 2013 15:44:50)
- LightningGuy
-
100+ posts
Delete All Clones on This Sprite
I think that would be really useful! On some of my projects, that I haven't shared for this reason, I was too lazy to spend the extra time to use a broadcast or whatever. I think this would be really useful, and most Scratchers would benefit. 
Hopefully we don't have to do this script.

when green flag clicked
repeat until <mouse down?>
delete this clone
end
Hopefully we don't have to do this script.
- CodeLegend
-
500+ posts
Delete All Clones on This Sprite
The script you made would not do anything. All clones are deleted when the flag is clicked, so it's impossible to have a [when flag clicked] block running inside of a clone. [scratchblocks]…
- Firedrake969
-
1000+ posts
Delete All Clones on This Sprite
No support.
This, basically. So many things would be helpful for new Scratchers, but just are too easy to workaround. Especially this workaround; it literally is three blocks. This would be helpful for some new scratchers.
But in the meantime, you could have a different broadcast channel for each sprite, for instance:broadcast [Delete Sprite1 Clones v]
when I receive [Delete Sprite1 Clones v]//this script is in Sprite1
delete this clone
It's okay if the real ‘host’ sprite runs a script, because nothing happens.
- CodeLegend
-
500+ posts
Delete All Clones on This Sprite
I completely agree! So many things would be helpful for new Scratchers, but just are too easy to workaround.
- JereTheJuggler
-
100+ posts
Delete All Clones on This Sprite
Couldn't you have the script you already have for your clones run in parallel with:
You could have a variable for that condition that is normally set at 0. Whenever that condition would be met in your script, just change the value to 1 or some thing.
when I start as a cloneto achieve the same effect?
wait until <some condition is met>
delete this clone
You could have a variable for that condition that is normally set at 0. Whenever that condition would be met in your script, just change the value to 1 or some thing.
when I start as a clone
wait until <(is condition true?) = [1]>
set [ is condition true v] to [0]
delete this clone
Last edited by JereTheJuggler (Nov. 29, 2013 23:17:58)
- CodeLegend
-
500+ posts
Delete All Clones on This Sprite
That would also work, but I still think a broadcast is easier. Couldn't you have the script you already have for your clones run in parallel with:
[scratchblocks]
You could have a variable for that condition that is normally set at 0. Whenever that condition would be met in your script, just change the value to 1 or some thing.
[scratchblocks]
Last edited by CodeLegend (Nov. 29, 2013 23:59:56)
- Arolfselim
-
1 post
Delete All Clones on This Sprite
Couldn't you have the script you already have for your clones run in parallel with:when I start as a cloneto achieve the same effect?
wait until <some condition is met>
delete this clone
You could have a variable for that condition that is normally set at 0. Whenever that condition would be met in your script, just change the value to 1 or some thing.when I start as a clone
wait until <(is condition true?) = [1]>
set [ is condition true v] to [0]
delete this clone
Thank you very, very, much. For a beginner tens of answers to this question where incomprehensible. This solved my problem. My poject for week 0 is on its way now. My poject for week 0 is on its way now.
- 1234abcdcba4321
-
1000+ posts
Delete All Clones on This Sprite
If you don't want to clog up with broadcasts, then use just one:
when I receive [delete clones v]One extra variable instead, but…
if <(ID) = [F4785GVS22]> then // the code can be anything, just make sure all of them have their own unique code
delete this clone
end
- LeDerpy123
-
1000+ posts
Delete All Clones on This Sprite
Hmm… Sorta necroposting but okay. I already got my answer a while ago. I'm just gonna close this,
Last edited by LeDerpy123 (Jan. 10, 2014 01:36:29)
- Discussion Forums
- » Suggestions
-
» Delete All Clones on This Sprite