Change switch during battle

I have a room where a self destruct sequence starts. There is a timer of 4 minutes, and a wait for 4 minutes worth of frames. It's a parallel process so it does not freeze anything.

At the end of the 4 minutes I have "show animation" and "game over." If you don't solve the puzzle in that time you die.

If you solve the puzzle: fade out, next scene, timer disappears.

If you have text open during the sequence (characters have to look at consoles to see a code), the text goes away when the timer reaches 0 and you die.

This is all good so far and works perfectly.

Now.... I have an enemy that chases you during this. He chases you, battles, respawns in his 1 spot, repeat until you win or die. The timer keeps going (perfect).

Here is the problem:

If you are in battle and the timer reaches 0, the battle ends and the timer just sits there at 0 and the sequence continues so you can't lose.

I tried to make the timer event turn on another parallel switch that does the explosion/gameover, and even added "abort battle" and "wait" before it to make sure.

That switch won't turn on during the battle, resulting in the same thing.

Any solution to this? No scripting please.

Worst case scenario is that I'll just make him damage you on event touch and avoid the whole battle situation.

Thank you.
Solved it!

So I have the enemy chase you, battle, and "respawn" in its location.

What I did was add a conditional branch at the end of the enemy's event. If timer is equal or less than 0, show animation, game over.

If not, event respawns as normal.

I tested it once and it worked but this room requires testing for multiple scenarios and it's late. Don't have time right now. If I run into any other issues I'll post again.

Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/change-switch-during-battle.38322/