Restart stage after fail event

Hi all,


I am setting up a maze type of puzzle game.


The issue I have is that if a fail event occurs (like a enemy touching a player) the stage needs to "restart".


What happens atm is that I have a transfer event back to the beginning of the stage, but the events that spawned the enemy or opened the door, etc etc has not been reset.


I have tried a couple of things, like switching the event that spawned the enemy off after a event touch to transfer the player back to the start, but that didnt work.


After trying to find other solutions I am thinking something else might work. Namely, when a player enters a stage a script call to save the game is run in the background, if the player dies in the stage a script is run to load that save point. This would mean the game is run on a checkpoint bases, which I am fine with. The problem is I have no idea how to setup these scripts.


Which of the two options would you guys recommend?


Any suggestions of how to do this would be appreciated. Thx!
Well, switches, variables and self-switches would be hard to fix, but for just starting locations and recovering temporarily erased events you could just teleport quickly to an empty map and then to the set place on the map you want to reset
How about teleporting to a black map for a split seccond and than back into the maze map, thatway all the eventpositions reset to there origins.


switches you can turn of with event command and self switches with eventcommand script snippet.
Thx Waterguy and Bex!


I managed to get it working!

Original thread: https://forums.rpgmakerweb.com/threads/restart-stage-after-fail-event.70305/