How to make something specific happen when event touches block?

 Hello!


 I am new at RPG maker, and I don't know if this is obvious, but is there a way I can make something specific happen when an even touches a block?


 What I have done so far, is make it so that the event is movable by a player touching it.


 Here are the commands I have put in the event so far;


Untitled.png


I am trying to make it so that when the player moves the event in a certain spot, it will trigger a door opening.


Is this possible? If so, how?
yes, you'll need to add a check after each move to see if the event is in the correct place.


Usually done with two control variable commands to load the x and y of the event position into them, followed by two conditional branches to check which values they are.
Maybe this Copy Paste from another thread helps you?


Pseudo Eventcode:


Set Move Route: Turn away from Player and Move one Step. (Skip if Cannot Move must be marked and Wait for Completion)


Control Variable 1 and 2 - Game Data - Charackter - This Event -  Map X and Y


Conditional Branch Variable 1 == 5 (chosen MapX)


Conditional Branch Variable 2 == 8 (chosen MapY)


If yes than


Do your vent stuff here.


than Turn Self Switch A ON


Dont forget to Create a seccond Eventpage with Self Switch A as Condition (Or use normal Switches  if needed)


Thisway its with direct coordinates and only to  push it into correct location one Time.


Ahh, while Map is reloading so do Eventpositions, but therefor also existing workarounds if needed.
FYI, you don't need to make the event 'turn' away from the player before you make it 'move' away from the player.  If it's not facing away from the player prior to the move, it will turn automatically before it moves.
@Shaz @Bex @Andar Thank you for your help!
FYI, you don't need to make the event 'turn' away from the player before you make it 'move' away from the player.  If it's not facing away from the player prior to the move, it will turn automatically before it moves.

But if the Event is moving more than one Field "Move Away from Player" can cause the Event to run into the wrong direction sometimes.


For example:


If the Event travels more than 1Maptile and the Player is still able to run around, in that case the bug apears.


Also if it moves more tiles straight and than against a Wall, can also cause Event to run in wrong direction sometimes.


Maybe not in this case but maybe good to know 🙂.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-something-specific-happen-when-event-touches-block.61753/