I want my event to walk to an event that moves around randomly. About 4 squares away, and I think I can figure out this spot using variables for the coordination and some math, but then is there a way to input these variables in my game?
How do I get an event to walk to a variable?
RPG Maker MZ SupportMaybe it's easier to write what you want to do? The point is to check if event A is X,Y squares away from event B?
I am a little confused by your post and clarification would probably be helpful to get the best assistance.
Are you trying to make a cut scene?
Are you talking about having an Event on the map walk to another Event on the map that moves around randomly?
Is the Event moving randomly critical or can you set a path and still get the same effect?
Perhaps if you explain the end result you are trying to achieve in the context of what else is happening in the game, like what the player is doing, that might help people provide the best answer.
Are you trying to make a cut scene?
Are you talking about having an Event on the map walk to another Event on the map that moves around randomly?
Is the Event moving randomly critical or can you set a path and still get the same effect?
Perhaps if you explain the end result you are trying to achieve in the context of what else is happening in the game, like what the player is doing, that might help people provide the best answer.
You could do this using variables and a parallel process to grab event position coordinates every second or so.
OR
You can use Galv plugin to move your event towards another event:
galvs-scripts.com
OR
You can use Galv plugin to move your event towards another event:
MZ Move Route Extras
FEATURES This plugin adds script commands you can use in ‘Move Routes’ that enable you to do extra things during autonomous and forced movement such as: – jump forward x spaces – jump to an event o…
I think you might achieve that using GALV_MoveRouteExtras.js script, which has a:
"this.step_toward(i)" script command (Step toward event id. 0 works for player, too"). Never tested it though, so you would need to play around and see if this works.
"this.step_toward(i)" script command (Step toward event id. 0 works for player, too"). Never tested it though, so you would need to play around and see if this works.
I'm basically testing out an alternative battle system that takes place in real time 🙂 the events I'd like to move to a variable are the player's allies so that they can move to an enemy that has a random path! Although I could also experiment with set paths for the enemy and try something that way!
You can also check Moghunter's plugins on ATB and Chrono Engine to see how Mog solved the problem. I think Yanfly's EventChasePlayer also uses similar logic (albeit for player). This comes with a performance price though, as x,y coordinates of your "target" must be validated every x amount of miliseconds so that your event "stays" on a moving target. 🙂
THANK YOU! Had just the tool I needed ^-^
Perfect!!! It works great! Just what my game needed, thank you!
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-get-an-event-to-walk-to-a-variable.155713/