npc movment

square357

Veteran
Veteran
Joined
Feb 9, 2016
Messages
22
Reaction score
0
First Language
english
Primarily Uses
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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.
 

square357

Veteran
Veteran
Joined
Feb 9, 2016
Messages
22
Reaction score
0
First Language
english
Primarily Uses
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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)
 
Last edited by a moderator:

square357

Veteran
Veteran
Joined
Feb 9, 2016
Messages
22
Reaction score
0
First Language
english
Primarily Uses
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 :D :D


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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top