Ideas for simplifying self-closing doors?

So I already have it worked out. But it requires three events rather than one which can get annoying to work with very fast.

The idea is that the player walks up to a door, faces it and walks through. The door opens and stays open as long as the player stands in the doorframe. The moment the player moves in either way through the door it closes again. The way its set up now is basically handled by remote triggering of self switches of the door event from either side depending on if the door is "open" or "closed".
I would use conditional branch, region and door event itself to do it and check where player stands.

I used in example region 5, because it's green and I use color scheme to identify environment:
- green: ground passable
- red: ground, no pass
- light blue: water, passable
- dark blue: water, no pass
I would use conditional branch, region and door event itself to do it and check where player stands.

I used in example region 5, because it's green and I use color scheme to identify environment:
- green: ground passable
- red: ground, no pass
- light blue: water, passable
- dark blue: water, no pass

It works, but only one way. The event won't re-check itself after you leave it and making a second page paralell process for some reason doesn't work.
Hmm, not sure if this is exactly what you're looking for but I this should do what I think you want.
Spoiler
For this purpose let's assume everything is set up in this way:
[0][1][0] - Region 1 is door frame above the event.
[0][3][0] - Region 3 is where the door is.
[0][2][0] - Region 2 is the door frame below the event.
Door1.png

So here we make use of Visustella's Event and Movement Core Plugin. More specifically the <Activation Regions:> comment tag. In this case we're looking for Regions 1 & 2. (The door frames above and below the event). When the player steps onto either of those regions, the door will open and set the appropriate switch to ON.
Door2.png

Here on the next page we set the 'Trigger' to 'Parallel'. This is because we don't want the player to activate the page by walking on the event (the door in between the 2 door frames). This way when they are on the actual tile the door is on, it stays open and doesn't close and squish them to death.
Again, making use of the plugin, we now search for the door frame on the other side of the door, and if the player walked away from the door. Regardless we close it and turn the switch OFF.
Door3.png

Finally in exact same fashion as the previous page we switch to 'Parallel' trigger. And make use of the plugin again. And yet again, we close the door and turn the switch off.
This is very basic, but does the following:
1. Player approaches door. Door opens and stays open.
2. Player walks away from the door. Close door and go back to waiting for player.
3. Player walks through the door. Close the door behind them and go back to waiting for player.

This can be simulated without the plugins, but requires a lot more Conditional Statements and the entire event will have to be parallel (Page 1, 2 & 3). Or you utilize a 2nd event on parallel to do all the switch controls (again still filled with conditional statements), and the door event just does what it's supposed to do (open and close when told).
Edit: Visustella's Event and Movement Core Plugin, requires Visustella's Core Plugin.
Im not sure how exactly you want it to work but here is one way you could do it:
Make first page with trigger player touch or player interact (depending on how you want it to work) and have it use door sprite. On trigger, have it change facing to do door open animation and then set self switch. Create second page with condition of that self switch. Set sprite to open door for that page. Set type to parallel and add a wait, maybe 15 frames or so. After the wait, calculate the combined difference in x and y positions between this event and player, and if it is more than 1 tile, change facing of door to animate it closing and unset the self switch again. (getting position difference could be done by using control variables, getting player x, subtracting event x, then check if it is negative with a conditional branch and multiply it by -1 if it is, then do the same for y coordinate, and finally add the variables holding x diff and y diff together to get the combined diff and do a conditional branch checking if the variable holding the combined diff is greater than 1. Or you could do it with script which would probably be simpler, if you know how to)

If you want the door to close directly as you leave the door tile rather than once you go more than 1 tile away from it, you could just change the second page conditional branch checking the combined position difference to check that combined diff is greater than 0 instead of 1. But you must also change the first page to force the player to walk into the door opening at the end of the first page (shouldnt matter whether its done before or after the self switch is set, as long as it is done after the animation of door opening). If you don't, the door might just close before the player has a chance to walk through it.

Original thread: https://forums.rpgmakerweb.com/threads/ideas-for-simplifying-self-closing-doors.132028/