Discuss Scratch

awecool
Scratcher
29 posts

"delete all clones" block

why not just create your own block that does that feature
finnb4513
Scratcher
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.

Last edited by finnb4513 (Nov. 2, 2016 00:20:56)

1a3c5e7g9i
Scratcher
100+ posts

"delete all clones" block

charmsazi wrote:

I also support the idea of having a ‘delete all clones’ block
Please don't necropost. (Necroposting 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
Scratcher
1000+ posts

"delete all clones" block

1a3c5e7g9i wrote:

charmsazi wrote:

I also support the idea of having a ‘delete all clones’ block
Please don't necropost. (Necroposting 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.)
Actually, you are allowed to necropost on suggestions, as it keeps the forum from getting clogged up with duplicate topics.
Littledoggygirl45
Scratcher
100+ posts

"delete all clones" block

BoltBait wrote:

Why not just use messaging?

Seems easy enough to me. No need for a block for that.
just what i thought
exactly
Alberknyis
Scratcher
1000+ posts

"delete all clones" block

LiquidMetal wrote:

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
Scratcher
500+ posts

"delete all clones" block

Workaround:
when I receive [delete all clones v]
delete this clone
and put that in every sprite.
“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.
TailsFanV51
Scratcher
1000+ posts

"delete all clones" block

whoops, i made a duplicate
JonathanSchaffer
Scratcher
1000+ posts

"delete all clones" block

no support,
when I receive [delete all clones v]
delete this clone
hoohoo2
Scratcher
100+ posts

"delete all clones" block

RPFluffy wrote:

JamesOuO wrote:

Easy workaround, so no support.
broadcast [cloneDelete v] and wait


when I receive [cloneDelete v]
delete this clone
NOT TRUE, say you have millions of clones, you would only be able to delete ONE, so support.

/offtopic/ funny gif sig! @JamesOuO /offtopic/
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.
Support.
kenny2scratch
Scratcher
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 clicked
forever {
broadcast [clone v]
} :: control
when I receive [clone v]
create clone of [myself v]
the 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
when I receive [delete clones v]
delete this clone
works.
kittiesrule247
Scratcher
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--
Scratcher
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
Scratcher
100+ posts

"delete all clones" block

staffordboys wrote:

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!
i'll do that for now, but it would be a good idea to have this as a block
kittiesrule247
Scratcher
100+ posts

"delete all clones" block

staffordboys wrote:

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!
wait hold on that won't work
hedgehog_blue
Scratcher
1000+ posts

"delete all clones" block

kittiesrule247 wrote:

staffordboys wrote:

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!
wait hold on that won't work
It does work. Clones can receive messages, so each clone will delete itself when it receives the message.
(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
Scratcher
100+ posts

"delete all clones" block

hedgehog_blue wrote:

kittiesrule247 wrote:

staffordboys wrote:

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!
wait hold on that won't work
It does work. Clones can receive messages, so each clone will delete itself when it receives the message.
(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
that didn't work for me.
CatsUnited
Scratcher
1000+ posts

"delete all clones" block

kittiesrule247 wrote:

that didn't work for me.
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?
kittiesrule247
Scratcher
100+ posts

"delete all clones" block

CatsUnited wrote:

kittiesrule247 wrote:

that didn't work for me.
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?
What project? And I tried it multiple times and nothing happened.
Sheep_maker
Scratcher
1000+ posts

"delete all clones" block

kittiesrule247 wrote:

CatsUnited wrote:

kittiesrule247 wrote:

that didn't work for me.
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?
What project? And I tried it multiple times and nothing happened.
The project in which you're trying the workaround

Powered by DjangoBB