Door that opens when leaving a building

Hello,

This might seem like a dumb question, but what's the simplest way to animate a door AFTER a teleportation ? (on another map)

Let's say we have a town with a building. When entering the building, eventing the door is simple : the event changes appearance to simulate the door opening, letting the player enter, then closes afterwards.

However, when leaving the building (inside), I would like the "leaving" event to change the appearance of the door, which is on another map (outside). Just like in the Pokemon franchise.

Best way to do it to my knowledge would be through the use of common eventing, and reserve event ID for that purpose. But it comes with a risk, as deleting an event on the map might cause unwanted issues.

Thanks for your answer.
Just like in the Pokemon franchise.
Could you spell this out with more detail? If someone has never played Pokemon (millions haven't, and I am one of them) there is no way of knowing what you mean and therefore people can't know what to suggest.
I think I know what you mean: when you teleport outside the building, making the door closing after the character leaving the building, right? For that you need to make a switch for that door, which is turning ON while teleporting from inside to outside. Create additional page for the outside event door with condition with that switch and make it parallel, then in that page commands make it animate (closing) and turn the switch OFF.
Could you spell this out with more detail? If someone has never played Pokemon (millions haven't, and I am one of them) there is no way of knowing what you mean and therefore people can't know what to suggest.

You're right, that's why I tried to describe it beforehand, but I can understand it can be confusing :

In the pokemon franchise (and probably in other rpg), when you attempt to enter a building through a door, the door opens, the player moves up, the door closes then there is a transfert to the inner. That's mostly common with all rpgs.

However, and that's less common, when you leave the building, you are transfered to the outside, but before you can see your character, the door (same used to enter the building) opens up, your character walks down as they leave, then the door closes itself. It makes the game seem more fluid, rather than just teleporting the hero in front of the door on the outside.

But since the eventing for the transfert is on the inside of the building, I can't manage to open the door as the character leaves, since said door is on the outside.

I think I know what you mean: when you teleport outside the building, making the door closing after the character leaving the building, right? For that you need to make a switch for that door, which is turning ON while teleporting from inside to outside. Create additional page for the outside event door with condition with that switch and make it parallel, then in that page commands make it animate (closing) and turn the switch OFF.

Yes that's exactly what I try to simulate. That could be a workaround, but that would mean 1 switch per door ?

thanks for your answers 🙂

PS : Are doors entrances of exits ? 😛
That could be a workaround, but that would mean 1 switch per door ?
yes and no
you'll need to be able to identify the door event on arriving on the map, to have only that specific door going through the animation.
But depending on the map you can do that different ways instead of using one switch for each door.

1) if the map is larger and the other doors are out of sight, you can have all doors with the effect without identifying them - the player wouldn't see them

2)you can re-use switches as long as each other use of the same switch is not on the screen when you use one

3) you can use a single variable wit a door ID number instead of multiple switches, although this will require two additional pages per door event instead of one additional page with a switch
Yes that's exactly what I try to simulate. That could be a workaround, but that would mean 1 switch per door ?
Not really, just reserve, let's say 10 switches for doors (assuming there is no maps where there is more than 10 doors) and use them like "per map". And you can reuse all the switches on different maps. Like @Andar said.
-open door (from outside)
-put [this ID] to variable.
-enter building.
-leave building.
-on transfer end, find [this ID] event.
-set move route to close door on [this ID]
-put 0 to variable.

assuming one can only exit through the same entry point (as the pokemon franchise DOES), the ID won't change unless you go back 'outside'
No need even for switches if you are prepared to have a few more tiles on a B-E sheet because you can do all this on the outside map.

Create a wall tile of the building, put it on a B-E sheet and set it to star passability. When mapping put the inside floor tile on the ground 'behind' the door which, being an event, will cover it up.
Transfer your player to the outside map behind that tile.
Open the door (you are on the map so it can be an ordinary set route move for that event as part of your transfer event) and have a set route move command to move the player down one tile to get it to where the door was and then another tile forward so that they are 'outside' the building.
Close the door.

The only complication will be if you have followers showing and have 3 or more in the party. The last one or two followers will be behind the now closed door. This will be true for whichever method you use. What I do is have the player move more than one tile outside the building so that all the followers show up before the door closes.

This system also works extremely well for coming down stairs.
Thanks for your replies !
I decided to use Kes technique, more or less :

I TP the player two tiles above the door and force them to move one step down. One tile above the door is an event with player touch triggering. Said event opens the door, move the player to the door + one step down, then closes the door.
There is no need for the "hide behind a wall" technique as I change the character's opacity to 0.

Works like a charm ! ♪
an event with player touch triggering
heh.... pressure plate trap.
classic.

Original thread: https://forums.rpgmakerweb.com/threads/door-that-opens-when-leaving-a-building.156626/