Discuss Scratch

UnscrambledEgg
Scratcher
100+ posts

Clone Identfication

How can I identify certain clones in order of when they were made?
medians
Scratcher
1000+ posts

Clone Identfication

You can use clone id for that.
https://scratch.mit.edu/projects/804792818/
READ THE NOTES AND CREDITS.
DaFrog50
Scratcher
38 posts

Clone Identfication

UnscrambledEgg wrote:

How can I identify certain clones in order of when they were made?
when green flag clicked
set [cloneID v] to [1]
repeat (4)
create clone of [myself v]
change [cloneID v] by (1)
end
Then just add a when I start as clone block to the script, and then that clone ID variable is stored in the clone, so hope that clarified some stuff.

If you need further help, just ask me and Ill try to come up with a solution!
UnscrambledEgg
Scratcher
100+ posts

Clone Identfication

DaFrog50 wrote:

UnscrambledEgg wrote:

How can I identify certain clones in order of when they were made?
when green flag clicked
set [cloneID v] to [1]
repeat (4)
create clone of [myself v]
change [cloneID v] by (1)
end
Then just add a when I start as clone block to the script, and then that clone ID variable is stored in the clone, so hope that clarified some stuff.

If you need further help, just ask me and Ill try to come up with a solution!
Cool! Thank you
UnscrambledEgg
Scratcher
100+ posts

Clone Identfication

UnscrambledEgg wrote:

DaFrog50 wrote:

UnscrambledEgg wrote:

How can I identify certain clones in order of when they were made?
when green flag clicked
set [cloneID v] to [1]
repeat (4)
create clone of [myself v]
change [cloneID v] by (1)
end
Then just add a when I start as clone block to the script, and then that clone ID variable is stored in the clone, so hope that clarified some stuff.

If you need further help, just ask me and Ill try to come up with a solution!
Cool! Thank you
Wait- but the Clone ID will be the same for each clone, no?
costlycoyote
Scratcher
45 posts

Clone Identfication

that above code will work perfectly. However, unless you check the “for this sprite only” box, (if you already clarified, forgive my explanation), it will not work. This is because if the variable is available to all sprites, then when that script changes cloneID by 1, then each clone will not have Its own cloneID value, because it is changing the value for every sprite and clone, and all clones calling on that variable will read the exact same value for cloneID, therefore defeating the purpose of the cloneID variable.
DaFrog50
Scratcher
38 posts

Clone Identfication

UnscrambledEgg wrote:

UnscrambledEgg wrote:

DaFrog50 wrote:

UnscrambledEgg wrote:

How can I identify certain clones in order of when they were made?
when green flag clicked
set [cloneID v] to [1]
repeat (4)
create clone of [myself v]
change [cloneID v] by (1)
end
Then just add a when I start as clone block to the script, and then that clone ID variable is stored in the clone, so hope that clarified some stuff.

If you need further help, just ask me and Ill try to come up with a solution!
Cool! Thank you
Wait- but the Clone ID will be the same for each clone, no?
Oh, I forgot! You just have to tick the ‘only for this sprite’ box, then it just keeps the same value in the clones, even if it has updated on the original sprite.

costlycoyote wrote:

that above code will work perfectly. However, unless you check the “for this sprite only” box, (if you already clarified, forgive my explanation), it will not work. This is because if the variable is available to all sprites, then when that script changes cloneID by 1, then each clone will not have Its own cloneID value, because it is changing the value for every sprite and clone, and all clones calling on that variable will read the exact same value for cloneID, therefore defeating the purpose of the cloneID variable.
Oh, looks like someone already answered it.

Powered by DjangoBB