gman

Villager
Member
Joined
Jul 22, 2021
Messages
14
Reaction score
3
First Language
English
Primarily Uses
RMXP
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?
 

Wecoc

Veteran
Veteran
Joined
Jul 4, 2021
Messages
79
Reaction score
227
First Language
Catalan
Primarily Uses
RMXP
I 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:

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.
 

Wecoc

Veteran
Veteran
Joined
Jul 4, 2021
Messages
79
Reaction score
227
First Language
Catalan
Primarily Uses
RMXP
Are you wanting to make something follow the player? If so, try searching for a "caterpillar" script.

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.
 

Latest Threads

Latest Profile Posts

does anyone feel like explaining to me the difference between simulation and emulation? you have my full permission to be as pedantic as you want.
About the Deer, I had to cut some piece of video due the *swearing* Youtube copyrights issues...
A caveman pokes his head in...
I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.

Forum statistics

Threads
116,004
Messages
1,094,826
Members
151,306
Latest member
rpgLord69
Top