Discuss Scratch
- awecool
-
29 posts
"delete all clones" block
why not just create your own block that does that feature
- finnb4513
-
100+ posts
"delete all clones" block
Partial Support.
I think that you can use broadcasts to do that (mentioned on pg. 1), but to some people who want to make it easier, this will work.
I think that you can use broadcasts to do that (mentioned on pg. 1), but to some people who want to make it easier, this will work.
Last edited by finnb4513 (Nov. 2, 2016 00:20:56)
- 1a3c5e7g9i
-
100+ posts
"delete all clones" block
Please don't necropost. ( I also support the idea of having a ‘delete all clones’ blockNecroposting is creating an unrelated post on an old topic or posting “support/no support” on an old suggestion topic without backup info to support your reason for supporting the old topic.)
- BookOwl
-
1000+ posts
"delete all clones" block
Actually, you are allowed to necropost on suggestions, as it keeps the forum from getting clogged up with duplicate topics.Please don't necropost. ( I also support the idea of having a ‘delete all clones’ blockNecroposting is creating an unrelated post on an old topic or posting “support/no support” on an old suggestion topic without backup info to support your reason for supporting the old topic.)

- Littledoggygirl45
-
100+ posts
"delete all clones" block
just what i thought Why not just use messaging?
Seems easy enough to me. No need for a block for that.
exactly
- Alberknyis
-
1000+ posts
"delete all clones" block
Easy enough? In that case, why don't we eliminate forever if <>; () - (); turn ccw () degress; set, change and glide blocks for movement; change block for variable; timed say and think blocks; play sound until done; all hat blocks besides greenflag and broadcast received; all list blocks; ifthenelse; and repeat(#)? There is a workaround for each of those blocks, but for some reason, they were implemented.What's with all these “I'm going to apply your logic but forget that there is a such thing as ‘more logic’ and thus conclude with something crazy” posts?
All those blocks that can be workarounded are here because they happen to be really really convenient.
On the other hand, (I believe) we don't need a delete all clones block that much, and if we combine the two solutions we've gotten so far…
set [clonetype v] to [controlclone]
create clone of [myself v]
set [clonetype v] to [clone]
repeat (10)
create clone of [myself v]
end
set [clonetype v] to [none]
when I start as a clone
if <(clonetype) = [controlclone]> then
do stuff ::grey
broadcast [delete all clones (except for control) v]
else
if <(clonetype) = [clone]> then
do stuff ::grey
end
end
when I receive [delete all clones (except for control) v]
if <(clonetype) = [clone]> then
delete this clone
end
We end up with an alright workaround.
- kenny2scratch
-
500+ posts
"delete all clones" block
Workaround:
“when I receive” blocks are executed once for every clone of every sprite, not just once for every sprite. So if you had sprite “A”, “B” and “C”, and you had 3 clones of each, then each sprite's “when I receive” scripts would be executed 4 times, once for the actual sprite and once for each clone.
when I receive [delete all clones v]and put that in every sprite.
delete this clone
“when I receive” blocks are executed once for every clone of every sprite, not just once for every sprite. So if you had sprite “A”, “B” and “C”, and you had 3 clones of each, then each sprite's “when I receive” scripts would be executed 4 times, once for the actual sprite and once for each clone.
- JonathanSchaffer
-
1000+ posts
"delete all clones" block
no support,
when I receive [delete all clones v]
delete this clone
- hoohoo2
-
100+ posts
"delete all clones" block
Um… actually that is pretty much what it would be to do the block, it would delete all the clones not just one, but with making a new broadcast for every sprite that would need this along with a broadcast for all clones would get pretty messy.NOT TRUE, say you have millions of clones, you would only be able to delete ONE, so support. Easy workaround, so no support.broadcast [cloneDelete v] and wait
when I receive [cloneDelete v]
delete this clone
/offtopic/ funny gif sig! @JamesOuO /offtopic/
Support.
- kenny2scratch
-
500+ posts
"delete all clones" block
That was a very upsetting thread I just had to read through. Clones can receive broadcasts; if you do
when gf clickedthe number of clones will multiply exponentially since each clone is receiving the broadcast and, for itself, making a clone of itself. So you'll have the parent, then the parent and a clone, then the parent and three clones, then the parent and seven clones… Until you hit the 300 clone limit. Clones do receive broadcasts, so
forever {
broadcast [clone v]
} :: control
when I receive [clone v]
create clone of [myself v]
when I receive [delete clones v]works.
delete this clone
- kittiesrule247
-
100+ posts
"delete all clones" block
I think there should be a delete all clones block, because when i make games using clones, sometimes i just want to delete all the clones at once. Please add this, its needed!
delete all clones
Last edited by kittiesrule247 (Oct. 6, 2019 02:09:20)
- --Explosion--
-
1000+ posts
"delete all clones" block
This is easy, make a broadcast called “delete clones” and when that broadcast is received use the block ‘delete this clone’ clones receive broadcasts too so this should work!
- kittiesrule247
-
100+ posts
"delete all clones" block
i'll do that for now, but it would be a good idea to have this as a block This is easy, make a broadcast called “delete clones” and when that broadcast is received use the block ‘delete this clone’ clones receive broadcasts too so this should work!
- kittiesrule247
-
100+ posts
"delete all clones" block
wait hold on that won't work This is easy, make a broadcast called “delete clones” and when that broadcast is received use the block ‘delete this clone’ clones receive broadcasts too so this should work!
- hedgehog_blue
-
1000+ posts
"delete all clones" block
It does work. Clones can receive messages, so each clone will delete itself when it receives the message.wait hold on that won't work This is easy, make a broadcast called “delete clones” and when that broadcast is received use the block ‘delete this clone’ clones receive broadcasts too so this should work!
(the sprite will also receive the message, but it isn't a clone so it doesn't matter)
If it isn't working for you, there might be something in your project that is stopping it from working, so you'll need to show more about your project to see what it is.
broadcast [delete all clones v]
when I receive [delete all clones v] //if you put this script in a sprite, all clones of the sprite will delete when the message is sent
delete this clone
- kittiesrule247
-
100+ posts
"delete all clones" block
that didn't work for me.It does work. Clones can receive messages, so each clone will delete itself when it receives the message.wait hold on that won't work This is easy, make a broadcast called “delete clones” and when that broadcast is received use the block ‘delete this clone’ clones receive broadcasts too so this should work!
(the sprite will also receive the message, but it isn't a clone so it doesn't matter)
If it isn't working for you, there might be something in your project that is stopping it from working, so you'll need to show more about your project to see what it is.broadcast [delete all clones v]
when I receive [delete all clones v] //if you put this script in a sprite, all clones of the sprite will delete when the message is sent
delete this clone
- CatsUnited
-
1000+ posts
"delete all clones" block
I imagine this would be because of a scripting issue, because that code does work. Is it possible for you to share this project just to see what's going on? that didn't work for me.
- kittiesrule247
-
100+ posts
"delete all clones" block
What project? And I tried it multiple times and nothing happened.I imagine this would be because of a scripting issue, because that code does work. Is it possible for you to share this project just to see what's going on? that didn't work for me.
- Sheep_maker
-
1000+ posts
"delete all clones" block
The project in which you're trying the workaroundWhat project? And I tried it multiple times and nothing happened.I imagine this would be because of a scripting issue, because that code does work. Is it possible for you to share this project just to see what's going on? that didn't work for me.