Okay, so I found this script for adding an actor battler to the battle scene but there's something that I need help with. How do I make it refresh/check if the actor has changed?
I'm using
KGC's LargeParty script so that you can swap characters in battle (this happens before your turn, during the Fight/Auto/Escape phase). As it stands, when I change character the same portrait show up every time.
I'd like it to refresh before your turn, or ideally after you switch party members. Any ideas?
#==============================================================================
# ** Actor_Battler Module
#------------------------------------------------------------------------------
# A module containing configurable data for the Actor Battler Graphic system.
#==============================================================================
module Actor_Battler
# Actor battler array
ACTOR = Array.new # Do not touch -_^
#========================================================================
# ** C O N F I G U R A T I O N S Y S T E M ** #
#========================================================================
# --Positioning--
# Actor Battler positioning system
#
CENTER_X = true # If true, centers actors rather than default lineup.
DEFAULT_X = 8 # Default party Max
SCREEN_Y = 400 # Vertical height of battlers
SCREEN_X = 0 # Vertical height of battlers
TRANSPARENT = false # If true, makes lightly transparent until attacking.
# --Actor List--
# Add your actor battlers here
#
# Actor# Filename, Hue (optional)
ACTOR[1] = ["Battle - Sorionne"]
ACTOR[2] = ["Battle - Denn"]
ACTOR[3] = ["Battle - Vila", 0]
ACTOR[4] = ["Battle - Lourne", 0]
ACTOR[5] = ["Battle - Orcas", 0]
ACTOR[6] = ["Battle - Mielle", 0]
ACTOR[7] = ["Battle - Hellem", 0]
ACTOR[8] = ["Battle - Ruon", 0]
#========================================================================
# ** E N D O F C O N F I G U R A T I O N ** #
#========================================================================
end
#==============================================================================
# ** RPG Module
#------------------------------------------------------------------------------
# A module containing RPGVX Data Structures.
#==============================================================================
module RPG
#============================================================================
# ** Actor
#----------------------------------------------------------------------------
# Data class for actors
#============================================================================
class Actor
#------------------------------------------------------------------------
# * Alias Listings
#------------------------------------------------------------------------
alias actorbattler_init initialize
#------------------------------------------------------------------------
# * Object Initialization
#------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_init
@battler_name = ""
@battler_hue = 0
end
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_main_phase # battle flag: main phase
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_initialize
# Set the main phase flag to false
@battle_main_phase = false
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actorbattler_max # Max. size for centered battlers
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
actorbattler_initialize
# Set 'Centered' battler max to 4 (default)
@actorbattler_max = Actor_Battler::DEFAULT_X
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :screen_x # battle screen X coordinate
attr_accessor :screen_y # battle screen Y coordinate
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
# actor_id : actor ID
#--------------------------------------------------------------------------
def initialize(actor_id)
# Perform the original call
actorbattler_init(actor_id)
# Apply battler graphic
@battler_name = Actor_Battler::ACTOR[actor_id][0]
# Apply battler hue if exists, else default of '0'
if Actor_Battler::ACTOR[actor_id][1] != nil
@battler_hue = Actor_Battler::ACTOR[actor_id][1]
else
@battler_hue = 0
end
end
#--------------------------------------------------------------------------
# * Change Battler
# battler_name : new battler graphic filename
# battler_hue : new battler hue setting (default = 0)
#--------------------------------------------------------------------------
def set_battler(battler_name = "", battler_hue = 0)
@battler_name = battler_name
@battler_hue = battler_hue
end
#--------------------------------------------------------------------------
# * Use Sprites?
#--------------------------------------------------------------------------
def use_sprite?
return true
end
#--------------------------------------------------------------------------
# * Get Battle Screen X-Coordinate
#--------------------------------------------------------------------------
def screen_x
return Actor_Battler::SCREEN_X
end
#--------------------------------------------------------------------------
# * Get Battle Screen Y-Coordinate
#--------------------------------------------------------------------------
def screen_y
return Actor_Battler::SCREEN_Y
end
#--------------------------------------------------------------------------
# * Get Battle Screen Z-Coordinate
#--------------------------------------------------------------------------
def screen_z
# Return after calculating z-coordinate by order of members in party
if self.index != nil
return $game_party.members.size - self.index
else
return 0
end
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Perform the original call
actorbattler_update
# If the actor battlers are lightly transparent until they act
if Actor_Battler::TRANSPARENT == true
# If the battler is a visible actor battler
if @battler.is_a?(Game_Actor) and @battler_visible
# Bring opacity level down a bit when not in main phase
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
end
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within the
# Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Create Actor Sprite
# Removes the 'empty' battler image used by the default system and
# replaces it. It also observes the actual size of the party and
# not a predetermined 4-party limit.
#--------------------------------------------------------------------------
def create_actors
@actor_sprites = []
for actor in $game_party.members.reverse
@actor_sprites.push(Sprite_Battler.new(@viewport2, actor))
end
end
#--------------------------------------------------------------------------
# * Update Actor Sprite
#--------------------------------------------------------------------------
def update_actors
# Reset actor battler sprites if party size increases
if $game_party.members.size > @actor_sprites.size
dispose_actors
create_actors
end
for sprite in @actor_sprites
sprite.update
end
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias actorbattler_s start
alias actorbattler_spcs start_party_command_selection
alias actorbattler_pv process_victory
alias actorbattler_ea execute_action
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
actorbattler_s
$game_temp.battle_main_phase = false
end
#--------------------------------------------------------------------------
# * Start party command selection
#--------------------------------------------------------------------------
def start_party_command_selection
actorbattler_spcs
if $game_temp.in_battle
$game_temp.battle_main_phase = false
end
end
#--------------------------------------------------------------------------
# * Victory Processing
#--------------------------------------------------------------------------
def process_victory
$game_temp.battle_main_phase = false
actorbattler_pv
end
#--------------------------------------------------------------------------
# * Start Execution of Battle Processing
#--------------------------------------------------------------------------
def execute_action
actorbattler_ea
$game_temp.battle_main_phase = true
end
end
I already tried adding the code below under the "class Spriteset_Battle part of the script but it didn't work.
alias actorbattler_spriteset_update update
def update
# Perform the original call
actorbattler_spriteset_update
update_actors
end
Any help would be greatly appreciated!