Discuss Scratch
- kittiesrule247
-
100+ posts
"delete all clones" block
I don’t have one right now because I deleted it and I did something else.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.
- miniepicness
-
1000+ posts
"delete all clones" block
Then share one using the script so we know what the problem is.I don’t have one right now because I deleted it and I did something else.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.
Last edited by miniepicness (Oct. 7, 2019 23:44:40)
- Seth_Zaw
-
100+ posts
"delete all clones" block
Easily workaroundable. 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
delete this cloneJust don't put it in a
when green flag clickedblock or a
when I start as a cloneblock.
Last edited by Seth_Zaw (Oct. 15, 2019 00:39:32)
- 8243874
-
100+ posts
"delete all clones" block
Here is a workaround:
when I start as a clone
repeat until <(delete clones) = [1]>
...
end
delete this clone
- Nambaseking01
-
1000+ posts
"delete all clones" block
Here is a workaround:when I start as a clone
repeat until <(delete clones) = [1]>
...
end
delete this clone
Here you have it, but remember to set the variable to any number except 1 at the beginning and when you want the clones to be deleted set it to 1. Then all the clones will be automatically deleted using the script in the above post. Pretty simple workaround, really.
- kittiesrule247
-
100+ posts
"delete all clones" block
i dont want it to repeat, I want it to also be able to delete itself without me setting delete clones to 1 because the clones are going to delete at different times and the remaining clones get deleted by that. And besides, this isn't for workarounds. This is a suggestion.
- Sheep_maker
-
1000+ posts
"delete all clones" block
Workarounds are provided as an alternative solution because it is quite unlikely a suggestion will be implemented; they also are an argument against the claim that a suggestion is necessary. i dont want it to repeat, I want it to also be able to delete itself without me setting delete clones to 1 because the clones are going to delete at different times and the remaining clones get deleted by that. And besides, this isn't for workarounds. This is a suggestion.
Isn't the delete all clones supposed to delete the remaining clones? Also, the clones won't delete at different times unless there is a wait block in the repeat until loop, or you can instead use the wait until block in a separate script:
when I start as a clone
wait until <(delete clones) = [1]>
delete this clone
- Goodthingsaregood66
-
100+ posts
"delete all clones" block
That, in block form.hate the glide block, because you can't have anything else going on while it's gliding.…In the same thread. Also, I
broadcast
glide (2) secs to x: (20) y: (30)
when I receive (do stuff)
reset timer
repeat until {{timer} > (3)}
turn (3) degrees ccw
broadcast [do stuff v]
glide (2) secs to x: (20) y: (30)
when I receive [do stuff v]
reset timer
repeat until <{{timer} > (3)}>
turn ccw (3) degrees
Last edited by Goodthingsaregood66 (July 21, 2020 21:17:57)
- Paytronix
-
60 posts
"delete all clones" block
There`s a workaround:
delete this clone
delete this clone
- Priff
-
66 posts
"delete all clones" block
No support.
you can just do this:
or just press the stop sign.
you can just do this:
repeat (300)
delete this clone
end
or just press the stop sign.
- Maximouse
-
1000+ posts
"delete all clones" block
This might be useful, but the workaround shown by Kenny2scratch works and is very simple.
- cooldude-222
-
100+ posts
"delete all clones" block
no support the workaround is so easy and simple
when green flag clicked
...
broadcast [delete all clones v]
When I receive [delete all clones v] // All clones with this code in there sprite will receive and run this code
delete this clone
- PkmnQ
-
1000+ posts
"delete all clones" block
My seven word response: But would a new scratcher know that? That was a very upsetting thread I just had to read through. Clones can receive broadcasts; if you dowhen 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
- Futurebot5
-
1000+ posts
"delete all clones" block
Yes. Also, please don't use “But would a new scratcher know that?” in your arguments, you were once one.My seven word response: But would a new scratcher know that? That was a very upsetting thread I just had to read through. Clones can receive broadcasts; if you dowhen 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
- PkmnQ
-
1000+ posts
"delete all clones" block
Exactly. When I was a New Scratcher, I didn't know that clones received broadcasts. Also, please don't use “But would a new scratcher know that?” in your arguments, you were once one.
- the2000
-
1000+ posts
"delete all clones" block
On one hand the workaround is easy, but I agree that having to make a specific message for each sprite you need to do this for can be annoying. I don't see why we can't have this block, so I think it might as well be implemented.
- TerrariaMods
-
100+ posts
"delete all clones" block
Support, I could picture this being added, but for the time being you could use this: You must add a block which deletes all the clones of one sprite/all the clones.
Thanks!
define Delete All Clones
broadcast [Delete All Clones v] and wait
when I receive [Delete All Clones v]
delete this clone
—————————————————————-OR—————————————————————-
when green flag clicked
set [DeleteClones? v] to [No]
define Delete All Clones
set [DeleteClones? v] to [Yes]
wait (0.1) secs
set [DeleteClones? v] to [No]
when I start as a clone
wait until <(DeleteClones?) = [Yes]>
delete this clone
- samq64
-
1000+ posts
"delete all clones" block
when I receive [Delete Clones v]
delete this clone
- PotatoApocalypse727
-
43 posts
"delete all clones" block
when I receive [Delete all clones v] //Put this script in any sprite with clones
delete this clone
broadcast [Delete all clones v] and wait //Put this anywhere you want to delete all the clones (The broadcast and wait instead of just a normal broadcast makes sure that the clones are all deleted when the rest of the script runs)
Last edited by PotatoApocalypse727 (May 6, 2021 21:18:32)