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)
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
Code:
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
#==============================================================================
# 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
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
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.
#============================================================================
# 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"
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
"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
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.
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 ":<*/-+><*/-+>..., ..."
is one of the stats (maxhp, maxsp, str, dex, agi, int, pdef, mdef, eva, atk) or damage for now, obviously <*/-+> is an operator and and an integer
so {0 => "atk:*3+40,maxhp:+50,maxsp:+40", 'front' => 'damage:*2', 'back' => 'damage:/2'} will..
Raise Party members 1's 3 times and adds 40, Raises Maximum Hp by 50, and Maximum Sp by 40
Anyone in Front Row Damage is increased by twice as much
Anyone in Back Row Damage is reduced by Half
Description
self-explanatory, press shift in Scene_Formation to display it, which utilizes my draw text scripting tool see this topic for information on how to use it
But really if you don't get any of these then check the demo for examples
Using Formations
By Default Every Formation is Disabled and will not appear in Scene_Formation (I did this to prevent formations that give uber bonuses to be gained later in the game), To enable a formation do this.
and it will appear in the Formation list in Scene_Formation, provided if the correct number of party members are in the party.
Templates
There are two templates for this CBS but only one of them is required (movement template for enemies) (you'll get better results if you use both), The First Template is the movement template, just look at any characterset for the template (Down Facing, Left Facing, Right Facing, Up Facing).
You may remove down and up facing (leaving a blank space for the poses) if you plan to use this as a side-view battle system, if you edit the options correctly you can allow for eight movement poses (or you can wait for an update), If the movement template is not found (for actors loads their characterset, for enemies you will recieve an error) the movement template file must be named (battler_name) + _movement (ex. name_movement)
where battler_name is in lowercase and all spaces replaced with underscores "_"
Exceptions
If you name a file (battler_name) + one of the pose names (see template) then that file will be loaded and the one from the template (if found) will be removed, this is similiar to how ccoa's CBS loads battlers
Conversions
You can use the other templates in this battle system (Minkoff's and Cybersams (You just have rename the battlers used from ccoa's), and you may configure a custom template (not completed)), but they must be named specially. For Minkoff its (battler_name) + _default + _m, for Cybersam its (battler_name) + _default + _c, and for custom templates (Supports 3 Custom Templates) its (battler_name) + _default + _c(1 2 or 3). This Also loads the movement poses from the templates (loading from cybersam's requires flipping the move to enemy pose).
Last Feature
If the Upper Left Pixel on a Pose is Black (0,0,0) then it will load the default for that pose (see Second Template Not Found), you shouldn't use black as a transparent color. since the script will get confused and load the default when you didn't want it to. (If anything I've added a debug method called test, call it in a call script to see each pose for the battler), here it is just add it in a new script above main and do test() where is a Game_Battler object ($game_party.actors[0], $game_actors[4])
Code:
def test(battler)
array = ['down','left','right','up','command','ready','attack','skill','defend','item',
'damaged','status','death','victory']
sprite = Sprite.new
poses = RPG::Poses.new(battler)
for i in 0...14
sprite.bitmap = poses[array[i]].bitmap
p array[i]
end
end
Change to Side View
Ctrl+Shift+F is your Friend
Code:
# The View Style Front or Side for now (for movement)
@view_style = 'side'
Code:
# Command Pose Direction (Character sets)
@command_direction = 'left'
# Victory Pose Direction (Character sets)
@victory_direction = 'left'
# Other Poses Direction (Character sets)
@other_direction = {'Game_Actor' => 'left', 'Game_Enemy' => 'right'}
Code:
#============================================================================
# Free Fight Formation
#----------------------------------------------------------------------------
# Description:
# Default Formation. The Same as the position setup if formations are disabled
#----------------------------------------------------------------------------
# Appearance:
#
# For One Actor Party
#
#
#
# 1
#
#
#
# For Two Actor Party
#
#
# 1
#
# 2
#
#
# 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 << "576"
Screen_Y << "(4 - $game_party.actors.size) * 60 + index * 120 + 120"
Effects << {}
Description << "The Default Formation"
#============================================================================
# Diamond Dust Formation
#----------------------------------------------------------------------------
# Description:
# A Formation shaped like a diamond requires a four actor party
# All Actors Defense is increased by 1.5x when in this formation
#----------------------------------------------------------------------------
# Appearance:
#
# 2
#
# 1 4
#
# 3
#
#============================================================================
Names << "Diamond Dust"
Number_Members << '4'
Front_Row << [0]
Middle_Row << [1,2]
Back_Row << [3]
Screen_X << {0 => 448, 1 => 512, 2 => 512, 3 => 576}
Screen_Y << {0 => 320, 1 => 240, 2 => 400, 3 => 320}
Effects << {'all' => 'pdef:*2'}
Description << "All Members Physical Defense is 200% when in this formation"
#============================================================================
# Power Triangle Formation
#----------------------------------------------------------------------------
# Description:
# A Formation shaped like a triangle requires a three or four actor party
#----------------------------------------------------------------------------
# Appearance:
#
# 2
#
# 1 4
#
# 3
#
#============================================================================
Names << "Power Triangle"
Number_Members << '3-4'
Front_Row << [0]
Middle_Row << []
Back_Row << [1,3,2]
Screen_X << {0 => 512, 1 => 576, 2 => 576, 3 => 576}
Screen_Y << {0 => 320, 1 => 160, 2 => 480, 3 => 320}
Effects << {0 => 'atk:*3'}
Description << "Front Rows Attack is Greatly increased"
#============================================================================
# Magic Square Formation
#----------------------------------------------------------------------------
# Description:
# A Formation shaped like a square requires a four actor party
#----------------------------------------------------------------------------
# Appearance:
#
#
# 1 3
#
# 2 4
#
#
#============================================================================
Names << "Magic Square"
Number_Members << '4'
Front_Row << [0,1]
Middle_Row << []
Back_Row << [2,3]
Screen_X << {0 => 512, 1 => 512, 2 => 576, 3 => 576}
Screen_Y << {0 => 280, 1 => 360, 2 => 280, 3 => 360}
Effects << {'all' => 'int:+50'}
Description << "All Members Intellience is increased"
Compatibility
Incompatible with RTAB, but you already knew that (would defeat the purpose if it was, since I'm creating my own)
I wouldn't try this with any of my other scripts just yet as this system is still in beta form
Addons
Here are the addons for this script
- Required Addons (Included)
- Battle Options (Master Options List) V1.0
- Trickster's Animated Battlers V1.0
- Pose System V1.0 BETA
- Battle Formation System V1.0
Optional Addons
Trickster Plug And Play Gradient Bars V1.5
FAQ Note:Permission granted by Trickster to post:
Quote:And if you post what you have now of my stuff then you don't have the latest versions. I'm too lazy/busy to post stuff.
As this is his material, it is deletable upon his request. Due to his current absense, no support is available. Please do not PM or eMail him for support.
Credits and Thanks
Raziel, Zuzzu, Chaosg1, and others for betatesting
RPG for his animated sprites class (which I modified alot)
People @ rmxpu.net for being my "guinea pigs"
J-Street for saying that I can't explain anything to "normal" people :P
kayin33 for requesting the base script for the Animated Battlers (changing the Battler Graphic to the Character set graphic)
Rmdude333 for requesting a front view battle system
MaxXx for requesting no Battlebacks (included as an option)
Romancing Saga 3 for the formation scene style (almost a complete copy), and parts of the battle scene_style (the default options)
Terms and Conditions
Hey, I posted this publicly. You can use it. What do you expect? But if you do use it, I do expect you to spell my name correctly in your game. And yes you can use it in commercial games too.