Saturday 3 September 2016

Doors

For an explanation of how Player Touch works with different Priority settings, be sure to read this post about the Player Touch Trigger.

Doors

Priority and Trigger settings for a Door
Doors work by placing a passable map tile (usually a black entrance tile) over the top of an impassable wall tile (which makes the map tile passable, as well as for aesthetics), and having your Door Event on top of that

The reason Priority is set to Same as Characters and not either of the others is purely for aesthetic and animation reasons:
From left to right:
Priority = Above, Same, Below
Above is incorrect when beneath the door. Below is incorrect when on the door.

Priority = Above Characters

If set to Above Characters, the Player will walk underneath the door, the door will open on top of them, and they will remain underneath the door as they walk through it.

Priority = Below Characters

If set to Below Characters, the Player will walk on top of the door, and then the door will open beneath them (if it's a trap door in the floor that they're falling through then this is a good thing). 

Priority = Same As Characters

When set to Same as Characters, however, the Player will be in front of the door when coming from the bottom, and then will automatically switch to being behind the door once they're on the same tile. This makes it actually look like they are passing through a doorway, and things like door frames will be correctly drawn above the character.

Another key difference with Same as Characters is that the Player will open the Door before moving onto the Door tile, rather than moving onto it and then opening it either on top of them or beneath them.

Event Logic

This is the logic supplied by RPG Maker's Quick Event Creation -> Door feature:

The logic supplied by Quick Event Creation > Door

With Priority set to Same as Characters, the Door Event itself is actually impassable, which is why the Door Event sets Through ON when it is opened (to make the Event passable). 

If you read this post about the Player Touch Trigger, you'll recall that an Event set to Same as Characters will not trigger if it has Through ON.

For doors that transfer the Player to a completely different map, this does not matter because the Event resets when the Player returns. Of course, these doors also don't have any closing logic on them, either.

Closing Doors

So if you want doors or gates for aesthetics (eg. inside, or on a castle's exterior wall) that the Player can open, close, and pass through without being transferred to a different map, then you have to make sure to add closing logic and turn Through OFF when the door is closed.

Closing logic

It gets more complicated when there is an impassable wall tile above the door, which leads us to Secret Passages.


No comments:

Post a Comment