Discuss Scratch

BenAndMe
Scratcher
100+ posts

Clones with Variables

There could be 10's of hundred's of clones at the same time and I need a way to make it so each clone can have a score on a variable, without creating 100's of different variables?
mstone326
Scratcher
1000+ posts

Clones with Variables

Create the score variable ‘for this sprite only’. Then every single clone will have its own copy of the score variable and can store its own data. However, to read it you'll need to use a list to record what each clone's score is

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
BenAndMe
Scratcher
100+ posts

Clones with Variables

When I do it, the first time it's fine but the second time it does 2 then another 1?
mstone326
Scratcher
1000+ posts

Clones with Variables

Scratch has a limit of 301 clones at a time unless they are deleted. When you use a for this sprite only variable, the reporter won't show the data. Thus a list is needed to view the scores.


Edit:

Maybe this will help if you look at the scripts and see how the clones report to a list.
https://scratch.mit.edu/projects/154794620/

Last edited by mstone326 (Dec. 18, 2017 01:36:55)


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
BenAndMe
Scratcher
100+ posts

Clones with Variables

No, so when i create the first time, I have made it add a 1 to the list (that parts done) but when I do the next clone it adds 2 (like it is suppose to) then adds another 1, so how could I make it so it didn't add another 1?
mstone326
Scratcher
1000+ posts

Clones with Variables

Once again, without seeing the project, I am left guessing. It sounds like you have a clone that is creating a clone. Thus the extra 1 added. It is the clone making the clone.

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
BenAndMe
Scratcher
100+ posts

Clones with Variables

Ok, it the offline version and it's not that, its that when it creates a clone that it will take every clones score and add it to a list, so what i need to do is somehow only add the last clones score to the list and not every clones score?
mstone326
Scratcher
1000+ posts

Clones with Variables

Once again, without seeing it. It is near impossible to answer. Look at the example I gave that added health to a list, then you can see how I replace the item in the list with the new value.

Once again, frustratingly guessing without seeing, are you broadcasting the create a clone? If so, each clone will respond to that and create clones of themselves.


In the Scratch 2.0 offline version you can share to website. File, share to website. Then log into website and click share. Very very hard to do this without seeing.

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335

Powered by DjangoBB