Creating a building internal view system

Currently using Galv's layer system to take the roofs off buildings that you enter, and I want them to make the roof reappear after you leave the building/area that the layer above covers.
I have 3 ideas of doing this, but am unsure what would be the most effective.
- When stepping off of the event, the layer unhides (event self switch?)
- 2 player touch events, one for hiding a building's roof, and then one on the other side of that trigger that will unhide it.
- Using a global variable that an event reacts to automatically to hide or unhide the layer. Use separate events to alter this variable.
It could just be me doubting myself, because I feel like idea 2 might be the most effective, so what do other people think?
Here's where it's at currently:
dsdsd.PNG
even
There have been a number of threads that discuss how to implement this.

Here's one:
additionally:

1) does not work by default because there is no trigger for leaving an event. and working around that usually has other disadvantages

2) has been done multiple times, especially for bridges (not hide/unhide but changing the bridge to above/below character which needs the same effect. you might look for tutorials on bridges as well).

3) depends on how it is done. With the variable as a condition it would work, but it would require formatting the roof as a sprite. And that is only reasonable if you want the sprite animation on the roof.
with a parallel process checking the variable, this may create too much lag.
so it is always a less than optimal solution.
So I have a question. When you hide/unhide the roof, do you do so instantaneously, or with some kind of fade animation? Because if it's the former, you can just put a pair of events-- one facing inward that hides the roof and one facing outward that resets it-- at every possible exit. You wouldn't even need any switches or variables for that.

If it's the latter, it's not much more complicated, but it'd take one switch. With regards to your on player touch event pair, you'd do:

Code:
FACING INWARD:
    if the relevant switch is OFF {
        change switch to ON
        play your roof hiding animation
    }

FACING OUTWARD:
    if the relevant switch is ON {
        change switch to OFF
        play your roof unhiding animation
    }

AFAIK you would be able to re-use that one switch for every roof (unless you have some kind of nested system where there are sub-roofs underneath a roof, then you'd need one for each new level of roof).

Just make sure, if you do this, to change that switch BEFORE playing your animation, otherwise there is a chance for the player to "break out" of your building by stepping inside, then immediately turning around and stepping outside while the "going inside" animation is playing and thus bypass the outward event's check. Keep the animation short so it doesn't look too silly when you quickly run inside and back outside repeatedly. And be certain that there's no way for the player to break out of your building without passing one of those event pairs.

There are many ways to do this in a more fancy and elaborate way, like using a variable instead of a switch and doing an opacity add/subtract thing for a smoother fade, or doing the building trigger with regions and a plugin that ties events to those, or other wacky nonsense, but this is the simplest one I can think of.
So I have a question. When you hide/unhide the roof, do you do so instantaneously, or with some kind of fade animation? Because if it's the former, you can just put a pair of events-- one facing inward that hides the roof and one facing outward that resets it-- at every possible exit. You wouldn't even need any switches or variables for that.

If it's the latter, it's not much more complicated, but it'd take one switch. With regards to your on player touch event pair, you'd do:

Code:
FACING INWARD:
    if the relevant switch is OFF {
        change switch to ON
        play your roof hiding animation
    }

FACING OUTWARD:
    if the relevant switch is ON {
        change switch to OFF
        play your roof unhiding animation
    }

AFAIK you would be able to re-use that one switch for every roof (unless you have some kind of nested system where there are sub-roofs underneath a roof, then you'd need one for each new level of roof).

Just make sure, if you do this, to change that switch BEFORE playing your animation, otherwise there is a chance for the player to "break out" of your building by stepping inside, then immediately turning around and stepping outside while the "going inside" animation is playing and thus bypass the outward event's check. Keep the animation short so it doesn't look too silly when you quickly run inside and back outside repeatedly. And be certain that there's no way for the player to break out of your building without passing one of those event pairs.

There are many ways to do this in a more fancy and elaborate way, like using a variable instead of a switch and doing an opacity add/subtract thing for a smoother fade, or doing the building trigger with regions and a plugin that ties events to those, or other wacky nonsense, but this is the simplest one I can think of.
Hey there sorry about the late response. This seems to work the best for my project!

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-building-internal-view-system.159337/