Multi-View CBS
Version: 1.0
Version: 1.0
Introduction
This CBS supports front and side view positions (possibly more if you work with the script), included with the CBS is my Animated Battlers script, and my Battle Formation System. This is still in a beta state, but almost all of the features I planned for the first version are done and the script is in a "presentable" state. This script is also SDK compliant. (was originally a Front View Battle System)
Screenshots
Formation Changing Scene
http://img201.imageshack.us/img201/6776/formationqx8.th.png[/IMG]http://img182.imageshack.us/img182/4872/formation2yh6.th.png[/IMG]http://img82.imageshack.us/img82/6430/formation3zs2.th.png[/IMG]
Front View Style
http://img207.imageshack.us/img207/1329/front1yw6.th.png[/IMG]http://img183.imageshack.us/img183/9555/front2lw9.th.png[/IMG]http://img92.imageshack.us/img92/887/front3pf4.th.png[/IMG]
Side View Style
http://img201.imageshack.us/img201/7351/side1jf6.th.png[/IMG]http://img183.imageshack.us/img183/1209/side2mu8.th.png[/IMG]http://img242.imageshack.us/img242/3519/side3kf3.th.png[/IMG]
Demo
http://www.rmxp.org/forums/local_links.php?catid=29&linkid=1122
Instructions
Where shall I begin?
Copy all of the scripts from the demo above main but below the SDK, The Options can be configured in the script Master Options List The options are pretty self-explanatory since these lines are commented.
Options
Spoiler
module Battler_Setup
#==============================================================================
# Graphical Settings
#==============================================================================
#set this to true for animated enemies (Do not set to false for now)
ANIMATED_ENEMIES = true
#default number of frames for each sprite
DEFAULT_FRAMES = 4
#Personalized number of frames
# {file => frames, file => frames, ...}
FRAMES = {
'guy_item' => 1, 'guy_defend' => 1, 'guy_damaged' => 1, 'guy_death' => 1,
'random_person_death' => 1, 'arshes_death' => 1, 'gloria_death' => 1
}
#default zoom level
DEFAULT_ZOOM_LEVEL = 2.0
#Individual zoom_level
# {file => frames, file => frames, ...}
ZOOM_LEVEL = {
'guy' => 1.0, 'ghost' => 1.0, 'troll' => 1.0, 'random_person_death' => 1.0,
'arshes_death' => 1.0, 'gloria_death' => 1.0
}
#Default Opacity
DEFAULT_OPACITY = 255
#Indiviual Battler Opacity
# {file => opacity, file => opacity, ...}
OPACITY = {'ghost' => 128}
#==============================================================================
# Movement Settings
#==============================================================================
#Movement Poses (for 8-directional movement/ 8 directional charactersets)
MOVEMENT_POSES = 4
#Moving actors/enemies
BATTLERS_MOVE = true
#==============================================================================
# System Settings (Positions Features Etc)
#==============================================================================
#Party command window enable
Party_Command_Window_Enable = false
#Battle Status Hidden?
Battle_Status_Hidden = true
#Battle Status Visible During Command Phase
Battle_Status_Command_Phase = false
#Battle Status Show Buttion (Input::BUTTON)
Battle_Status_Show = Input::SHIFT
#Battle Help Window Enable
Battle_Help_Enable = true
#Allow To Attack Backer Rows Before Rows in front are dealt with
#Attack_Rows_In_Back = false
end
#==============================================================================
# ** Game_BattleOptions
#------------------------------------------------------------------------------
# Controls all battle options that are able to be switched on and off at runtime
# and also is saved with save data
#==============================================================================
class Game_BattleOptions
attr_accessor :view_style
attr_accessor :command_window_x
attr_accessor :command_window_y
attr_accessor :moving_battlers
attr_accessor :move_into_battle
attr_accessor :move_into_formation
attr_accessor :actor_move_in_x_offset
attr_accessor :actor_move_in_y_offset
attr_accessor :enemy_move_in_x_offset
attr_accessor :enemy_move_in_y_offset
attr_accessor :move_out_battle
attr_accessor :actor_move_out_x_offset
attr_accessor :actor_move_out_y_offset
attr_accessor :enemy_move_out_x_offset
attr_accessor :enemy_move_out_y_offset
attr_accessor :move_out_escape
attr_accessor :actor_escape_x_offset
attr_accessor :actor_escape_y_offset
attr_accessor :enemy_escape_x_offset
attr_accessor :enemy_escape_y_offset
attr_accessor :formation_pose
attr_accessor :command_direction
attr_accessor :victory_direction
attr_accessor :other_direction
attr_accessor :battleback
attr_accessor :current_map
attr_accessor :show_events
attr_accessor :update_map
attr_accessor :map_id
def initialize
# The View Style Front or Side for now (for movement)
@view_style = 'front'
# The X Position of the Command Window (String)
@command_window_x = "0"
# The Y Position of the Command Window (String)
@command_window_y = "0"
# Moving Battlers
@moving_battlers = true
# Move into Battle
@move_into_battle = true
# In Scene_Formation Move into battle
@move_into_formation = true
# Actors Move into Battle X offset (Scene_Battle/Scene_Formation)
@actor_move_in_x_offset = "actor.screen_x"
# Actors Move into Battle Y offset (Scene_Battle/Scene_Formation)
# actor = Game_Battler object
@actor_move_in_y_offset = "actor.screen_y + 404"
# Enemies Move into Battle X offset (Scene_Battle)
@enemy_move_in_x_offset = "actor.screen_x"
# Enemies Move into Battle Y offset (Scene_Battle)
@enemy_move_in_y_offset = "actor.screen_y - 420"
# Move out of Battle when won (FF2 Style)
@move_out_battle = true
# Move out of Battle Position X
@actor_move_out_x_offset = "740"
# Move out of Battle Position Y (actor = Sprite_Battler)
@actor_move_out_y_offset = "actor.y"
# Move out of Battle Position X
@enemy_move_out_x_offset = "0"
# Move out of Battle Position Y (actor = Sprite_Battler)
@enemy_move_out_y_offset = "actor.y-420"
# Move out When Escaping
@move_out_escape = true
# Move out of Battle Position X
@actor_escape_x_offset = "actor.x"
# Move out of Battle Position Y (actor = Sprite_Battler)
@actor_escape_y_offset = "404 + actor.y"
# Move out of Battle Position X
@enemy_escape_x_offset = "0"
# Move out of Battle Position Y (actor = Sprite_Battler)
@enemy_escape_y_offset = "actor.y-420"
# Pose Used in Scene_Formation
@formation_pose = 'down'
# Command Pose Direction (Character sets)
@command_direction = 'down'
# Victory Pose Direction (Character sets)
@victory_direction = 'down'
# Other Poses Direction (Character sets)
@other_direction = {'Game_Actor' => 'up', 'Game_Enemy' => 'down'}
# Use Battle backs for battle background
@battleback = true
# Use The Current Map for battle background
@current_map = false
# If using Current Map show Events?
@show_events = false
# If using Map for battle back the map id used (0=disable)
@map_id = 0
# If using Map for battle back update map while battling
@update_map = false
end
end
#==============================================================================
# Graphical Settings
#==============================================================================
#set this to true for animated enemies (Do not set to false for now)
ANIMATED_ENEMIES = true
#default number of frames for each sprite
DEFAULT_FRAMES = 4
#Personalized number of frames
# {file => frames, file => frames, ...}
FRAMES = {
'guy_item' => 1, 'guy_defend' => 1, 'guy_damaged' => 1, 'guy_death' => 1,
'random_person_death' => 1, 'arshes_death' => 1, 'gloria_death' => 1
}
#default zoom level
DEFAULT_ZOOM_LEVEL = 2.0
#Individual zoom_level
# {file => frames, file => frames, ...}
ZOOM_LEVEL = {
'guy' => 1.0, 'ghost' => 1.0, 'troll' => 1.0, 'random_person_death' => 1.0,
'arshes_death' => 1.0, 'gloria_death' => 1.0
}
#Default Opacity
DEFAULT_OPACITY = 255
#Indiviual Battler Opacity
# {file => opacity, file => opacity, ...}
OPACITY = {'ghost' => 128}
#==============================================================================
# Movement Settings
#==============================================================================
#Movement Poses (for 8-directional movement/ 8 directional charactersets)
MOVEMENT_POSES = 4
#Moving actors/enemies
BATTLERS_MOVE = true
#==============================================================================
# System Settings (Positions Features Etc)
#==============================================================================
#Party command window enable
Party_Command_Window_Enable = false
#Battle Status Hidden?
Battle_Status_Hidden = true
#Battle Status Visible During Command Phase
Battle_Status_Command_Phase = false
#Battle Status Show Buttion (Input::BUTTON)
Battle_Status_Show = Input::SHIFT
#Battle Help Window Enable
Battle_Help_Enable = true
#Allow To Attack Backer Rows Before Rows in front are dealt with
#Attack_Rows_In_Back = false
end
#==============================================================================
# ** Game_BattleOptions
#------------------------------------------------------------------------------
# Controls all battle options that are able to be switched on and off at runtime
# and also is saved with save data
#==============================================================================
class Game_BattleOptions
attr_accessor :view_style
attr_accessor :command_window_x
attr_accessor :command_window_y
attr_accessor :moving_battlers
attr_accessor :move_into_battle
attr_accessor :move_into_formation
attr_accessor :actor_move_in_x_offset
attr_accessor :actor_move_in_y_offset
attr_accessor :enemy_move_in_x_offset
attr_accessor :enemy_move_in_y_offset
attr_accessor :move_out_battle
attr_accessor :actor_move_out_x_offset
attr_accessor :actor_move_out_y_offset
attr_accessor :enemy_move_out_x_offset
attr_accessor :enemy_move_out_y_offset
attr_accessor :move_out_escape
attr_accessor :actor_escape_x_offset
attr_accessor :actor_escape_y_offset
attr_accessor :enemy_escape_x_offset
attr_accessor :enemy_escape_y_offset
attr_accessor :formation_pose
attr_accessor :command_direction
attr_accessor :victory_direction
attr_accessor :other_direction
attr_accessor :battleback
attr_accessor :current_map
attr_accessor :show_events
attr_accessor :update_map
attr_accessor :map_id
def initialize
# The View Style Front or Side for now (for movement)
@view_style = 'front'
# The X Position of the Command Window (String)
@command_window_x = "0"
# The Y Position of the Command Window (String)
@command_window_y = "0"
# Moving Battlers
@moving_battlers = true
# Move into Battle
@move_into_battle = true
# In Scene_Formation Move into battle
@move_into_formation = true
# Actors Move into Battle X offset (Scene_Battle/Scene_Formation)
@actor_move_in_x_offset = "actor.screen_x"
# Actors Move into Battle Y offset (Scene_Battle/Scene_Formation)
# actor = Game_Battler object
@actor_move_in_y_offset = "actor.screen_y + 404"
# Enemies Move into Battle X offset (Scene_Battle)
@enemy_move_in_x_offset = "actor.screen_x"
# Enemies Move into Battle Y offset (Scene_Battle)
@enemy_move_in_y_offset = "actor.screen_y - 420"
# Move out of Battle when won (FF2 Style)
@move_out_battle = true
# Move out of Battle Position X
@actor_move_out_x_offset = "740"
# Move out of Battle Position Y (actor = Sprite_Battler)
@actor_move_out_y_offset = "actor.y"
# Move out of Battle Position X
@enemy_move_out_x_offset = "0"
# Move out of Battle Position Y (actor = Sprite_Battler)
@enemy_move_out_y_offset = "actor.y-420"
# Move out When Escaping
@move_out_escape = true
# Move out of Battle Position X
@actor_escape_x_offset = "actor.x"
# Move out of Battle Position Y (actor = Sprite_Battler)
@actor_escape_y_offset = "404 + actor.y"
# Move out of Battle Position X
@enemy_escape_x_offset = "0"
# Move out of Battle Position Y (actor = Sprite_Battler)
@enemy_escape_y_offset = "actor.y-420"
# Pose Used in Scene_Formation
@formation_pose = 'down'
# Command Pose Direction (Character sets)
@command_direction = 'down'
# Victory Pose Direction (Character sets)
@victory_direction = 'down'
# Other Poses Direction (Character sets)
@other_direction = {'Game_Actor' => 'up', 'Game_Enemy' => 'down'}
# Use Battle backs for battle background
@battleback = true
# Use The Current Map for battle background
@current_map = false
# If using Current Map show Events?
@show_events = false
# If using Map for battle back the map id used (0=disable)
@map_id = 0
# If using Map for battle back update map while battling
@update_map = false
end
end
Expand to see the code.
Notes: Frames, Zoom level, and Opacity
the format for their hashes are
{file => value, file => value, ...} (the ... means going on and on)
where file is the name of the battler to set a default for the whole sprite
or file_(pose) to the the value for that pose, yes this allows for multiple frames per battler, I'll talk about the different poses later (see template).
Battle Formations
This is the probably the core of this script along with the animated battlers, since this sets the battlers position in battle I have came up with a few formations that I included in the demo, lets take a look at the data structure
Names << String
Number_Members << String(!)
Front_Row << Array
Middle_Row << Array
Back_Row << Array
Screen_X << String/Hash
Screen_Y << String/Hash
Effects << {String => String(!), String => String(!), ...}
Description << String
Number_Members << String(!)
Front_Row << Array
Middle_Row << Array
Back_Row << Array
Screen_X << String/Hash
Screen_Y << String/Hash
Effects << {String => String(!), String => String(!), ...}
Description << String
Expand to see the code.
Example from Demo
Spoiler
#============================================================================
# Free Fight Formation
#----------------------------------------------------------------------------
# Description:
# Default Formation. Note: The First Formation must support 1 to the the maximum number
# of Actors in your party
#----------------------------------------------------------------------------
# Appearance:
#
# For One Actor Party
#
#
# 1
# For Two Actor Party
#
#
# 2 3
# For Three Actor Party
#
#
# 1 2 3
# For Four Actor Party
#
#
# 1 2 3 4
#============================================================================
Names << "Free Fight"
Number_Members << '1-4'
Front_Row << []
Middle_Row << []
Back_Row << [0,1,2,3]
Screen_X << "(4 - $game_party.actors.size) * 80 + index * 160 + 80"
Screen_Y << "452"
Effects << {}
Description << "The Default Formation"
# Free Fight Formation
#----------------------------------------------------------------------------
# Description:
# Default Formation. Note: The First Formation must support 1 to the the maximum number
# of Actors in your party
#----------------------------------------------------------------------------
# Appearance:
#
# For One Actor Party
#
#
# 1
# For Two Actor Party
#
#
# 2 3
# For Three Actor Party
#
#
# 1 2 3
# For Four Actor Party
#
#
# 1 2 3 4
#============================================================================
Names << "Free Fight"
Number_Members << '1-4'
Front_Row << []
Middle_Row << []
Back_Row << [0,1,2,3]
Screen_X << "(4 - $game_party.actors.size) * 80 + index * 160 + 80"
Screen_Y << "452"
Effects << {}
Description << "The Default Formation"
Expand to see the code.
Names
is a String and is the name of the formation
Number of Members
is a Special String (A Range String) which may be setup like so "n, a-b, ^n"' Entries are separated by commas (n, a, and b are Integers)
the first adds n to the range, the second adds a-b to the range, and the last deletes n from the range
Examples
Spoiler
"1-3" will result in numbers 1, 2 and 3
"4" will result in the number 4
"^7" will result in nothing (which will propably result in a bug later)
"1-5, 7" will result in the numbers 1,2,3,4,5, and 7
"4-7, ^6" will result in the numbers 4,5,7
"7, ^7" will result in nothing
"1-10, ^4, 16, 11-12" will result with 1,2,3,5,6,7,8,9,10,11,12, and 16
"4" will result in the number 4
"^7" will result in nothing (which will propably result in a bug later)
"1-5, 7" will result in the numbers 1,2,3,4,5, and 7
"4-7, ^6" will result in the numbers 4,5,7
"7, ^7" will result in nothing
"1-10, ^4, 16, 11-12" will result with 1,2,3,5,6,7,8,9,10,11,12, and 16
Number Members is the number of members allowable in the formation if the number of numbers is not included in the numbers formed a formation break occurs (The Formation is Broken and will go to the default formation)
Note: The Default (First) Formation must support the 1 to the maximum number of people in the party or else you will receive an error
Front Row, Middle Row, and Back Row
These sets the row the actor is on, The classes Position variable was
replaced with this. Also influences who the enemy attacks. (use 0 for
the first member in the party 1 for the second and so on)
Screen_X and Screen_Y
This can either be a String (holds the formula) or a Hash (appoints the
positions by member index here are two pictures to help you with that
Formation Map
Spoiler
Here is a good example it places the four battlers in positions forming a square (Go on ahead scribble on the pictures to get a good look at this example)
Screen_X << {0 => 240, 1 => 320, 2 => 240, 3 => 320}
Screen_Y << {0 => 388, 1 => 388, 2 => 452, 3 => 452}
Effects
Here comes the fun part, you get to decide on stat bonuses and other effects of using this formation. It is a Special String (Increaser String) setup like so {, }
where index is an index of a party member, all is for every party member
and row type is either front, middle, or back for their respective rows
effects is a string setup like so ":<*/-+>