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

Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.
A lot to learn to make a game. Can I handle it?
I've been working on status effects since last thursday, and today I finished the core mechanic of Zombie, Teleport, Curse and Recall. Zombie and Curse are lacking a few things to make them complete atm. Teleport though is the "HAHA" spell for some of my mobs, but can "NOPE" at them with Recall.

Forum statistics

Threads
115,171
Messages
1,087,797
Members
149,718
Latest member
MadAtticProductions
Top