MV Enemy Respawn Upon Death

I've tried looking within eventing, switches, variables... if there's a way to do this, I can't figure it out. Pretty sure I need a plugin for what I'm trying to pull off.

Basically... my game is a Sci Fi/horror where you play a small robot. When they die, they respawn at a lab/hub. I don't want players restarting from a save point when they die. After they respawn, they can use their experience, scrap, resources, and other items to upgrade their equipment and robot further, hopefully making their next dungeon run easier.

During a player's run, they'll encounter on-screen enemy sprites. No random encounters. If the enemy event touches you, combat triggers and the event disappears if you win through a self switch. If you die, you are transferred back to the lab. I've pulled this part off.

The issue that I'm running into is that I want all enemy events to show up again after you die. Or... if the player returns to their hub and rests/recovers... the enemies would respawn too. I want all enemies across many events and maps to show up again. Think Dark Souls.

I figured a plugin is needed to pull this off. I searched online and found ways to respawn enemies after a certain timeframe, or by leaving the map and then returning, but I don't want enemy events to return, at all, until you die or rest at the hub.

If there is already a plugin for this, and maybe I just missed it, I apologize. I wasn't able to find anything via the forums or Google though. Thanks in advance to anyone that can help with this. Appreciate it and let me know if you have any other questions, or would like more details about my project. Thanks! 🙂
You didn't say how your enemies are going away in the first place, but I presume a self-switch on their individual events.

So...this is what I would do. Doesn't need a plugin. Someone might come along with a better approach.

Give each map with enemies an event with a blank page 1, then page 2 with a condition of a self-switch. On that page, have it undo the self-switches of whatever events on that map represent enemies, then turn its self-switch off.

Then, in your event/code that respawns the player upon death, have it turn on the appropriate self-switch on that respawn event in each map.

It might be a little tedious to set up initially, depending on how much you already have made, but after that it's just copy and pasting.
First off, thanks for all the help. You've been great in the past, well... few posts I've made LOL

This worked amazingly! I got Yanfly's SelfSwitchVariable plugin so I can assign one particular Self Switch to all deaths. Your idea saved me a lot of time and was really helpful. Thank you.

I'll report this post so it can be moved (if needed) and closed. Sorry for posting in here. Figured I'd need a plugin made for this.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/enemy-respawn-upon-death.140309/