npc movment

I am having an issue trying to figure out how to do this.


I want on a map to be able to have a even move from one end of the map to the other, wait a number of seconds, then go back the other way.


I there another way of doing this, other than 'move left' x170, 'wait 300', 'move right' x170?
It can be tricky, but you can do it with a combination of several events.


Make a three page-event, one page for going left and one for going right and one for standing.


In the moving pages, use autonomous movement with only a single move left/right (it automatically loops).


On the waiting page, have the wait followed by a check if the event is at the left end or at the other and self-switch ON the corresponding move page.


The wait page needs to be conditioned with a general switch for that event, the move pages with self-switches.


Now you add a parallel process common event that turns the wait switch for the event ON when the position of the event is either end of the map.


A bit more tricky but also allowing more versatility is making the wait page check all positions and logic itself, and have the common event trigger that page every minute or so.


This way you can have dozens of guards forcing into a check by a single switch and still have their own reaction to the needed movement.
Now you add a parallel process common event that turns the wait switch for the event ON when the position of the event is either end of the map.



what kind of check can I have that is at one end or the other?


I can find a condition that i could use.
use control variable to load the current corrdinate of the event (MAPX or MAPY depending on path) and then check the value of the variable.


(control variable : game data : character : Event Guard XY : Map X)
use control variable to load the current corrdinate of the event (MAPX or MAPY depending on path) and then check the value of the variable.


(control variable : game data : character : Event Guard XY : Map X)

Thx that did it perfectly 😀 😀


I'm still getting used to all of RMMV's parts, and where they a 'tucked' away at.


Now I just have to figure out how to get 2 event to follow each other without a small space. This is for a vehicle and it takes up 2 events. I may have to reduce to 1 event sprite, but looks much better as 2.

Original thread: https://forums.rpgmakerweb.com/threads/npc-movment.57461/