I was thinking of setting an Event's Move Route by copying the Player's movement. My plan atm is to update a variable with the Player's latest movement and then implement that variable into an Event's Move Route through the Move Command "Script". Is this possible? How? Should I go about this another way?
Event Move Route by copying Player movement Script
RGSS Script RequestsI don't understand if you want the event to imitate the player at the same time or if you want to store the route and replicate it to the event whenever you want.
If it's the first case (I guess that makes more sense), you could use a mirror script or a sprite reflection script. I made a simple example:
To use it, on the event (parallel process) use a Move Route, and on the "Script" use:
@imitate_player = true
Your method with script calls would only work if you don't mind a little gap between the start of the player and the event movements, if you want them exactly at the same time, the script is the way to go.
If it's the first case (I guess that makes more sense), you could use a mirror script or a sprite reflection script. I made a simple example:
Ruby:
class Game_Character
attr_accessor :imitate_player
alias imitator_ini initialize unless $@
def initialize(*args)
imitator_ini(*args)
@imitate_player = false
end
alias imitator_upd update unless $@
def update
if @imitate_player
if $game_player.moving? && !self.moving?
case $game_player.direction
when 2: move_down
when 4: move_left
when 6: move_right
when 8: move_up
end
end
end
imitator_upd
end
end
To use it, on the event (parallel process) use a Move Route, and on the "Script" use:
@imitate_player = true
Your method with script calls would only work if you don't mind a little gap between the start of the player and the event movements, if you want them exactly at the same time, the script is the way to go.
Are you wanting to make something follow the player? If so, try searching for a "caterpillar" script. https://forums.rpgmakerweb.com/index.php?threads/caterpillar-effect-in-xp.108083/
If that's the case, I have to say in most Caterpillars the followers don't imitate the player, they follow him. That's not a bad thing, and there are very good Caterpillar scripts with options to fix those cases where simply following can be a problem, like force turning up when you're on a ladder, or jumping platforms, etc. (I personally recommend Heretic's Caterpillar).
Alternatively, some years ago Orochii and I made a pretty simple Caterpillar where the followers really imitate the player. You can find it here.
Original thread: https://forums.rpgmakerweb.com/threads/event-move-route-by-copying-player-movement-script.139168/