Discuss Scratch

plasmamasta
Scratcher
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:
(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 control
Now here is an example situation it could be used for
when I start as a clone(Clone ID::control)::hat control
go to x: ((Clone ID::control) * (20)) y: ((Clone ID::control) * (10))
This example would be used for a linear scale!
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]::control
With 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) {
}::control
This could make a certain group of clone do something
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
Scratcher
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
plasmamasta
Scratcher
100+ posts

Clone ID

StrangeMagic32 wrote:

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
I'm not sure, so you're semi supporter?
StrangeMagic32
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

StrangeMagic32 wrote:

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
I'm not sure, so you're semi supporter?
currently, no, I'm more so a non supporter, since I personally find this a little confusing as it is.
plasmamasta
Scratcher
100+ posts

Clone ID

StrangeMagic32 wrote:

plasmamasta wrote:

StrangeMagic32 wrote:

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
I'm not sure, so you're semi supporter?
currently, no, I'm more so a non supporter, since I personally find this a little confusing as it is.
Maybe there should be another block that lets you choose between all the clones that existed or the number of existing clones before it
Set clone ID type [All/Existing v]::control
With 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)

plasmamasta
Scratcher
100+ posts

Clone ID

Bump
StrangeMagic32
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

Bump
it's best if you only bump if 1 of these 2 items are met
1. it's been 24 hours since last post
2. the topic is on the second page.
Troyer_Kem
Scratcher
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
Scratcher
100+ posts

Clone ID

Troyer_Kem wrote:

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
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.
StrangeMagic32
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

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.
make the variable local
plasmamasta
Scratcher
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
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

I don't see why you guys are bashing this idea so much. it could be quite useful for different tasks
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.
plasmamasta
Scratcher
100+ posts

Clone ID

StrangeMagic32 wrote:

plasmamasta wrote:

I don't see why you guys are bashing this idea so much. it could be quite useful for different tasks
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.
Each clone would get to keep it's ID. Therefore if for example you have a rating system for your project.
You cloned the star sprite. So here is how the code works:
when I receive [Rate v]
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
Sorry it took so long to reply! If you used the local variable This program wouldn't work!
StrangeMagic32
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

Sorry it took so long to reply! If you used the local variable This program wouldn't work!
I'm not sure you know what clones do with local variables…

each clone gets it's own copy of the variable, and can only be changed by them.
plasmamasta
Scratcher
100+ posts

Clone ID

StrangeMagic32 wrote:

plasmamasta wrote:

Sorry it took so long to reply! If you used the local variable This program wouldn't work!
I'm not sure you know what clones do with local variables…

each clone gets it's own copy of the variable, and can only be changed by them.
I just tested that's not true
LuckyLucky7
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

Sorry it took so long to reply! If you used the local variable This program wouldn't work!
Then how come using local variables don't work? What's the difference?
DaEpikDude
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

StrangeMagic32 wrote:

plasmamasta wrote:

Sorry it took so long to reply! If you used the local variable This program wouldn't work!
I'm not sure you know what clones do with local variables…

each clone gets it's own copy of the variable, and can only be changed by them.
I just tested that's not true
Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)

With a script like:
set [clone id v] to [0] // this is a local (this sprite only) variable
repeat (5)
change [clone id v] by (1)
create clone of [myself v]
end
each clone would have a unique ID from 1 to 5.
This works fine for the “all” setting, especially if you make a custom block like this:
define clone myself w/ ID
change [clone id v] by (1)
create clone of [myself v]
Then you just use that instead of the existing clone block.

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) {
...
}::control
Then you could make the first 5 clones do something, or use “clones 1 to 1” to make only clone 1 do something.

…I guess you want me to say an arbitrary support level, then? …semi-support?
plasmamasta
Scratcher
100+ posts

Clone ID

DaEpikDude wrote:

Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
Yes my variable was local

DaEpikDude wrote:

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
Yes that would be a good idea. Can I edit the description of this topic to include it if I give credit?

Last edited by plasmamasta (July 23, 2019 00:29:01)

DaEpikDude
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

DaEpikDude wrote:

Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
Yes my variable was local
Then it should've worked…

plasmamasta wrote:

DaEpikDude wrote:

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
Yes that would be a good idea. Can I edit the description of this topic to include it if I give credit?
uhh sure
StrangeMagic32
Scratcher
1000+ posts

Clone ID

plasmamasta wrote:

DaEpikDude wrote:

Was your variable local? (i.e. was it set to “for this sprite only” when you created it?)
Yes my variable was local
then can you share the project you are testing on?

Last edited by StrangeMagic32 (July 23, 2019 01:14:05)

Powered by DjangoBB