- Joined
- Mar 14, 2012
- Messages
- 693
- Reaction score
- 411
- Primarily Uses
Follower's Commands
(also known as Follower's Move Routes v.2.2)
(also known as Follower's Move Routes v.2.2)
Introduction
This little script is a new approach to my Follower's Move Routes that allows the usage of other event commands such as Show Animation, Show Balloon and Set Event Position, and of course, Set Move Route.
It also allows making the followers wait. (v.2.1)
You can also use the actor database name instead of following index. (v.2.2)
Features
- Easy to use.
- Compatibility friendly.
- Lemonade friendly.
Screenshots
Simple put a call script command before each event command that you want to direct to a follower.
The call script command should be like this →
Code:
$game_temp.lfmr_follower = index
Code:
$game_temp.lfmr_follower = 1
Code:
$game_temp.lfmr_follower = 'Natalie'
To make the followers wait while the player is still able to move, use this command →
Code:
$game_temp.lfmr_wait = true
Script
Code:
#==============================================================================
# ** Follower's Commands (also known as Follower's Move Routes v.2.2.1)
#------------------------------------------------------------------------------
# * This little script allows to use in followers any editor command designed
# to work with events, this includes Show Animation, Show Balloon Icon,
# Set Event Location and Set Move Route.
#------------------------------------------------------------------------------
# * To use it, simple put a script call with the following before each of the
# previously mentioned commands.
# $game_temp.lfmr_follower = follower index OR folower name
# Use $game_temp.lfmr_wait = true/false to make the followers wait/follow again.
# Example
# $game_temp.lfmr_follower = 1 OR 'Name' : $game_temp.lfmr_wait = true
#==============================================================================
#==============================================================================
# ** Game_Temp, Alias to initialize.
#------------------------------------------------------------------------------
# Adds variable to contain follower's index and to turn on/off following.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :lfmr_follower ; attr_accessor :lfmr_wait
#--------------------------------------------------------------------------
# * Initialize Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_initialize initialize
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
lemony_moveroute_initialize
@lfmr_follower, @lfmr_wait = nil, false
end
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# Alias to get_character to return the desired follower if an index was set.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Get Character Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_get_character get_character
#--------------------------------------------------------------------------
# * Get Character
#--------------------------------------------------------------------------
def get_character(param)
i, $game_temp.lfmr_follower = $game_temp.lfmr_follower, nil
fc = $game_player.followers[i] if i.is_a?(Integer)
fc ||= $game_player.followers.each {|f| return f if f.actor.name == i} if !i.nil?
i.nil? ? lemony_moveroute_get_character(param) : fc
end
end
#==============================================================================
# ** Game_Follower
#------------------------------------------------------------------------------
# Alias to chase_preceding_character for preventing the execution if a move
# route exist for this character or for the preceding one.
#==============================================================================
class Game_Follower < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :move_route
attr_reader :original_move_route
#--------------------------------------------------------------------------
# * Chase Preceding Character Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_chase_preceding_character chase_preceding_character
#--------------------------------------------------------------------------
# * Pursue Preceding Character
#--------------------------------------------------------------------------
def chase_preceding_character
p_c = @preceding_character if p_c.nil?
return if (@move_route != @original_move_route) || (p_c != $game_player &&
(p_c.move_route != p_c.original_move_route) || $game_temp.lfmr_wait)
lemony_moveroute_chase_preceding_character
end
end
Free for use in commercial/noncommercial games, no credits needed.
Last edited by a moderator:


