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
216
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
216
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

Sneak peak of my upcoming update! Who's holding her, you may ask? Find out tonight!
10.PNG
BCj
Finished another GUI! Turn indicator wasn't made by me.

ff981f8dc50b03cf58038c644334b454.jpg


3cb092fdc00087acfa0a190fd891f0ed.jpg
Added a small refining scene to my game.

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.

Forum statistics

Threads
115,243
Messages
1,088,315
Members
149,838
Latest member
lovedtilldawn
Top