Setting up a Dark Souls like encounter system using Events.

Hi,

I really hope this is the right place for this.  I do not feel this event request is TOO advanced, which is why I am creating my own thread.

I used events to set up on-map enemy encounters.  To do this I basically followed an older tutorial and just set up events on the map that move towards the players and on event touch it starts battle processing an encounter.  At the end of the event I placed an "ERASE EVENT" command so the enemies respawn after exiting and entering the map.  

I do not want this though.  I want the enemies to respawn after resting at a campfire.  I have tried everything and I am completely stumped. 

Basically heres what I'm asking for. 

Enemy encounter occurs, player wins, event is erased.

Event is permanently erased from the map until the user rests at an inn or a campfire.

Once the user rests at a campfire the enemy encounter events reset back to their original positions.

Since I want this to happen with all enemies throughout the entire game (resting at a campfire would respawn everything on every map basically) I would assume it would need to be a common event.  If this request is too confusing let me know, and I'll try to elaborate.
I would turn on a self switch instead of using erase event.  Create a new page conditioned by that self switch.

Then create another new page AFTER that, conditioned by a switch - use the same switch for EVERY enemy, if you want them ALL to respawn at the same time.  This page should be set to Parallel Process, and the only event command should be to turn the self switch off again.

Have an event on the campfire, or wherever you "rest" that simply turns that switch on, waits 60 frames, then turns the switch off again.

So when you trigger that event, the switch gets turned on, all enemy events that previously had been defeated and their self switch turned on will activate and turn the self switch off, and when you turn the main switch off, they'll go back to their original pages with the enemy sprite moving towards the player.

Or you could simply have your campfire event run a loop that goes through the enemy event ids, and uses the Outer Self Switch plugin from the JP team to turn those self switches off again, which means you don't need the global switch or the extra event page on all of them.
Thanks Shaz.  I took your idea and actually figured out how I want to do this.  Total case of two heads are better than one. 

I just set up a script to turn off all self-switches marked as "D"

I'll use self-switch D for all enemy encounters (Leaving A B and C for other things like Chests and Inns and what not).  

Moderators can close this topic as solved.

Original thread: https://forums.rpgmakerweb.com/threads/setting-up-a-dark-souls-like-encounter-system-using-events.47950/