Transfer facing a Direction

I have a problem that maybe is easy but not sure how to resolve it.

I created the transfer event but I only want it to work on the "road", and it works, the problem is that it transfer me when I go around and walk on the even facing another direction.

Case 1.JPG


I solved this one by creating the following condition.
If: facing right

Event.JPG

And now it still transfer me when walking toward the event

Case A.JPG

But if I am standing on the event and face right, it won't trigger and it won't let me transfer

Case B.JPG

I hope I was able to explain correctly my problem
The Player Touch only runs once, when the player first walks onto the tile. So it does one check, sees the player is not facing the required direction, and ends.

What you want is for it to activate when the player steps onto it, and then to keep checking as long as the player is standing on it. For this you will need a parallel process event. However, you don't want it to keep checking all the time - only when the player is standing on it, so you want the parallel process event to start when the player steps on it, and stop when they step away.

For this, you will need to give your event 2 pages. The first is the player touch page to 'trigger' the event and activate the parallel process; the second is the parallel process to monitor for either the player facing the correct direction to transfer, or the player moving onto a different tile, and deactivating itself.

Page 1: No condition, Player Touch trigger
Code:
Control Self Switch A = ON

Page 2: Self Switch A is ON condition, Parallel Process trigger
Code:
If Player is facing Right
  Transfer
Else
  If Script: $gamePlayer.x !== this.character(0).x || $gamePlayer.y !== this.character(0).y
    Control Self Switch A = OFF
  End
End
Wait 1 Frame

Of course the easier solution would be to put a rock or log or plant or something above and below the series of tiles, so the player can only approach via the road.
The Player Touch only runs once, when the player first walks onto the tile. So it does one check, sees the player is not facing the required direction, and ends.

What you want is for it to activate when the player steps onto it, and then to keep checking as long as the player is standing on it. For this you will need a parallel process event. However, you don't want it to keep checking all the time - only when the player is standing on it, so you want the parallel process event to start when the player steps on it, and stop when they step away.

For this, you will need to give your event 2 pages. The first is the player touch page to 'trigger' the event and activate the parallel process; the second is the parallel process to monitor for either the player facing the correct direction to transfer, or the player moving onto a different tile, and deactivating itself.

Page 1: No condition, Player Touch trigger
Code:
Control Self Switch A = ON

Page 2: Self Switch A is ON condition, Parallel Process trigger
Code:
If Player is facing Right
  Transfer
Else
  If Script: $gamePlayer.x !== this.character(0).x || $gamePlayer.y !== this.character(0).y
    Control Self Switch A = OFF
  End
End
Wait 1 Frame

Of course the easier solution would be to put a rock or log or plant or something above and below the series of tiles, so the player can only approach via the road.


It work as a charm, it is exactly what I was looking to do, probably would be easier as you said to enclose the road and probably will do that in most cases, but at least if necesary I can use this one.

Thank you very much!
I will assume you're happy for this to be closed, so

Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/transfer-facing-a-direction.131392/