Discuss Scratch
- LordEpical
 - 
                            
						
						
                            Scratcher
                        
						
						 
4 posts
Clone number block
I think it would be good if there was a block called “Clone Number” (a reporter type block (round) ) that contains the number of a clone (ect. I cloned a sprite 3 times but I want each one of those clones to contain a number in order of which was created first)
Example in set variable: Set “Selected” to: join “Player” (Clone Number)
                        
                            Example in set variable: Set “Selected” to: join “Player” (Clone Number)
Last edited by LordEpical (May 26, 2013 18:19:12)
- mitchboy
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
There's a pretty simple workaround. Just use a script like this:
When I start as a clone
change (clone) by (1)
                        
                            When I start as a clone
change (clone) by (1)
Last edited by mitchboy (May 26, 2013 19:31:38)
- turkey3
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
There's a pretty simple workaround. Just use a script like this:That shows how many clones there are in total but not an individual clone's number.
When I start as a clone
change (clone) by (1)
- kayybee
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
There's a pretty simple workaround. Just use a script like this:Do that, making clone a global variable.
When I start as a clone
change (clone) by (1)
Make cloneID a local variable, and do set cloneID to clone.
cloneID is its clone number.
- turkey3
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
Local variables are shared amongst a sprite and all its clones; each clone doesn't have it's own.There's a pretty simple workaround. Just use a script like this:Do that, making clone a global variable.
When I start as a clone
change (clone) by (1)
Make cloneID a local variable, and do set cloneID to clone.
cloneID is its clone number.
- kayybee
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
Local variables are clone-local. Unless they changed it.Local variables are shared amongst a sprite and all its clones; each clone doesn't have it's own.There's a pretty simple workaround. Just use a script like this:Do that, making clone a global variable.
When I start as a clone
change (clone) by (1)
Make cloneID a local variable, and do set cloneID to clone.
cloneID is its clone number.
No, they couldn't have because my project “The Billion Button” still works and it depends on this.
- LordEpical
 - 
                            
						
						
                            Scratcher
                        
						
						 
4 posts
Clone number block
When using local variables that changes something (such as a colour) it only affects the original, un-cloned sprite. Also I cannot see a local block made for the clone, so I cannot make it identify a clone by storing a number inside it.
                        
                        
                    - xlk
 - 
                            
						
						
                            Scratcher
                        
						
						 
100+ posts
Clone number block
Do you mean a clone number, as in to know which clone is touching something? there is only a rather drastic way of doing it, which includes lists with the clones' coordinates and hit boxes…
                        
                        
                    - iTweak0r
 - 
                            
						
						
                            Scratcher
                        
						
						 
100+ posts
Clone number block
Clones do have their own, I proved that in Soundscape with the “My Note” variableLocal variables are shared amongst a sprite and all its clones; each clone doesn't have it's own.There's a pretty simple workaround. Just use a script like this:Do that, making clone a global variable.
When I start as a clone
change (clone) by (1)
Make cloneID a local variable, and do set cloneID to clone.
cloneID is its clone number.
Last edited by iTweak0r (June 5, 2013 18:38:19)
- kayybee
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
When using local variables that changes something (such as a colour) it only affects the original, un-cloned sprite. Also I cannot see a local block made for the clone, so I cannot make it identify a clone by storing a number inside it.Color isn't a local variable. It's a local property.
You don't need a local block for the clone. You have every single clone store a number.
- xela888
 - 
                            
						
						
                            Scratcher
                        
						
						 
99 posts
Clone number block
You know there are clones, right?
What I ALWAYS want is the block Clone ID. With the block, under the “when i start as a clone” block, you know which
clone is it.
Here's what the block would look like:
                        
                            What I ALWAYS want is the block Clone ID. With the block, under the “when i start as a clone” block, you know which
clone is it.
Here's what the block would look like:
(clone id :: control)
Last edited by xela888 (June 15, 2015 18:28:43)
- DaSpudLord
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
That's a weird way for a block to look…
Anyway, no support, as you can use private variables.
                        
                        
                    Anyway, no support, as you can use private variables.
- xela888
 - 
                            
						
						
                            Scratcher
                        
						
						 
99 posts
Clone number block
That's a weird way for a block to look…yea I know
Anyway, no support, as you can use private variables.
- thelucariokid
 - 
                            
						
						
                            Scratcher
                        
						
						 
100+ posts
Clone number block
Support, because I don't know how to make the workaround.
                        
                        
                    - -Io-
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
change [cloneID v] by (1) // local variable
create clone of [myself v]
//example
when gf clicked
set [cloneID v] to [0]
repeat [3]
change [cloneID v] by (1)
create clone of [myself v]
end
when i start as a clone
if <(cloneID )= [1]> then
...
end
if <(cloneID )= [2]> then
...
end
if <(cloneID )= [3]> then
...
end
- xela888
 - 
                            
						
						
                            Scratcher
                        
						
						 
99 posts
Clone number block
Yea I know that, but I want it so you can use it later too.change [cloneID v] by (1) // local variable
create clone of [myself v]
//example
when gf clicked
set [cloneID v] to [0]
repeat [3]
change [cloneID v] by (1)
create clone of [myself v]
end
when i start as a clone
if <(cloneID )= [1]> then
...
end
if <(cloneID )= [2]> then
...
end
if <(cloneID )= [3]> then
...
end
- DaSpudLord
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
You can, just make clone# a local variable.Yea I know that, but I want it so you can use it later too....
- xela888
 - 
                            
						
						
                            Scratcher
                        
						
						 
99 posts
Clone number block
Waht local VariableYou can, just make clone# a local variable.Yea I know that, but I want it so you can use it later too....
- DaSpudLord
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Clone number block
When you create the variable, under the create variable dialog box, click the circle thats labeled “for this sprite only”. Then every time you clone that sprite, a clone of that variable is also created. That cloned variable can only be read and changed by the corresponding clone, and the clone can change the value of its variable independent of other clones' variables. (Variables for all sprites are not cloned)Waht local VariableYou can, just make clone# a local variable.Yea I know that, but I want it so you can use it later too....
- xela888
 - 
                            
						
						
                            Scratcher
                        
						
						 
99 posts
Clone number block
Oh Thanks!!!!!!!!!!!!!!!!!When you create the variable, under the create variable dialog box, click the circle thats labeled “for this sprite only”. Then every time you clone that sprite, a clone of that variable is also created. That cloned variable can only be read and changed by the corresponding clone, and the clone can change the value of its variable independent of other clones' variables. (Variables for all sprites are not cloned)Waht local VariableYou can, just make clone# a local variable.Yea I know that, but I want it so you can use it later too....
            








