Help with leveling up clones

I am trying to make a game where you catch creatures (birds) called striders. You catch them by using a net on the weakened enemy and if the striders' health is low enough, you'll be successful in catching it.

I have that whole system figured out and it is working the way I want it to. I am using Silva's Clone Actors plugin so that I can have multiple clones of a strider that you've caught and can train them.

I'm trying to figure out the best way to take the birds out of the stall, have them in my party, and train them with different activities on the barn yard. The main issue I'm running into is how would the game keep track of the different clones. The clones use variable ID's instead of Actor ID's. I'm not sure how to "level up" a variable.

Can I have the game remember the clones?
How do I level up variables?
How do I call upon variables to reenter my party?

If anyone would like to talk to/yell at me about this on Discord, my name is duo2000

PS I don't really know anything about scripting
First, the clones do not use variable IDs, their IDs are fixed numbers like all others - you just store them in a variable.

and as such that variable can be used in any event command where the actor is identified with a variable, like the first half of actor change commands - just switch the command from fixed actor to a variable.

Only in those cases where the command does not allow to select the ID by variable you would have to resort to scripting and use that to enter the ID by variable.
And if you need one of such simply ask and we can give you the correct code.
Thank you.

Right now I have it so that if the catch is successful, the bird joins the party and you can see the sprite of a bird (clone) in a net following around the player. When I put the bird it in the stall, I have the plugin delete the bird (clone) from my party, and an NPC sprite of the bird pops up in the stall.

How can I just 'remove' it from party? I feel like having the plugin delete it would wipe out all information the game had on the variable (clone).
You can try this Script to remove the Actor from your party instead of deleting it.

JavaScript:
const actorId = $gameVariables.value(123);
if ($gameParty.members().some(actor => actor.actorId() === actorId)) {
    $gameParty.removeActor(actorId);
}

It'll check the ActorID stored in variable 123, and remove the actor with this ID from your party, if available.

Afterwards you can add the actor with this script (again, it'll use the actor with the ID from variable 123). It'll only do so, if the actor isn't in the party already.

JavaScript:
const actorId = $gameVariables.value(123);
if (!$gameParty.members().some(actor => actor.actorId() === actorId)) {
    $gameParty.addActor(actorId);
}


But, this might fail, depending on how your plugin works. addActor will try to get the data from the database. Your clones might be saved somewhere else.
The main purpose of the plugin seems to be something else.
Thanks Zia. The remove script works but the add Actor script did not work.

In the thread for the plugin she says this:

"The clone IDs will start from the number of actors you have in the database +1 and go up by 1 each time a new one is created. If there are any gaps made by deleting clones, new clones will fill the gaps. eg."

Not sure if that helps in anyway for making a script but I just thought I'd throw that out there.
The 123 variable is just a placeholder. You don't want to use the same variable in both scripts.

I guess you need to save the Clone ID in some "Currently in cage n" variable, while n is the number of slots you have. So each cage slot, that can hold a bird, has its own variable to dynamically hold a Clone ID. That ID needs to be added to party by script.
Note, you can always check the values in your variables during a test play to confirm, the correct values are used.

If you did that right, and it's still not working, the plugin might delete the actors, even if they aren't removed by a plugin command.
I used my own variables when putting the script in. 21 has a value of 1, and variable 22 has a value of 22. Those are the first 2 variables that I am using for my birds. I tried variables 21, 22, and 23 for the add party member and it didn't work.
The Script works for me, so I assume you don't store the Clone IDs before removing the birds from your party.
Before you remove the bird from your party, to put it into a cage, you need to store its Clone ID into a variable of your choice to use it later.

Say, you have 40 slots in your cages. You'll need to define 40 variables, e.g. 100 to 140.

Before transfering a bird from your party to a cage, you need to load the Clone ID into the variable of the empty slot. E.g. if you put the bird to slot 32, you'll load their Clone ID into variable 132 and keep it there.

When you want to add this bird to the party again, you'll load their ID from variable 132. After that, you set the variable 132 to 0, as there's no bird in it right now.
Thank you very much Zia, I'll get to work on that.

Is this right?

1741300365258.png



It's removing the bird (Ferox) successfully but I'm not sure if it's storing the ID properly. I tried the add Actor script afterwards but it didn't work so I'm not sure what I'm doing wrong.

1741300479269.png
The most obvious issue is adding +1 to variable 101. Don't do that.

You also might want to wrap this into a condition. Otherwise, the variable will be overwritten everytime you step into this event and your saved value is gone. You could check, if 101 is 0, before doing something with it.

The rest is tough to follow. I know what you're trying to do by your explanation of the features concept. But I'm unsure, if you'll achieve it this way.

You add a +1 to var0005, will it be reduced by 1 any time? Otherwise, this number will grow every time you step into the cage with a bird.
You add a +1 to var0005, will it be reduced by 1 any time? Otherwise, this number will grow every time you step into the cage with a bird.

Yes. Whenever a bird is removed from the stall, the variable will be reduced by 1.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-leveling-up-clones.176005/