Discuss Scratch
- plasmamasta
-
100+ posts
Clone ID
With this idea, each clone will have an ID which is whatever number of clones existed before it + 1. Here is what the block might look like:
For if your confused about what would happen if a clone “Dies”
This is a block that will help!
For existing, when clone 1 dies all the still existing ones have their ID go down 1, and then new ones will take the next ID
For All, if clone 1 dies no clone will ever have that ID again and new clones would have the clone id of All the clones that ever existed + 1.
Now here for another C block! Credit to @DaEpikDude
Tell me what you think in the replies!
Supporters: 0
Semi supporters: 1
Non supporters: 2
Why are you guys bashing this idea so much?
(Clone ID::control)Also, the when I start as a clone block will have clone ID in it.
when I start as a clone(Clone ID::control)::hat controlNow here is an example situation it could be used for
when I start as a clone(Clone ID::control)::hat controlThis example would be used for a linear scale!
go to x: ((Clone ID::control) * (20)) y: ((Clone ID::control) * (10))
For if your confused about what would happen if a clone “Dies”
This is a block that will help!
Set clone ID type [All/Existing v]::controlWith this option, it will work one of two ways
For existing, when clone 1 dies all the still existing ones have their ID go down 1, and then new ones will take the next ID
For All, if clone 1 dies no clone will ever have that ID again and new clones would have the clone id of All the clones that ever existed + 1.
Now here for another C block! Credit to @DaEpikDude
using clones (1) to (5) {This could make a certain group of clone do something
}::control
Tell me what you think in the replies!
Supporters: 0
Semi supporters: 1
Non supporters: 2
Why are you guys bashing this idea so much?
Last edited by plasmamasta (July 23, 2019 05:07:04)
- StrangeMagic32
-
1000+ posts
Clone ID
I like the idea, but could be a bit confusing as it stands.
if clone 1 “dies” then does the next created clone take the id 1 or the previous+1
if clone 1 “dies” then does the next created clone take the id 1 or the previous+1
- plasmamasta
-
100+ posts
Clone ID
I'm not sure, so you're semi supporter? I like the idea, but could be a bit confusing as it stands.
if clone 1 “dies” then does the next created clone take the id 1 or the previous+1
- StrangeMagic32
-
1000+ posts
Clone ID
currently, no, I'm more so a non supporter, since I personally find this a little confusing as it is.I'm not sure, so you're semi supporter? I like the idea, but could be a bit confusing as it stands.
if clone 1 “dies” then does the next created clone take the id 1 or the previous+1
- plasmamasta
-
100+ posts
Clone ID
Maybe there should be another block that lets you choose between all the clones that existed or the number of existing clones before itcurrently, no, I'm more so a non supporter, since I personally find this a little confusing as it is.I'm not sure, so you're semi supporter? I like the idea, but could be a bit confusing as it stands.
if clone 1 “dies” then does the next created clone take the id 1 or the previous+1
Set clone ID type [All/Existing v]::controlWith this option, it will work one of two ways
For existing, when clone 1 dies all the still existing ones have their ID go down 1, and then new ones will take the next ID
For All, if clone 1 dies no clone will ever have that ID again and new clones would have the clone id of All the clones that ever existed + 1.
Last edited by plasmamasta (July 22, 2019 15:56:22)
- StrangeMagic32
-
1000+ posts
Clone ID
it's best if you only bump if 1 of these 2 items are met Bump
1. it's been 24 hours since last post
2. the topic is on the second page.
- Troyer_Kem
-
1000+ posts
Clone ID
No Support. Just use this:
when green flag clicked
set [id v] to [0]
repeat (4)
create clone of [myself v]
change [id v] by (1)
end
when I start as a clone
if <(id) = (1)> then
... :: grey
end
- plasmamasta
-
100+ posts
Clone ID
No Support. Just use this:That is not what I mean. Each clone has a specific ID and that just won't work because that variable always changes with the most recent clone.when green flag clicked
set [id v] to [0]
repeat (4)
create clone of [myself v]
change [id v] by (1)
end
when I start as a clone
if <(id) = (1)> then
... :: grey
end
- StrangeMagic32
-
1000+ posts
Clone ID
make the variable local That is not what I mean. Each clone has a specific ID and that just won't work because that variable always changes with the most recent clone.
- plasmamasta
-
100+ posts
Clone ID
I don't see why you guys are bashing this idea so much. it could be quite useful for different tasks
- StrangeMagic32
-
1000+ posts
Clone ID
I'm not quite bashing it, more so questioning it, but what is one thing that the local cloneId variable couldn't do that this could? I just am curious. I don't see why you guys are bashing this idea so much. it could be quite useful for different tasks
- plasmamasta
-
100+ posts
Clone ID
Each clone would get to keep it's ID. Therefore if for example you have a rating system for your project.I'm not quite bashing it, more so questioning it, but what is one thing that the local cloneId variable couldn't do that this could? I just am curious. I don't see why you guys are bashing this idea so much. it could be quite useful for different tasks
You cloned the star sprite. So here is how the code works:
when I receive [Rate v]Sorry it took so long to reply! If you used the local variable This program wouldn't work!
repeat (5)
create clone of [Myself v]
end
when I start as a clone
set x to ((-150) + (((Clone id::control)) * (50)))
if <touching [Mouse v] ?> then
switch costume to [Star filled in v]
(Clone ID::control)Stars::custom
else
switch costume to [Star empty v]
end
define (Amount)Stars
set [StarsLit v] to (Amount::custom)
when I start as a clone
forever
if <<(StarsLit)=(Clone ID::control)> or <(StarsLit)>(Clone ID::control)>>::control
switch costume to [Star Filled in v]
else
switch costume to [Star Empty v]
end
end
- StrangeMagic32
-
1000+ posts
Clone ID
I'm not sure you know what clones do with local variables… Sorry it took so long to reply! If you used the local variable This program wouldn't work!
each clone gets it's own copy of the variable, and can only be changed by them.
- plasmamasta
-
100+ posts
Clone ID
I just tested that's not trueI'm not sure you know what clones do with local variables… Sorry it took so long to reply! If you used the local variable This program wouldn't work!
each clone gets it's own copy of the variable, and can only be changed by them.
- LuckyLucky7
-
1000+ posts
Clone ID
Then how come using local variables don't work? What's the difference? Sorry it took so long to reply! If you used the local variable This program wouldn't work!
- DaEpikDude
-
1000+ posts
Clone ID
Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)I just tested that's not trueI'm not sure you know what clones do with local variables… Sorry it took so long to reply! If you used the local variable This program wouldn't work!
each clone gets it's own copy of the variable, and can only be changed by them.
With a script like:
set [clone id v] to [0] // this is a local (this sprite only) variableeach clone would have a unique ID from 1 to 5.
repeat (5)
change [clone id v] by (1)
create clone of [myself v]
end
This works fine for the “all” setting, especially if you make a custom block like this:
define clone myself w/ IDThen you just use that instead of the existing clone block.
change [clone id v] by (1)
create clone of [myself v]
For the “existing” setting, that would definitely be messier to workaround.
You might be able to figure something out if you make a “clone deleted” broadcast, and each clone checks if the ID of the one that was just deleted is smaller than theirs, and if so, lowers their ID?
Although one thing this could be useful for is if you could reference clones by ID. Maybe add another C block:
using clones (1) to (5) {Then you could make the first 5 clones do something, or use “clones 1 to 1” to make only clone 1 do something.
...
}::control
…I guess you want me to say an arbitrary support level, then? …semi-support?
- plasmamasta
-
100+ posts
Clone ID
Yes my variable was local Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
Yes that would be a good idea. Can I edit the description of this topic to include it if I give credit? Although one thing this could be useful for is if you could reference clones by ID. Maybe add another C block:using clones (1) to (5) {
...
}::control
Last edited by plasmamasta (July 23, 2019 00:29:01)
- DaEpikDude
-
1000+ posts
Clone ID
Then it should've worked…Yes my variable was local Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
uhh sureYes that would be a good idea. Can I edit the description of this topic to include it if I give credit? Although one thing this could be useful for is if you could reference clones by ID. Maybe add another C block:using clones (1) to (5) {
...
}::control
- StrangeMagic32
-
1000+ posts
Clone ID
then can you share the project you are testing on?Yes my variable was local Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
Last edited by StrangeMagic32 (July 23, 2019 01:14:05)