Exploding event radius event?

I want to do this event but cant figure it out, here is the scenario, after defeating a boss, he will self destruct from a timer lets say 5 seconds but if my player is in the blast area when the timer reaches 0, the player will get a game over. So i want to make it so the player must run away to a safe distance on the map before the boss explodes
You just need to calculate the distance between the boss and the player.

Code:
Conditional Branch: Script: e = $gameMap.event(8); p = $gamePlayer; d1 = e.x - p.x; d2 = e.y - p.y; Math.sqrt(d1 * d1 + d2 * d2) >= 5

Change 8 to the event id of your boss, and change 5 to the distance you want the player to be.

I think the formula is correct, but I haven't tested it.
I did something similar. Create a switch called "Boss Death Time" and create a variable for "Time" I did 10 seconds in mine. I setup a Parallel Process event then I setup a wait 60 frames, subtract 1 from "Time" and when it hits 0 game over. You can add an exception to break the loop earlier if they get far enough away such as any corridors. Just setup something to turn off the switch "Boss Death Time" when they're safe.

Death Timer.png
I did something similar. Create a switch called "Boss Death Time" and create a variable for "Time" I did 10 seconds in mine. I setup a Parallel Process event then I setup a wait 60 frames, subtract 1 from "Time" and when it hits 0 game over. You can add an exception to break the loop earlier if they get far enough away such as any corridors. Just setup something to turn off the switch "Boss Death Time" when they're safe.

View attachment 209295
The initial timer works it gets game over when i do nothing, though dunno how to figure out the off switch to stop the timer from finishing count down, i could add a player touch event but that tile is already occupied by another event and that tile is the only exit for a safe passage

edit: yeah i have no idea how to set up a break loop event
The initial timer works it gets game over when i do nothing, though dunno how to figure out the off switch to stop the timer from finishing count down, i could add a player touch event but that tile is already occupied by another event and that tile is the only exit for a safe passage

edit: yeah i have no idea how to set up a break loop event
What about setting up a new page? Do you have to backtrack over an event that already happened or is it a new event that it would trigger?
there is a jumping platform before reaching the boss, after defeat boss, i jump back on the jumping platform back to the beginning of the map, that is where it will be safe, the event tile is required to jump onto the next platform

The white circle is the player, the purple circle is the start of the jump game and the yellow circle is the boss
after defeat boss i jump back to the purple circle before his selfdestruct kills me

How do i break the loop anyway
another way which might be easier (which works in MV), is to create event (with event hit box wide/height).
than after the boss is deafeat, set switch to ON + time.

if the player hits the event with player touch event, the timer stops or after transfer to a new map.

this can give you a bit more control.

if you can use escape items, make this item not useable during the time period.
i have mz how do i do that?

dont think mz has event hit box

Original thread: https://forums.rpgmakerweb.com/threads/exploding-event-radius-event.142869/