Running Battle Events after all enemies are dead

Specifically, I want the enemy to collapse and disappear, have some dialog happen, and then a new enemy appears and the fight continues. Yanfly's Battle Engine Core can run battle events after all enemies have been slain, but it doesn't work in my case, because the event runs before the enemy's collapse animation plays.


YF Battle Engine + Battle Event Page that runs when the enemy's HP <= 0 results in:


1. Enemy's HP becomes zero.


2. Event runs (including new enemy appearing)


3. Dead enemy collapses


4. Battle continues


What I need is:


1. Enemy's HP becomes zero.


2. Dead enemy collapses


3. Event runs


4. Battle continues.


Any advice?
Tsukihime wrote a script for this called 'End Phase Triggers'
Oh, I forgot about that script! Unfortunately, it looks like YF Battle Engine's way of handling things takes precedence over End Phase Triggers. I've put EPT both below and above Battle Engine Core, but it hasn't had any effect.
Try this plugin


make switch on before the battle or before the end of battle and turn it false after the event

View attachment Event Before Victory.js
Sorry, that didn't help either. Once again, the problem is the timing at which YF Battle Engine causes events to run. Thanks for trying, though.


Luckily, I did find a solution! I remembered Yanfly's action sequences include a command to force the target to collapse, so I made a skill the enemy uses on itself once its HP reaches zero.


For anyone who might happen to read this thread and has the same problem I did, here's what I did. It requires YF Battle Engine Core (of course) and YF Action Sequence Pack 1.


1. Make a common event with the cutscene events in it. All the dialogue, causing the new enemy to appear, etc.


2. Make a skill the enemy will use on itself. This skill will cause the enemy to collapse and your common event to play. The action sequence tags I used are:


<setup action>


collapse: user, force


common event: x [whatever the ID of the common event you just made is]


</setup action>


3. Go to the Troops tab and open up the troop where this enemy is fought. Make a battle event page with the condition "<EnemyName> HP <= 0%". Use Force Action, and force it to use the skill you just made.


And that should be it. Thanks to everybody who tried to help.

Original thread: https://forums.rpgmakerweb.com/threads/running-battle-events-after-all-enemies-are-dead.59666/