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 Posts

Latest Profile Posts

Finally got my website fixed and the security sorted so it's been a productive day. Can I go to sleep now? I mean... I don't need to work right?
It's always a good idea to refresh yourself on what your plugins do. I'm working on a map with opening walls, and I was about to tear my hair out over how much image editing and hand-constructing of autotiles I'd have to do, when I looked again and saw @Shaz 's Tile Changer could copy areas from another map.
"sorry it took me so long to respond" - can we please agree not to say that anymore unless it actually took a long time?! (Like 36hrs at least) I mean, I'm running out of funny responses here xD
Ugh... 4:53AM over here and I can't sleep so why not just game make.
I just love the MV feature that allows you to create your own animations!

Forum statistics

Threads
115,919
Messages
1,094,016
Members
151,174
Latest member
sardin
Top