#=============================================================================
# Kylock's Dynamic Party Positions for RPG Tankentai Sideview Battle System
# By Kylock
#=============================================================================
# This add-on by Kylock will dynamically change the positioning of
# party members in battle depending on the amount of party members that
# are fighting. This script has no effect on anything else besides how
# actor sprites are positioned.
#
# To customize coordinates, read the comments in the middle of this script.
#
# The ACTOR_POSITION array and MAX_MEMBERS value in the SBS Configurations
# script are overwritten by this script.
#
# Positions will not be dynamic when used in Battle Test.
#
# *Installation:
# This script add-on should be placed below the Sideview scripts in the
# script editor. KGC_LargeParty should be placed BELOW this add-on if you are
# using that script.
#
# *Script comments added by Mr. Bubble.
#=============================================================================
module N01
MAX_BATTLE_MEMBERS = 4 # Max battle members in a party. This value is
# overwritten by KGC_LargeParty.
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
MAX_MEMBERS = N01::MAX_BATTLE_MEMBERS # Maximum number of party members
def add_actor(actor_id)
if @actors.size < MAX_MEMBERS and not @actors.include?(actor_id)
@actors.push(actor_id)
$game_player.refresh
update_formation
end
end
def setup_starting_members
@actors = []
for i in $data_system.party_members
@actors.push(i)
end
update_formation
end
def remove_actor(actor_id)
@actors.delete(actor_id)
$game_player.refresh
update_formation
end
def update_formation
case @actors.size
# This section is where you define your member coordinates.
# The coordinate set that is used depends on the amount of actors battling.
# Settings for up to 5 members are already pre-defined, but more can be added.
# These coordinates are not used in Battle Test. See bottom of script for info.
when 1: $ACTOR_POSITION = [[415,185],[0,0],[0,0],[0,0]]
when 2: $ACTOR_POSITION = [[395,155],[435,215],[0,0],[0,0]]
when 3: $ACTOR_POSITION = [[385,140],[415,185],[445,230],[0,0]]
when 4: $ACTOR_POSITION = [[385,140],[405,170],[425,200],[445,230]]
end
end
end
module N01
#--------------------------------------------------------------------------
# ● Settings
#--------------------------------------------------------------------------
# Actor starting posistions
# X Y X Y X Y X Y
#$ACTOR_POSITION = [[440,200],[480,160],[455,200],[505,220],[480,260]]
# Maximum party members that can fight at the same time.
# Remember to add to the ACTOR_POSITION array to accomodate.
MAX_MEMBER = N01::MAX_BATTLE_MEMBERS
end
class Game_Actor < Game_Battler
def base_position # Actor positions for Battle Test only.
$ACTOR_POSITION = [[430,140],[480,160],[455,200],[505,220],[480,260]] if $BTEST
$game_party.update_formation
base = $ACTOR_POSITION[self.index]
@base_position_x = base[0]
@base_position_y = base[1]
# バックアタック時はX軸を逆に
@base_position_x = Graphics.width - base[0] if $back_attack && N01::BACK_ATTACK
end
end
#Alternative
=begin
class Scene_File
alias_method(:write_save_data_ILC_beforeActorPosition, :write_save_data)
def write_save_data(file)
write_save_data_ILC_beforeActorPosition(file)
Marshal.dump($ACTOR_POSITION, file)
end
alias_method(:read_save_data_ILC_beforeActorPosition, :read_save_data)
def read_save_data(file)
read_save_data_ILC_beforeActorPosition(file)
$ACTOR_POSITION = Marshal.load(file)
end
end
=end