In my case, I want to have a sort of "mercenary" party set up. Where you may recruit a number of different characters, but they are only contracted to fight for you for a certain number of battles. So for example, I could define in the options "When Actor 2 has fought 20 battles, run common event 2", and common event 2 will run the scene where Actor 2 leaves your party after the last battle. I don't think just having parallel processes will work either since it doesn't track actor-specific statistics normally. For example, I think it can tell you "Your party has fought 20 battles" but not "Actor 2 has participated in 20 battles", and that's what I need.
But this kind of script could be used in a more broad way as well. It could also run a common event if you take x number of steps while Actor 2 is in your party (for example, Actor 2 will stop you and ask to take a rest after taking 500 steps in your active party), or if you've gained x amount of Gold with Actor 2 in your active party, he may ask to borrow some.
Is there a script to achieve this? If not, could someone make one?
Actor-specific statistics run common events.
● ARCHIVED · READ-ONLY
-
-
You don't need a script for this, and you don't need a continuously running parallel process to check for the data - everything like this can be done with simple eventing.
1) Define and reserve one general variable for each mercenary actor
2) On the event that adds the mercenary to the party, load the current total number of battles by the party into that variable, and then add how many battles have been paid to that variable. Those variables will now show for each mercenary after which battle number the actor should be removed.
3) define a switch "battle processed".
4) go to database, troop tab, and on each troop add a troop event with the condition to be run on turn 0 only. In this troop event, add a command that says "control switch [battle processed] = ON".
5) go to common events, make a new event "check mercenaries", set it to parallel process but condition it to the switch [battle processed]
6) for each possible mercenary actor, check the current battlecount against the stored value in the mercenaries personal variable. If the battlecount is higher than the variable, remove actor.
7) after all mercenary checks, make the final command in the common event "control switch [battle processed] = OFF".
The combination of 4), 5) and 7) will guarantee that the common event will run only once after each battle... -
But will this only count battles when the mercenary is actually present in combat? For example, if Actors 1, 2, 3 and 4 are all in combat, and the number passes the threshold for Actor 5, will Actor 5 leave the party even if he has not fought?You don't need a script for this, and you don't need a continuously running parallel process to check for the data - everything like this can be done with simple eventing.
1) Define and reserve one general variable for each mercenary actor
2) On the event that adds the mercenary to the party, load the current total number of battles by the party into that variable, and then add how many battles have been paid to that variable. Those variables will now show for each mercenary after which battle number the actor should be removed.
3) define a switch "battle processed".
4) go to database, troop tab, and on each troop add a troop event with the condition to be run on turn 0 only. In this troop event, add a command that says "control switch [battle processed] = ON".
5) go to common events, make a new event "check mercenaries", set it to parallel process but condition it to the switch [battle processed]
6) for each possible mercenary actor, check the current battlecount against the stored value in the mercenaries personal variable. If the battlecount is higher than the variable, remove actor.
7) after all mercenary checks, make the final command in the common event "control switch [battle processed] = OFF".
The combination of 4), 5) and 7) will guarantee that the common event will run only once after each battle... -
You don't need to quote the entire post for an answer, especially if it is the post above yours.
Yes, that method counts only party combat without checking reserve or not, so the actor 5 will leave - you didn't specify that difference in your OP.
If you differ between battler and reserve counting, then it is not that easy - it needs either some more complex check (and two variables per mercenary) in turn 0 or a script. -
Right, that's what I thought, so that's why I assumed I needed a script :p