How do I make a death animation play after a battle?

So here's the case:

There's an enemy you can encounter through the battle system. This is a special enemy, and all it's capable of doing is trying to inflict a death state on you. What I'm trying to do is...when this "State" is afflicted onto the player, I want the battle to abort, and right afterwards, a cutscene triggers that includes a custom death animation before being taken to the game over screen.

Screen Shot 2020-11-22 at 11.38.25 AM.png



Problem is, after the battle is aborted, nothing seems to want to work. Everything in-battle works before the "Abort Battle" portion, but everything after Abort Battle doesn't ever trigger. The player seems unaffected by anything, and can continue progressing in the map when they should be dead. Why is that?

(Just an FYI, the +Knockout state was linked to a common event that triggers a custom death scene, so that part should be fine?)
abort battle leaves the battlescreen, and the troop events don't exist outside the battlescreen.
so of course you can't process those commands after abort battle.

there are tricks to call a common event directly after battle, or you could have the death scene play inside battlescreen or a few other options depending on what you want.

In this case the option of triggering the common event on leaving battle might be the best one.
You'll need one common event on parallel, triggered by a switch called "after battle".
Inside that common event you check whatever conditions you want. If they are met, you play the death scene and trigger game over. If the conditions are not met you disable the switch "after battle" and do nothing.

and then you'll need one troop event in every battle turning ON the switch "after battle" at turn zero of the battle.
Parallel processes do not work on battlescreen, so turning on the switch will do nothing while in battle. but as soon as the battle is left, the common event will be triggered on first frame outside battle.
abort battle leaves the battlescreen, and the troop events don't exist outside the battlescreen.
so of course you can't process those commands after abort battle.

there are tricks to call a common event directly after battle, or you could have the death scene play inside battlescreen or a few other options depending on what you want.

In this case the option of triggering the common event on leaving battle might be the best one.
You'll need one common event on parallel, triggered by a switch called "after battle".
Inside that common event you check whatever conditions you want. If they are met, you play the death scene and trigger game over. If the conditions are not met you disable the switch "after battle" and do nothing.

and then you'll need one troop event in every battle turning ON the switch "after battle" at turn zero of the battle.
Parallel processes do not work on battlescreen, so turning on the switch will do nothing while in battle. but as soon as the battle is left, the common event will be triggered on first frame outside battle.

Wow that worked like a charm! Thank you sir : )

I did pretty much everything you suggested, with the exception of the Troop events conditions. Instead of setting it to start at Turn zero, I had the condition be "Turn End" instead. That way, the event of the switch and checking if the player was under the death status would trigger, abort the battle, and trigger the common event of death.

But still! Wouldn't have figured it out myself. Thanks!
I had the condition be "Turn End" instead.
there is a slight problem with that depending on how your battlesystem works and what plugins you already have.

By default, the battleend triggers before the troop events for that turn are processed IF the last enemy was killed before that moment. That is why you sometimes hear about an "immortal" state to prevent battleend at HP=0 of the last actor/enemy, in order to have the HP=0 conditioned troop events still process.
In this case it would probably work because your stone status doesn't cound as death directly for the engine and thereby not triggering the automatic battleend, but it is something to keep in mind when trying to do this with states that does count as death for the engine.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-death-animation-play-after-a-battle.130182/