Clone Identifiers

Any advice on creating a way for clones to identify themselves? I noticed that clones cant have their own variables even with the Create Variables library, my project has clones be able to target a different sprite based on an aggro chance rng and I need a way for them to be able to maintain this for multiple turns. My initial thought was that each clone could have an individual variable but there'd be no way for the code to check the clone# that I know of.

Any help would be appreciated

I've used the name of the cloned sprite in the past to hold info

could you show me an example of this?

Yep - here is one

untitled script pic - 2023-06-26T211638.223

Ok but wouldnt "my name" get overridden when a new clone is produced?

When a new clone is created - it has no name

untitled script pic - 2023-06-26T212159.674

I mean when your script says "set my name to pick random 1 to 100", thats a variable, but the variable would get overridden when the next clone is created during that script, meaning all clones names would be the same, no?

No - they are unique to each clone

oh alright, got it figured out, didn't see the "my" part of set, thank you for the help :smiley:

Sprite local variables also are unique in every clone. I use that, because I feel like sprite local variable are more reliable.

Oh, and if you want a truly unique id, you need to check all the clones ids to see if you're creating a new clone with an id that is the same as another one.

yeh I have a variable decide the name that increases each time a clone is made xD so unique identifiers each time

That's a good way to do it.

well ,there is a when I start as clone block but I don't think you can identify a clone, tell me if I'm wrong
untitled script pic

that is the block I'm talking about.

you can also keep a reference to many clones in a list like this:
untitled script pic

Or you can use the my [clones] reporter.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.