How to Change Actor Battler After a Fight Ends

I am currently working on an ability that would be somewhat similar to Terra from Final Fantasy 6 (i.e. 3, for those of you who are old enough to remember that), in which she would transform into her esper form for a limited time, and if the battle ended before then, she would revert to her normal form.

I have been looking using states to accomplish this, but it does not seem there are any options for triggering common events at the end of battle... or at least, none that I know of yet. Does anyone know of a way this could be accomplished? I just need a way to run a check to see if the ability is activated, and if it is, revert the actor's image file back to the original once the battle is over.

Thanks to anyone who takes the time to read this; it's very helpful. 🙂
For MV there is the YEP_UtilityCommonEvents plugin by Yanfly that can trigger common events after a battle.

Since VisuStella plugins are based on the yanfly library, I assume those plugins should offer that for MZ.
no need for a plugin, it can be done by default if you think out of the box.

you make a common event parallel process triggered by an after battle switch.
this event changes everything back and switches itself off after one run.

then on the skill that changes the actor, you switch that after battle switch on.


no parallel runs during battlescreen, which means that the event can only happen after battle even if the switch is turned at the beginning of the battle.
no need for a plugin, it can be done by default if you think out of the box.

you make a common event parallel process triggered by an after battle switch.
this event changes everything back and switches itself off after one run.

then on the skill that changes the actor, you switch that after battle switch on.


no parallel runs during battlescreen, which means that the event can only happen after battle even if the switch is turned at the beginning of the battle.
That sounds brilliant, and exactly what I was looking for, but I must be misunderstanding because I don't know where to trigger an "after battle switch." That part you said is what confused me: "triggered by an after battle switch." Where is that?

I understand using the common events parallel processing, but how is that triggered on a battle end, or rather, from where does that trigger start?

Everything else you said makes perfect sense, and I appreciate the help. 🙂
That sounds brilliant, and exactly what I was looking for, but I must be misunderstanding because I don't know where to trigger an "after battle switch." That part you said is what confused me: "triggered by an after battle switch." Where is that?

I understand using the common events parallel processing, but how is that triggered on a battle end, or rather, from where does that trigger start?

Everything else you said makes perfect sense, and I appreciate the help. 🙂

Im not 100% sure but i think he means you turn the switch ON at the beginning of the battle like this:
1644793268969.png


and this switch turns an commont event ON wich works in parallel but since youre in battle the common event will only actiavte after battle, then you turn it off in the same common and so on...

At least, this is the only way i could think off...
Hmm. That's what I was hoping to avoid because, as far as I understand, that would require that I copy and paste that into EVERY troop instance I have in the game. Eck.

I appreciate your explanation nonetheless.

Is there any way to avoid that without plugins?
Hmm. That's what I was hoping to avoid because, as far as I understand, that would require that I copy and paste that into EVERY troop instance I have in the game. Eck.

I appreciate your explanation nonetheless.

Is there any way to avoid that without plugins?

if you use a "skill" for transforming, you could try to add a common event wich just turns ON the actual common event, like this:
1644794667131.png
Ofc you add the effect to the skill you use for transforming and all it does is turning the common event 0002 ON wich runs on parallel ect....

So you would not have to copy + paste it in every troop, should work...

EDIT:
Yup, works like a charm... so if you truly use a skill for transofrmation, then this is it.
if not, an alternative would be to add it to the standard attack since its a skill as well, it would just activate every time you attack common event but as long as its just to turn a switch on, i dont thing it will have an major impact on the battle or lagg ect...
Where is that?
as the other poster already explained, that is any regular switch that you define for that function.
as for turning that switch ON I meant the second variant of having the transform skill do that for you.

this only works if the transform skill is limited to battle - if you use that outside battle the transformation would end after one frame as the parallel process would react at once.
Thanks to everyone who responded. This helped me get the ideas I needed to make this work, however, there is still one problem.

So the skill transformation I'm using has a state that buffs the player. The way I set it up is like this:
Skill used, adds state to player
Skill turns on switch to start parallel check
Switch activates if-then-else parallel check, detects if player actively has state, if not, revert to normal form

Now, the problem with this is that, upon testing, the parallel check does not seem to be checking actively in battle. As soon as the battle is over, the player returns to normal form (with the sound effects and everything), but I want the character to return to normal form once the state is removed (i.e. after so many turns in battle, or at the end of battle, whichever comes first)

As I said, the basis of the mechanic is very similar to Terra from FF6. Although it seems like it would work in theory, in practice, after testing and trying it in a few different ways, I've come to the conclusion that the parallel common event is not doing checks in combat. I triple checked to make sure the switch is on (and obviously, it is on because it works AFTER combat) -- can anyone offer some insight on this? I'm jerry-rigging it the best I can, but I've hit another brick wall, and any help would be greatly appreciated. 🙂
Now, the problem with this is that, upon testing, the parallel check does not seem to be checking actively in battle.
as I explained in my original post above, no parallel process will ever work during battle.
that is why this works for battle even without a conditional check for the state.

to have the same functionality inside battlescreen, you'll need a troop event set to a span of moment (=action) in every troop where that function is needed.
Thank you. Okay, so that was my original concern, which was needing to put a common event into every troop for the entire game. Just to clarify, that means I'll have to do that to make it work?
Just to clarify, that means I'll have to do that to make it work?
by default yes, but you can also use a base troop plugin.

those plugins designate one specific troop as a base-troop, and will run all troop events on that troop page for every other troop without a need to copy the events there.
I hate to bring it up because you all have been so helpful, but there is another problem. I was willing to bite the bullet and simply put event pages on all the troop instances, so I tried putting the common event check (which works after combat) into the Battle Event in the Troops menu, but it does not work. Again, the common event is set to check when the state no longer appears on the player, and though it works when combat is finished (either through defeating enemies or through escape), it does not work through the Battle Event menu during active combat.

I tried it in many different ways, one of which was to set the condition on the Battle Event menu to detect if the switch is on. I tried it by 'Turn', and it did not revert the player back to normal form. I also tried it on 'Moment,' but as soon as the player gets the state buff, it hard blocks the game and you have to shut it down.

Therefore, it has to be done turn to turn, but I cannot get it to trigger. Frankly, I'm out of ideas. Is there anyone that knows anything else I can try without turning to scripts? 😳
show us a screenshot of the troop event and we can tell you what you did wrong
Okay, I got it to work. (I'll explain in case anyone else reads this and needs help.) I went back through all my events to double check and make sure I had everything right, and it was, but the problem ended up being the condition on the Battle Events page.

In order to get it to read when the state had been removed, I had to set it to "Turn 1*X"

For those of you who are new to this (like me), go to Troops, and on the Battle Event section, click on the conditions bar. Select the box that says "Turn" and the first box should be a zero, but the second box should be a 1. Click okay, and then I set the Span the "Turn." Now it checks every turn to see if the state has been removed from the player, and it works just fine for me.

Andar, Spaske, and JohnDoe -- Thank you all so much for your help! It has been very valuable to help me understand the limitations on RPGMakerMZ, so I know how to work around it. That got me past a big hurdle in the design of my game. I appreciate you guys.
🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-actor-battler-after-a-fight-ends.144918/