So lets say you don't want to have the player character to have to hit enter to go through a door, and you want them ALSO be able to walk past the door without exiting, and only be able to use the door when facing a certain direction. Here is a simple tutorial on how to set up Smart Doors as an event.
You might think this is simple, set up an event, triggered by player touch:
The problem is, this only works if you force the player to approach while facing down.
If dose not work if the player turns down while touching the event.
Thus, I wrote a new event format that takes this into account. As a bonus, this event dose not have to be anywhere near the position of the door.
Here is a smart door example where I want the player facing down and the door at map coordinate 6,11. The player is being transferred to MAP003 (5,7).
(Green italic text is not part of the code):
Set Trigger as Parallel, Priority as Below Characters
Control Variables #0001 ChX = Map X of Player
Control Variables #0002 ChY = Map Y of Player
Wait : 15 frames
I recommend setting these variables anyway as they are very useful to have for all kinds of fun stuff.
If : CharX = 6
That is, when the Player's X Coordinate is equal to that of the door's.
If you are using multiple smart doors, it is better to have them controlled by one of these events. Simply duplicate "if" statements with the appropriate checks. It is even possible to have a single "if" statement act as a trigger for multiple doors. For instance, if you have many doors that are triggered on the same X-Coordinate, you could put both Y-Coordinate triggers under the same X-Coordinate "if" statement.
(Thank you for the reminder about this note Engr. Adiktuzmiko)
You might think this is simple, set up an event, triggered by player touch:
If: Player is facing Down (or any direction, but for example)
Transfer Player : (location here)
The problem is, this only works if you force the player to approach while facing down.
If dose not work if the player turns down while touching the event.
Thus, I wrote a new event format that takes this into account. As a bonus, this event dose not have to be anywhere near the position of the door.
Here is a smart door example where I want the player facing down and the door at map coordinate 6,11. The player is being transferred to MAP003 (5,7).
(Green italic text is not part of the code):
Set Trigger as Parallel, Priority as Below Characters
Control Variables #0001 ChX = Map X of Player
Control Variables #0002 ChY = Map Y of Player
Wait : 15 frames
I recommend setting these variables anyway as they are very useful to have for all kinds of fun stuff.
If : CharX = 6
That is, when the Player's X Coordinate is equal to that of the door's.
Wait : 15 frames
If : CharY = 11
That is, when the Player's Y Coordinate is also equal to that of the door's.
: EndIf : CharY = 11
That is, when the Player's Y Coordinate is also equal to that of the door's.
Wait : 15 frames
If : Player is facing Down
Player is now at the door coordinate and is facing down.
: End
: EndIf : Player is facing Down
Player is now at the door coordinate and is facing down.
Transfer Player : MAP003 (5,7)
You can also put any door animations before the transfer if you like. I like to insert the standard transfer event code of footsteps/walking.
: ElseYou can also put any door animations before the transfer if you like. I like to insert the standard transfer event code of footsteps/walking.
: End
If you are using multiple smart doors, it is better to have them controlled by one of these events. Simply duplicate "if" statements with the appropriate checks. It is even possible to have a single "if" statement act as a trigger for multiple doors. For instance, if you have many doors that are triggered on the same X-Coordinate, you could put both Y-Coordinate triggers under the same X-Coordinate "if" statement.
(Thank you for the reminder about this note Engr. Adiktuzmiko)