3 hours ago
Reserve Party Tools
Original Version by RPG Advocate 4/12/2005
Edit and repairs by DerVVulfman
Original Version by RPG Advocate 4/12/2005
Edit and repairs by DerVVulfman
Introduction
This script enables support for a "reserve" party of arbitrary size. These characters don't fight in battle. You are able to remove party members and place them within the reserves by use of a new menu designed in the system. And adding new party members (with "Change Party Member") while the party is full will add them to the reserves.
The original version required rewrites everywhere and expected the end-user to perform direct edits to the default scripts. This version fixes some errors and oversights . And while still containing some direct alterations of default scripts, has those edited areas clearly marked for reference.
Script
The Script
Code:
#==============================================================================
# Reserve Party Tools
#------------------------------------------------------------------------------
# by RPG Advocate 4/12/2005
# Edit and repairs by DerVVulfman 6/27/2026
# RGSS / RPGMaker XP
#
#------------------------------------------------------------------------------
#
# THE RESERVE PARTY MENU
#
# This script enables support for a "reserve" party of arbitrary size. These
# characters don't fight in battle. If you want to give the player the ability
# to switch characters between the party and reserve party, use either script
# call shown below:
#
# * $scene = Scene_PartyChange.new(value)
# * change_party(value)
#
# The 'value' represents the maximun number of members you want in the party,
# and can be left empty if using the default party size of '4'. You may set it
# the range from 0-4, with 0 indicating full default party size of '4'. Values
# beyond that range are invalid.
#
# * $scene = Scene_PartyChange.new
# * change_party
#
#
#------------------------------------------------------------------------------
#
# RESERVIST BATTLE EXPERIENCE
#
# By default, inactive party members gain experience at the same rate as active
# members. To change this, edit the EXP_PERCENT constant in the RPGAdvReserve
# module to the percentage of experience you want the inactive party to gain.
#
#
#------------------------------------------------------------------------------
#
# REQUIRED / PERMANENT PARTY MEMBERS
#
# This script supports required party members, actors that have been classified
# as necessary within the party and cannot be removed. To make a party member
# required or remove its required status, you may use either script calls:
#
# * $game_party.actors[actor_id].required = true/false
# * required_actor(actor_id, true/false)
#
# Both calls requests you to set a value of true, or false in order to remove
# the required status. And within the Change Member menu, these party members
# will appear with a predefined color in their names, default to Goldenrod.
#
# You should only make a character already in the party required.
#
# Making a reserve member 'required' will not work.
#
#
#------------------------------------------------------------------------------
#
# CHANGING PARTY MEMBERS
#
# This script changes how the "Change Party Members" event command works.
#
# If you try to add a charater to the party when the party is full, that char-
# acter will automatically be added to the reserve party. And if you remove a
# party member, that character will be removed if they are in either the party
# or the reserve party. However, it only recognizes a 4-party system when this
# is applied, and does not recognize alternate party sizes.
#
#
#------------------------------------------------------------------------------
#
# SCRIPT CALLS
#
# Initially, the only script calls noted were lenghty and direct commands to
# the Game_Party class or direct calls to $scene itself. Other script calls
# were possible but not given. Here, we view all relevant script calls showing
# both original and newer quick commands found in the Interpreter class:
#
# The Menu Command
# ----------------
# Used to bring up the actual Party/Reservist changing menu
# * $scene = Scene_ChangeParty.new(max_size)
# * change_party(max_size)
#
# Set Actor Required Status
# -------------------------
# Used to define an in-party (not a reservist member) as a fixed member of
# the current party. The 'actor_id' value is from the database ID. And the
# 'flag' value is either true or false.
# * $game_party.actors[actor_id].required = flag
# * required_actor(actor_id, flag)
#
# Swap Actors by database ID
# --------------------------
# Assuming there is a system tracking what actors (by database ID) are in
# both the party and reserve party, this command lets you exchange one actor
# from the party with one from the reserves.
# IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS
# * $game_party.swap_by_id(party_actor_id, reserve_actor_id)
# * swap_by_id(party_actor_id, reserve_actor_id)
#
# Transfer Reservist to the Party by ID
# -------------------------------------
# Assuming there is a system tracking what actors (by database ID) are in
# the reserve party, this command lets you remove the actor from the reserve
# party and places it into the main/active party.
# * $game_party.transfer_to_party_by_id(reserve_actor_id)
# * transfer_to_party_by_id(reserve_actor_id)
#
# Transfer Party Member to the Reserves by ID
# -------------------------------------------
# Assuming there is a system tracking what actors (by database ID) are in
# main/active party, this command lets you remove the actor from the party
# and places it into the reserves.
# IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS
# * $game_party.transfer_to_reserve_by_id(party_actor_id)
# * transfer_to_reserve_by_id(party_actor_id)
#
#
#------------------------------------------------------------------------------
#
# CHANGES FROM THE ORIGINAL
#
# This revision creates an RPGAdvReserve module where configuration values are
# found. Originally, the script had only two values to adjust, but these were
# actively situated within the script itself. And this would require you to
# navigate through the script to find those values. The creation of the module
# should make it easier to define what settings are desired.
#
# The system had values that were hardwired into the original script, be these
# the color settings for Required Actor displays or the descriptive texts and
# warning notices within. These have also been migrated to the configuration
# section so you have no need to search within the scripts.
#
# Repairs had to be performed. You could previously exit the above described
# Party Changing menu with a party containing no members at all. This effec-
# tively would prevent the game to continue. The configuration section has a
# switch to permit this, but not recommended.
#
# Likewise, there were issues with identifying required and reservist members
# in the change party menu. RPG Advorate indeed created the Goldenrod Required
# member color, but never applied its use in the menu. This has been corrected
# while also creating a like color for reserve members appearing in the menus.
#
#
#------------------------------------------------------------------------------
#
# COMPATABILITY / SCRIPT ATTACHED CODE AND REWRITES
#
# This script, when initially released, was not designed to paste the contents
# in place, but instead instructed you to directly edit the default scripts.
# At the time of release, there was little knowledge of the 'alias' property
# which would allow the insertion of new code into methods. And this rework of
# his script takes advantage of the alias technique where it was possible.
# the default scripts. It was not released as a script to insert into
#
# Not all sections were able to benefit of the alias technique, those methods
# still requiring their code rewritten/overwritten. However, said methods have
# the rewritten sections identified.
#
# New Script Content:
# * RPGAdvReserve : (New) Used to hold configuration values
# * Game_Party : (Used by ChangeParty) Methods made to swap members
# * Window_Base : (Used by ChangeParty) Makes color identified names
# * Window_ChangeMain : (Used by ChangeParty) Draws the current party
# * Window_ChangeReserve : (Used by ChangeParty) Draws the reserve party
# * Window_PartyChangeInfo : (Used by ChangeParty) Draws recommended party size
# * Interpreter : Shortcut script calls made for the system
# * Scene_ChangeParty : Engine that switches party and reservists around
#
# Aliased Script Content:
# * Game_Actor : Adds the required member status variable
# * Game_Party : Makes the reserve array & alters add/remove member
#
# Rewritten Script Content:
# * Scene_Menu : update_status edited for reservist restrictions
# * Scene_Skill : main method altered to allow access to reserves
# * Scene_Equip : main method altered to allow access to reserves
# * Scene_Battle : start_phase5 altered to allow reserve EXP gains
#
# All scripts that are rewrites of the default scripts have their new code in
# defined areas beginning with either "Beginning of Replaced Code" or with
# "Beginning of Inserted Code", and ending with a like commented statement.
# In many cases, the original code is still available, but commented out for
# end-user recognition.
#
#
#==============================================================================
module RPGAdvReserve
# FEATURE SETTINGS
# =======================================================================
# If Reserve members appear in the menu status screen.
MENU_STATUS = true
# The percent of Exp reserve members get compared to active.
EXP_PERCENT = 100
# (NEW) Allow party to be emptied by Party Changer (not recommended)
# Original did not have a block to prevent emptying ... what a flaw!
PERMIT_EMPTY = true
# COLOR SETTINGS
# =======================================================================
# Color of actor name when required to be in party.
# Default 216,150,20,255: Goldenrod
COLOR_REQUIRED = Color.new(216, 150, 20, 255)
# Color of actor name in menu status if a reserve member.
# Default 152, 181, 100, 255: Olive
COLOR_RESERVIST = Color.new(152, 181, 100, 255)
# ACTOR WARNING MESSAGES
# =======================================================================
# A carte-blanch error if actor IDs values given are invalid
ID_INVALID = "ID given is invalid."
# Define the text used to show at least one invalid party or reservist ID.
SWAP_Invalid = "Cannot swap members. One or both are invalid."
# Define the text used to show the actor ID is not in the reservist party.
TO_PARTY_Invalid = "Warning: Character is not in the reserve party."
# Define the text used to show the party is full.
TO_PARTY_Full = "Warning: Main party is full."
# Define the text used to show the actor ID is not in the current party.
TO_RESERVE_Invalid = "Warning: Character is not in the main party."
# PARTY CHANGER MESSAGES
# =======================================================================
# Single-line text used to request a party be formed to default.
INFO_Request1 = "Please form a party."
# Dual-line text used to request a custom sized party. Must include {size}.
INFO_Request2a = "Please form a party"
INFO_Request2b = "of up to {size} members."
# Warning to note max size setting is invalid.
SIZE_Invalid = "Warning: Invalid max size for party."
# Text used to indicate empty position in party
EMPTY = "- Empty -"
DISALLOWED = "- Disallowed -"
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :required # required party member flag
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias rpgadv_reserve_g_actor_setup setup
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
def setup(actor_id)
#
rpgadv_reserve_g_actor_setup(actor_id) # Run the original method
@required = false # Add the additional flag
#
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :reserve_actors # reserve actors array
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias rpgadv_reserve_g_party_init initialize
alias rpgadv_reserve_g_party_setup_add add_actor
alias rpgadv_reserve_g_party_setup_remove remove_actor
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
rpgadv_reserve_g_party_init # Run the original method
@reserve_actors = [] # Add the additional array
#
end
#--------------------------------------------------------------------------
# * Add an Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
#
actor = $game_actors[actor_id] # Get actor
if @actors.size >= 4 # If the party is full
if not @actors.include?(actor) # If actor not in party
if not @reserve_actors.include?(actor) # If actor not in reserve
@reserve_actors.push(actor) # Add actor to reserve
return # And exit method
end
end
end
#
rpgadv_reserve_g_party_setup_add(actor_id) # Run the original method
#
end
#--------------------------------------------------------------------------
# * Remove Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def remove_actor(actor_id)
#
@reserve_actors.delete($game_actors[actor_id]) # Delete actor from reserve
rpgadv_reserve_g_party_setup_remove(actor_id) # Run the original method
#
end
#--------------------------------------------------------------------------
# * Swap Actors
# actor1 : actor
# actor2 : actor
#--------------------------------------------------------------------------
def swap(actor1, actor2)
#
error = false # Set no error
#
if not @actors.include?(actor1) # If actor1 not in party
error = true # Set error
end
if not @reserve_actors.include?(actor2) # If actor2 not in reserve
error = true # Set error
end
if error # If in error
print(RPGAdvReserve::SWAP_Invalid) # Display error message
return # And exit method
end
#
@reserve_actors.push(actor1) # Add party actor to reserve
@actors.delete(actor1) # Delete actor from party
add_actor(actor2.id) # Add reserve actor to party
@reserve_actors.delete(actor2) # Delete from reserve party
#
end
#--------------------------------------------------------------------------
# * Transfer to Party
# actor : actor
#--------------------------------------------------------------------------
def transfer_to_party(actor)
#
if not @reserve_actors.include?(actor) # If actor not in reserve
print(RPGAdvReserve::TO_PARTY_Invalid) # Display error message
return # And exit method
end
#
if @actors.size == 4 # If party is full
print(RPGAdvReserve::TO_PARTY_Full) # Display error message
return # And exit method
end
#
add_actor(actor.id) # Add reservist to party
@reserve_actors.delete(actor) # Delete from reserve party
#
end
#--------------------------------------------------------------------------
# * Transfer to Reserve
# actor : actor
#--------------------------------------------------------------------------
def transfer_to_reserve(actor)
#
if not @actors.include?(actor) # If actor not in party
print(RPGAdvReserve::TO_RESERVE_Invalid) # Display error message
return # And exit method
end
#
remove_actor(actor.id) # Delete actor from party
@reserve_actors.push(actor) # Add party actor to reserve
#
end
#--------------------------------------------------------------------------
# * Swap Actors by ID
# party_actor_id : actor ID
# reserve_actor_id : actor ID
#--------------------------------------------------------------------------
def swap_by_id(party_actor_id, reserve_actor_id)
#
return unless valid_id?(party_actor_id) # Exit if invalid actor ID
return unless valid_id?(reserve_actor_id) # Exit if invalid reserve ID
#
actor1 = $game_actors[party_actor_id] # Get party member actor
actor2 = $game_actors[reserve_actor_id] # Get reserve member actor
#
swap(actor1, actor2) # Swap the actors
#
end
#--------------------------------------------------------------------------
# * Transfer to Party by ID
# reserve_actor : actor ID
#--------------------------------------------------------------------------
def transfer_to_party_by_id(reserve_actor_id)
#
return unless valid_id?(reserve_actor_id) # Exit if invalid reserve ID
actor = $game_actors[reserve_actor_id] # Get reserve member actor
transfer_to_party(actor) # Transfer actor to party
#
end
#--------------------------------------------------------------------------
# * Transfer to Reserve by ID
# main_party_actor : actor ID
#--------------------------------------------------------------------------
def transfer_to_reserve_by_id(party_actor_id)
#
return unless valid_id?(party_actor_id) # Exit if invalid actor ID
actor = $game_actors[party_actor_id] # Get party member actor
transfer_to_reserve(actor) # Transfer actor to reserve
#
end
#--------------------------------------------------------------------------
# * Test for valid values above 0
# actor_id : actor ID
#--------------------------------------------------------------------------
def valid_id?(actor_id)
#
test = true # Assume passes
test = false if actor_id.nil? # Fail if nil
test = false unless actor_id.is_a?(Numeric) # Fail if not numeric
test = false if actor_id <= 0 # Exit if invalid value
return true if test # Exit true if passes
print(RPGAdvReserve::ID_INVALID) # Render ID alert
return false # Exit method false
#
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Required Color (Goldenrod)
#--------------------------------------------------------------------------
def required_color
return RPGAdvReserve::COLOR_REQUIRED
end
#--------------------------------------------------------------------------
# * Required Color (Olive)
#--------------------------------------------------------------------------
def reservist_color
return RPGAdvReserve::COLOR_RESERVIST
end
#--------------------------------------------------------------------------
# * Draw Required Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_required(actor, x, y)
self.contents.font.color = required_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# * Draw Reservist Name
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_reservist(actor, x, y)
self.contents.font.color = reservist_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#
self.contents.dispose # Erase contents at start
#
@item_max = $game_party.actors.size # Set max size by party
if RPGAdvReserve::MENU_STATUS # If Switch engaged
@item_max += $game_party.reserve_actors.size # Add reserves to size
end
#
wd = width - 32 # Set width
ht = @item_max * 120 - 32 # Set height by max size
self.contents = Bitmap.new(wd, ht) # Set contents
self.contents.clear # And make contents clear
#
actor_array = [] # create actor array
for actor in $game_party.actors # Cycle through party
actor_array.push(actor) # and push actors in array
end
if RPGAdvReserve::MENU_STATUS # If Switch engaged
for actor in $game_party.reserve_actors # Cycle through reserves
actor_array.push(actor) # and push actors in array
end
end
party_idx_max = $game_party.actors.size - 1 # Get last ID for party
#
for id in 0...@item_max # Cycle total actor size
x = 64 # Set X Coordinate
y = id * 116 # Set Y coord by counter
actor = actor_array[id] # Get actor by counter
#
draw_actor_graphic(actor, x - 40, y + 80) # Draw character
draw_actor_name(actor, x, y) # Draw name
if id > party_idx_max # If counter past party
draw_actor_reservist(actor, x, y) # Draw reservist name
end
draw_actor_class(actor, x + 144, y) # Draw class
draw_actor_level(actor, x, y + 32) # Draw level
draw_actor_state(actor, x + 90, y + 32) # Draw state
draw_actor_exp(actor, x, y + 64) # Draw exp
draw_actor_hp(actor, x + 236, y + 32) # Draw hp
draw_actor_sp(actor, x + 236, y + 64) # Draw sp
#
end
#
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
#
if @index < 0 # If no valid index
self.cursor_rect.empty # Remove cursor
else # Otherwise
y = @index * 116 - self.oy # Get y-position
wd = self.width - 32 # Get width
self.cursor_rect.set(0, y, wd, 96) # And set cursor dimension
end
if self.cursor_rect.y < 0 # If position less than 0
self.oy -= 116 # Reduce origin
refresh # Refresh menu contents
update_cursor_rect # And redraw cursor
end
if self.cursor_rect.y > 348 # If position over 348
self.oy += 116 # Increase origin
refresh # Refresh menu contents
update_cursor_rect # And redraw cursor
end
#
end
end
#==============================================================================
# ** Window_ChangeMain
#------------------------------------------------------------------------------
# This window displays the current party members in the Party Changer scene
#==============================================================================
class Window_ChangeMain < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(max_size=3)
#
super(0, 0, 320, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
@max_size = max_size
#
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#
self.contents.clear # Make contents clear
@item_max = 4 # Set max
for idx in 0..3 # Cycle through party max
x = 64 # Set text x coordinates
y = idx * 116 # Set Y coords by counter
if $game_party.actors[idx] != nil # If a valid actor
actor = $game_party.actors[idx] # Set actor
else # Otherwise
if idx > @max_size # If space above max size
text = RPGAdvReserve::DISALLOWED # Set disallowed text
else # Otherwise
text = RPGAdvReserve::EMPTY # Set empty space text
end
self.contents.draw_text(0,y+32,288,32,text,1) # Display the text
next # And skip to next actor
end
draw_actor_graphic(actor, x - 40, y + 80) # Draw Graphic
draw_actor_name(actor, x, y) # Draw name
if actor.required == true # If a required actor
draw_actor_required(actor, x, y) # Redraw Required name
end
draw_actor_level(actor, x + 160, y) # Draw Level
draw_actor_hp(actor, x, y + 32) # Draw HP
draw_actor_sp(actor, x, y + 64) # Draw SP
end
#
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
#
if @index < 0 # If no valid index
self.cursor_rect.empty # Remove cursor
else # Otherwise
y = @index * 116 # Get y-position
wd = self.width - 32 # Get width
self.cursor_rect.set(0, y, wd, 96) # And set cursor dimension
end
#
end
end
#==============================================================================
# ** Window_ChangeReserve
#------------------------------------------------------------------------------
# This window displays the reserve party members in the Party Changer scene
#==============================================================================
class Window_ChangeReserve < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
super(320, 0, 320, 360)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
#
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#
@item_max = $game_party.reserve_actors.size + 1 # Get reservist party max
size = 96 + @item_max * 96 - 32 # Set reservist area size
size = 328 if size < 328 # Limit size to window
#
self.contents.dispose # Erase contents area
self.contents = Bitmap.new(width - 32, size) # Set contents
self.contents.clear # And make contents clear
#
for idx in 0...$game_party.reserve_actors.size # Cycle through reservists
x = 64 # Set text x coordinates
y = idx * 116 # Set Y coords by counter
actor = $game_party.reserve_actors[idx] # Get reservist actor
draw_actor_graphic(actor, x - 40, y + 80) # Draw character
draw_actor_name(actor, x, y) # Draw name
draw_actor_level(actor, x + 160, y) # Draw Level
draw_actor_hp(actor, x, y + 32) # Draw HP
draw_actor_sp(actor, x, y + 64) # Draw SP
end
#
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
#
if @index < 0 # If no valid index
self.cursor_rect.empty # Remove cursor
else # Otherwise
y = @index * 116 - self.oy # Get y-position
wd = self.width - 32 # Get width
self.cursor_rect.set(0, y, wd, 96) # And set cursor dimension
end
if self.cursor_rect.y < 0 # If position less than 0
self.oy -= 116 # Reduce origin
refresh # Refresh menu contents
update_cursor_rect # And redraw cursor
end
if self.cursor_rect.y > 232 # If position over 232
self.oy += 116 # Increase origin
refresh # Refresh menu contents
update_cursor_rect # And redraw cursor
end
#
end
end
#==============================================================================
# ** Window_PartyChangeInfo
#------------------------------------------------------------------------------
# This window displays help information in the Party Changer scene
#==============================================================================
class Window_PartyChangeInfo < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :max_size # maximum party size
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(max_size)
#
super(320, 360, 320, 120)
self.contents = Bitmap.new(width - 32, height - 32)
@max_size = max_size
refresh
#
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#
self.contents.clear # And make contents clear
text1 = RPGAdvReserve::INFO_Request1 # Get Full Party Size note
text2 = RPGAdvReserve::INFO_Request2a # Get 1st Set party note
tempt = RPGAdvReserve::INFO_Request2b # Get 2nd Set party note
text3 = tempt.gsub(/{size}/) {(@max_size.to_s) } # Replace string with size
#
if @max_size == 0 # If max size default
self.contents.draw_text(4, 0, 240, 32, text1) # Show full party note
end
if @max_size > 0 # If alternate size
self.contents.draw_text(4, 0, 240, 32, text2) # Show 1st party note
self.contents.draw_text(4, 32, 240, 32, text3) # Show 2nd party note
end
#
end
end
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Swap Actors by database ID
# party_actor_id : actor ID
# reserve_actor_id : actor ID
#--------------------------------------------------------------------------
def swap_by_id(party_actor_id=1, reserve_actor_id=1)
$game_party.swap_by_id(party_actor_id, reserve_actor_id)
end
#--------------------------------------------------------------------------
# * Transfer to Party by database ID
# reserve_actor_id : actor ID
#--------------------------------------------------------------------------
def transfer_to_party_by_id(reserve_actor_id=1)
$game_party.transfer_to_party_by_id(reserve_actor_id)
end
#--------------------------------------------------------------------------
# * Transfer to Reserve by database ID
# party_actor_id : actor ID
#--------------------------------------------------------------------------
def transfer_to_reserve_by_id(party_actor_id=1)
$game_party.transfer_to_reserve_by_id(party_actor_id)
end
#--------------------------------------------------------------------------
# * Set required actor flag
# actor_id : actor ID
# flag : boolean value (true/false)
#--------------------------------------------------------------------------
def required_actor(actor_id=0, flag=true)
return if actor_id.nil? # Exit if nil
return unless value.is_a?(Numeric) # Exit if not numeric
return if actor_id <= 0 # Exit if invalid value
return if $game_party.actors[actor_id] == nil # Exit if no actor
return unless (flag == true || flag == false) # Exit if not boolean
$game_party.actors[actor_id].required = flag # Apply the flag
end
#--------------------------------------------------------------------------
# * Party Changer Menu
# max_size : party size maximum
#--------------------------------------------------------------------------
def change_party(max_size=0)
$scene = Scene_ChangeParty.new(max_size)
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
#
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
## If this actor's action limit is 2 or more
#if $game_party.actors[@status_window.index].restriction >= 2
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# * Beginning of Replaced Code
#--------------------------------------------------------------------
# Check actor restriction if index points to active party member
if @status_window.index < $game_party.actors.size
check_actor = $game_party.actors[@status_window.index]
else
# Or check actor restriction for reserve party member
size = $game_party.actors.size
check_actor = $game_party.reserve_actors[@status_window.index - size]
end
# If this actor's action limit is 2 or more
if check_actor.restriction >= 2
#--------------------------------------------------------------------
# * Replaced Code End
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
end
return
end
#
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
#
## Get actor
#@actor = $game_party.actors[@actor_index]
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# * Beginning of Replaced Code
#------------------------------------------------------------------------
# If actor index within party size
if @actor_index < $game_party.actors.size
# Get actor from party
@actor = $game_party.actors[@actor_index]
else
# Otherwise get actor from reserve party
idx = @actor_index - $game_party.actors.size
@actor = $game_party.reserve_actors[idx]
end
#------------------------------------------------------------------------
# * Replaced Code End
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Make help window, status window, and skill window
@help_window = Window_Help.new
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)
# Associate help window
@skill_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
end
end
#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
# This class performs equipment screen processing.
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
#
## Get actor
#@actor = $game_party.actors[@actor_index]
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# * Beginning of Replaced Code
#------------------------------------------------------------------------
# If actor index within party size
if @actor_index < $game_party.actors.size
# Get actor from party
@actor = $game_party.actors[@actor_index]
else
# Otherwise get actor from reserve party
idx = @actor_index - $game_party.actors.size
@actor = $game_party.reserve_actors[idx]
end
#------------------------------------------------------------------------
# * Replaced Code End
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Make windows
@help_window = Window_Help.new
@party_window = Window_EquipLeft.new(@actor)
@reserve_window = Window_EquipRight.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
# Associate help window
@reserve_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# Set cursor position
@reserve_window.index = @equip_index
refresh
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@party_window.dispose
@reserve_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
#
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
def start_phase5
#
# Shift to phase 5
@phase = 5
# Play battle end ME
$game_system.me_play($game_system.battle_end_me)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Initialize EXP, amount of gold, and treasure
exp = 0
gold = 0
treasures = []
# Loop
for enemy in $game_troop.enemies
# If enemy is not hidden
unless enemy.hidden
# Add EXP and amount of gold obtained
exp += enemy.exp
gold += enemy.gold
# Determine if treasure appears
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# Treasure is limited to a maximum of 6 items
treasures = treasures[0..5]
# Obtaining EXP
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# * Beginning of Inserted Code
#------------------------------------------------------------------------
# Obtain Reserve Character Exp Percentage
perc = RPGAdvReserve::EXP_PERCENT
# Reserve Characters Obtaining EXP
for i in 0...$game_party.reserve_actors.size
actor = $game_party.reserve_actors[i]
if actor.cant_get_exp? == false
actor.exp += exp * perc / 100
end
end
#------------------------------------------------------------------------
# * Inserted Code End
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Obtaining gold
$game_party.gain_gold(gold)
# Obtaining treasure
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# Make battle result window
@result_window = Window_BattleResult.new(exp, gold, treasures)
# Set wait count
@phase5_wait_count = 100
#
end
end
#==============================================================================
# ** Scene_ChangeParty
#------------------------------------------------------------------------------
# This class performs party management processing.
#==============================================================================
class Scene_ChangeParty
#--------------------------------------------------------------------------
# * Object Initialization
# max_size : max size of party
#--------------------------------------------------------------------------
def initialize(max_size=0)
#
# Obtain text warning
text = RPGAdvReserve::SIZE_Invalid
# Set message and exit If below 0
if max_size < 0
print(text)
return
end
# Set message and exit if above standard limit of 4
if max_size > 4
print(text)
return
end
# Set max size based on index positions (0-3) rather than (1-4)
@max_size = max_size
#
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
#
# Define party max for Change Party menu (0-3)
party_max = @max_size
party_max = 4 if party_max == 0
party_max -= 1
# Make windows
@party_window = Window_ChangeMain.new(party_max)
@reserve_window = Window_ChangeReserve.new
@info_window = Window_PartyChangeInfo.new(@max_size)
# Set window values
@party_window.index = 0
@reserve_window.index = -1
@party_window.active = true
@reserve_window.active = false
# Clear memorized actors
@actor1 = nil
@actor2 = nil
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@party_window.dispose
@reserve_window.dispose
@info_window.dispose
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def update
# Update windows
@party_window.update
@reserve_window.update
@info_window.update
# If party window is active: call update_party
return update_party if @party_window.active
# If reserve window is active: call update_reserve
return update_reserve if @reserve_window.active
end
#--------------------------------------------------------------------------
# * Frame Update (when updating the party window)
#--------------------------------------------------------------------------
def update_party
# If B button was pressed
if Input.trigger?(Input::B)
# If party is empty and not permitted to empty
if $game_party.actors.size == 0 && !RPGAdvReserve::PERMIT_EMPTY
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If party is larger than maximum size
val = @max_size
val = 4 if val == 0
if $game_party.actors.size > val
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Set party window cursor position
place = @party_window.index
# if cursor goes beyond party size and no one in that spot
if @max_size > 0
if place >= @max_size
if $game_party.actors[place].nil?
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
# If party member exists at cursor position
if $game_party.actors[place] != nil
# And if party is required (cannot remove)
if $game_party.actors[place].required
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
# If there are no reserve party members
if $game_party.reserve_actors.size == 0
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Transfer the actor to the reserve party
$game_party.transfer_to_reserve($game_party.actors[place])
# Refresh both windows
@party_window.refresh
@reserve_window.refresh
return
end
# If reserve party members exist
if $game_party.reserve_actors.size > 0
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make reserve window active
@party_window.active = false
@reserve_window.index = 0
@reserve_window.active = true
# Memorize party member
@actor1 = $game_party.actors[place]
return
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (when updating the reserve window)
#--------------------------------------------------------------------------
def update_reserve
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make party window active
update_activate_party_window
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Set reserve window cursor position
place = @reserve_window.index
# if cursor goes beyond reserve party size
if place == $game_party.reserve_actors.size
# If no memorized party actor
if @actor1 == nil
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Transfer stored party member to reserves
$game_party.transfer_to_reserve(@actor1)
# Make party window active
update_activate_party_window
return
end
# If there is no stored party actor
if @actor1 == nil
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Memorize reserve member
@actor2 = $game_party.reserve_actors[place]
# Transfer reserve member to party
$game_party.transfer_to_party(@actor2)
# Make party window active
update_activate_party_window
return
# If there a stored party actor exists
else
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Memorize reserve member
@actor2 = $game_party.reserve_actors[place]
# Swap both party and reserve party members
$game_party.swap(@actor1, @actor2)
# Make party window active
update_activate_party_window
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (when making the party window active)
#--------------------------------------------------------------------------
def update_activate_party_window
#
# Make party window active
@reserve_window.index = -1
@reserve_window.active = false
@party_window.active = true
@party_window.refresh
@reserve_window.refresh
#
end
endInstructions
Place below Scene_Debug and above Main. It rewrites methods in four Scene_ classes, so it should be high in your list of custom scripts. Be aware it may conflict with the menu, skill, equip and battle treasure systems.
Detailed instructions are included in the script itself.
Compatibility
As noted, there are major rewrites. Be warned.
Credits and Thanks
RPGAdvocate for the original version.
Terms and Conditions
There were no terms of use listed at RPG Advocate's site, Phylomortis.com. However, I would think it would be prudent to give him credit for the work.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links

![[Image: QrnbKlx.jpg]](https://i.imgur.com/QrnbKlx.jpg)
![[Image: sGz1ErF.png]](https://i.imgur.com/sGz1ErF.png)
![[Image: liM4ikn.png]](https://i.imgur.com/liM4ikn.png)
![[Image: fdzKgZA.png]](https://i.imgur.com/fdzKgZA.png)
![[Image: sj0H81z.png]](https://i.imgur.com/sj0H81z.png)
![[Image: QL7oRau.png]](https://i.imgur.com/QL7oRau.png)
![[Image: uSqjY09.png]](https://i.imgur.com/uSqjY09.png)
![[Image: GAA3qE9.png]](https://i.imgur.com/GAA3qE9.png)
![[Image: 2Hmnx1G.png]](https://i.imgur.com/2Hmnx1G.png)
![[Image: BwtNdKw.png%5B]](https://i.imgur.com/BwtNdKw.png%5B)