I wrote an addon that will allow you to lock an actor to a position, so that he or she cannot be shifted around at all. It is useful, for instance, if you want the main character to always be the lead actor.
#==============================================================================
# Lock Position
# Addon to Integrated Reserve Party 1.0d
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: December 23, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This addon allows you to lock an actor to the position they are in. This
# is useful if you always need a particular actor to be in the lead.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place this script in its own slot above Main but below the Integrated
# Reserve Party script in the Script Editor.
#
# To lock an actor in position, place the following code in a Script command:
#
# lock_position (actor_id)
# actor_id : the ID of the actor you want to lock.
#
# To unlock, use the following code:
#
# unlock_position (actor_id)
# actor_id : the ID of the actor you want to unlock.
#
# To set what icon will be shown for actors who are locked in position, go
# to line xx and choose the icon index.
#==============================================================================
IRP_LOCK_POSITION_ICON_INDEX = 81
#==============================================================================
# ** Game Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new accessor instance variable - position_locked
# aliased method - setup
#==============================================================================
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :irp_position_locked
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# actor_id : actor ID
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_resrvlock_stup_8hg3 setup
def setup (*args)
@irp_position_locked = false
# Run Original Method
ma_resrvlock_stup_8hg3 (*args)
end
end
#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - lock_position, unlock_position
#==============================================================================
class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Lock Position
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lock_position (actor_id)
$game_actors[actor_id].irp_position_locked = true
$game_party.ma_lock_party (actor_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Unlock Position
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def unlock_position (actor_id)
$game_actors[actor_id].irp_position_locked = false
$game_party.ma_unlock_party (actor_id)
end
end
#==============================================================================
# ** Window_MenuStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - refresh
#==============================================================================
class Window_MenuStatus
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malbra_lckposton_refrsh_7yv4 refresh
def refresh (*args)
malbra_lckposton_refrsh_7yv4 (*args) # Run Original Method
($game_party.members + $game_party.ma_reserve_members).each { |actor|
next unless actor.irp_position_locked
rect = Rect.new (self.contents.width - 32, actor.index*96 + 8, 24, 24)
self.contents.clear_rect (rect)
draw_icon (IRP_LOCK_POSITION_ICON_INDEX, rect.x, rect.y)
}
end
end
#==============================================================================
# ** Scene_Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - ma_select_active; ma_select_reserve
#==============================================================================
class Scene_Menu
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Select Active
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mara_slctact_lockpos_6uc1 ma_select_active
def ma_select_active (index, *args)
if $game_party.members[index] && $game_party.members[index].irp_position_locked
Sound.play_buzzer
return
end
mara_slctact_lockpos_6uc1 (index, *args) # Run Original Method
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Select Reserve
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mara_slctres_lockpos_2ef3 ma_select_reserve
def ma_select_reserve (index, *args)
if $game_party.members[index] && $game_party.members[index].irp_position_locked
Sound.play_buzzer
return
end
mara_slctres_lockpos_2ef3 (index, *args) # Run Original Method
end
end
The actor will need to be in the position that you want him or her to be in before you lock it. I probably should have added the function to specify a position to lock him or her to, but I kind of grew tired of looking at how terrible I used to be at scripting
In any case, you want to do it at the start of the game so it shouldn't be a problem. Even if you want to do it midgame or something, it isn't too hard to rearrange the party manually first using the Change Party Member event command.