RPG Maker Forums


DoubleX RMVXA Bug Fixes v1.05b to YSA Battle System: Classical ATB


by DoubleX




Note


v1.03a+ disables party escape while at least 1 battler is executing actions


Compatibility Fix


http://www.rpgmakervxace.net/topic/21113-doublex-rmvxa-compatibility-fixes-to-ysa-battle-system-classical-atb/?p=145964


Prerequisites


YSA Battle System: Classical ATB(Created by Yami)


Introduction


Tries to fix bugs I've found in YSA Battle System: Classical ATB
Fixing compatibility issues isn't this script's aim

 



Advices


- Fix some issues by following the ordering of YEA scripts:


  Check http://yanflychannel.wordpress.com/rmvxa/ and follow the ordering


- Fix bugs when preemptives or susprises occur in the catb battle system:


  Give numbers to PREEMTIVE_ATB_ACTOR, PREEMTIVE_ATB_ENEMY, SURPRISE_ATB_ACTOR and SURPRISE_ATB_ENEMY


- Fix some compatibility issues with other scripts:


  Put this script below YSA Battle System: Classical ATB, which should be put below Yanfly Engine Ace - Ace Battle Engine


  They should be placed as nearby each other as possible


Bugs tried to fix:


- (v1.05a)Buff/Debuff removal bug
  Buffs and debuffs won't be removed even when their remaining turns reaches 0


- (v1.04a+)Victory defeat bug:


  Windows that are supposed to be closed don't close if they are shown right before victory or defeat


- (v1.03a+)Battler escape bug:
  Various crashes may occur when any battler escapes


- (v1.02a+)Collapse check bug:


  Enemy sprite won't collapse when they die because of slip damage per turn


  Causes:



 



  Consider the following parts of method process_catb and perform_catb_action under class Scene_Battle respectively(YSA Battle System: Classical ATB):




if $game_system.catb_turn_type == :tick @tick_clock = if !@tick_clock @tick_clock += 1 if @tick_clock >= $game_system.catb_tick_count @tick_clock = all_battle_members.each { |battler| battler.on_turn_end } @status_window.refresh $game_troop.increase_turn endend

Code:
if $game_system.catb_turn_type == :action  @tick_action =  if !@tick_action  @tick_action += 1 if !forced || (forced && YSA::CATB::FORCE_ACTION_COUNT)  if @tick_action >= $game_system.catb_after_action    @tick_action =     all_battle_members.each { |battler|      battler.on_turn_end    }    @status_window.refresh    $game_troop.increase_turn  endend

  As the collapse effect due to slip damage KO is checked per turn end and of the whole battle and YSA Battle System: Classical ATB simply get rid of the latter, the collapse check bug occurs as the above 2 parts didn't check the collapse effect when they're the only appropriate parts to do so.







- (v1.01a+)On turn end bug:


  The whole "on turn end thing" of the whole battle simply won't be triggered at all in catb battle system


  Causes:

 



  Consider the following parts of method process_catb and perform_catb_action under class Scene_Battle respectively(YSA Battle System: Classical ATB):




if $game_system.catb_turn_type == :tick @tick_clock = if !@tick_clock @tick_clock += 1 if @tick_clock >= $game_system.catb_tick_count @tick_clock = all_battle_members.each { |battler| battler.on_turn_end } @status_window.refresh $game_troop.increase_turn endend

Code:
if $game_system.catb_turn_type == :action  @tick_action =  if !@tick_action  @tick_action += 1 if !forced || (forced && YSA::CATB::FORCE_ACTION_COUNT)  if @tick_action >= $game_system.catb_after_action    @tick_action =     all_battle_members.each { |battler|      battler.on_turn_end    }    @status_window.refresh    $game_troop.increase_turn  endend

  They're the ways to set how turns work under DEFAULT_TURN = :tick && :action respectively, so "on turn end" of the whole battle should be triggered here. But in fact they just trigger on turn end for all battlers only but not the whole battle also, causing things triggered at "on turn end" of the whole battle won't be triggered at all.







- Autobattle flag and confusion bug:


  Battlers simply won't make actions automatically under the above conditions.


  Causes:

 



  Consider the following part of method process_catb under class Scene_Battle(YSA Battle System: Classical ATB):




BattleManager.action_list.each { |battler| battler.make_actions if battler.enemy? perform_catb_action(battler) if !@subject}


  battler.make_actions causes battlers to make actions automatically. As it triggers only if battlers are enemies and actors aren't, actors won't make actions automatically.


  Consider the attempted fix by Yami to this problem:




BattleManager.action_list:)actor).each { |battler| battler.make_actions if (battler.actor? && !battler.input)}


  battler.input is initially nil, but after battler.make_actions it's not nil anymore, even after the action is executed. Battler.input remains not nil at the second and later times the battler attempts to make actions, causing failure to make actions. This explains why autobattle or confusion actions only take place once.





- Left arrow output bug:


  The left arrow output should be going left in the list of living members, but is in fact the same as that of ESC.


  Causes:

 



  Consider the following part of method process_dir4 under class Window_ActorCommand(Yanfly Engine Ace - Ace Battle Engine):




call_handler:)cancel)


  This causes left arrow(dir4) output to be cancel, being the same as that of ESC.







- Guard command bug:


  Game crashes when the battle system isn't catb and the rightmost living member guards.


  Causes:

 



  Consider method command_guard under class Scene_Battle(YSA Battle System: Classical ATB):




alias catb_command_guard command_guarddef command_guard BattleManager.actor.input.confirm = true catb_command_guard @status_window.draw_item(BattleManager.actor.index)end


  When the battle system isn't catb, right after inputting guard command, the next actor(the right one)will be selected(you can observe this), even if it's the last member who guards. This is triggered by the original method command_guard, which is aliased as catb_command_guard. If it's the last member who guards, the next actor, which is nil, will be selected after calling catb_command_guard, causing BattleManager.actor to be nil. Game crashes when @status_window.draw_item(BattleManager.actor.index) is run with BattleManager.actor being nil.







- Confirm or cancel input bug:


  Game crashes when a member confirm his/her/its action while he/she/it's dead.


  Causes:

 



  Consider the following parts of method on_enemy_ok, on_enemy_cancel, on_actor_ok, on_actor_cancel, on_skill_ok or on_item_ok under class Scene_Battle(YSA Battle System: Classical ATB):




BattleManager.actor.input.confirm

Code:
@status_window.draw_item(BattleManager.actor.index)

  When a party member dies, the respective BattleManager.actor becomes nil. Game crashes when either of the above parts of code is run with BattleManager.actor being nil.







- Command window bug:


  Neither party nor actor command window shows up when they should, causing the game to freeze.


  Causes:

 



  Consider method update_message_open under class Scene_Battle(YSA Battle System: Classical ATB):




alias catb_update_message_open update_message_opendef update_message_open catb_update_message_open if !$game_message.busy? && @status_window.close? && !$game_troop.all_dead? && !$game_party.all_dead? @status_window.open endend


  After displaying text in battle, only the status window is opened, when party window and actor window are also supposed to open while they're active.







- Party member change bug:


  Game crashes due to adding or removing party members.


  Causes:

 



  Removing members -


  Consider the following part of method process_catb under class Scene_Battle(YSA Battle System: Classical ATB):




@f_actor_index = if !@f_actor_index || @f_actor_index < || @f_actor_index + 1 > BattleManager.action_list:)actor).sizef_actor = BattleManager.action_list:)actor)[@f_actor_index]@f_actor_index += 1 if (@f_actor_index + 1) < BattleManager.action_list:)actor).size && f_actor && f_actor.input && f_actor.input.item && f_actor.input.confirmf_actor = BattleManager.action_list:)actor)[@f_actor_index]if f_actor && f_actor.input && !f_actor.input.confirm && (!BattleManager.actor || @status_window.index != BattleManager.actor.index) && !@actor_command_window.active && !@party_command_window.active BattleManager.set_actor(f_actor.index) @status_window.select(BattleManager.actor.index) @actor_command_window.setup(BattleManager.actor) @actor_command_window.showend


  BattleManager.action_list:)actor) is the list of actors that can make or are already making actions at the moment.


  Consider the following part of method clear_catb under class Game_Battler(YSA Battle System: Classical ATB):




BattleManager.delete_catb_action(self)


  delete_catb_action(self) is the only method that deletes elements in BattleManager.action_list:)actor), and clear_catb is the only method that calls delete_catb_action(self). As removing members won't immediately trigger clear_catb, BattleManager.action_list:)actor) still includes the removed members if they can make or are already making actions right before removal. As member's index(f_actor.index) are nil when they've removed,  nil is passed to method set_actor under module BattleManager when the code BattleManager.set_actor(f_actor.index) is run:




class <<selfdef set_actor(actor_index) @actor_index = actor_indexendend


  This sets @actor_index as nil. Game crashes when the following method self.actor under module BattleManager is called by running the code @status_window.select(BattleManager.actor.index):




def self.actor @actor_index >= ? $game_party.members[@actor_index] : nilend


  Adding members -


  Consider the following parts of method input under class Game_Actor(Yanfly Engine Ace - Ace Battle Engine):




if @actions.nil? make_actions @action_input_index = 0end

Code:
@actions[@action_input_index].nil?

  This is where the game crashes when new members are added after the start of the battle, due to @action_input_index being nil as no value is assigned to it. This method sets @action_input_index to 0 only if @actions is nil.


  Consider the following part of method clear_actions under class Game_Actor:




@action_input_index =


  This is one of the only 2 instances(the other one is the above) where a value is assigned to @action_input_index.


  Consider the following part of method initialize under class Game_Battler:




@actions = []


  This defines @actions as an empty array.


  Consider the following part of method make_actions under class Game_Battler:




@actions = Array.new(make_action_times) { Game_Action.new(self) }


  This assigns an array of actions with the size make_action_times to @actions.


  When new members are added after the start of the battle, clear_actions and initialize won't be called so their @actions are nil. When they can act, their @actions are defined as an array of actions with the size make_action_times. input is called after this but now their @actions aren't nil anymore, while clear_actions is still not called yet. No values are assigned to @action_input_index at all in the above process, causing the game to crash when @actions[@action_input_index].nil? is run with @action_input_index being nil.







- Action Times+ bug:


  Action times is always 1 no matter how to user set the Action Times+. This is hardcoded in YSA Battle System: Classical ATB.


  Causes:

 



  Consider the method make_action_times under class Game_Battler(YSA Battle System: Classical ATB):




alias catb_make_action_times make_action_timesdef make_action_times BattleManager.btype?:)catb) ? 1 : catb_make_action_timesend


  make_action_times always returns 1 when the battle system is catb, causing Action Times+ meaningless.







- Enemy action picking bug:


  Enemies pick new actions every frame, even while charging, causing them to have a chance to pick new actions and alters the charge rate before finish charging the original ones.


  Causes:

 



  Consider the following part of method process_catb under class Scene_Battle(YSA Battle System: Classical ATB):




BattleManager.action_list.each { |battler| battler.make_actions if battler.enemy? perform_catb_action(battler) if !@subject}


  battler.make_actions causes enemies to pick actions. As it triggers every frame(even while charging, same below) due to process_catb being triggered every frame, enemies pick actions every frame and alters the charge rate before finish charging the original ones.







- Dying enemy selection bug:


  Game crashes when enemies die while being selected.


  Causes:

 



  Consider the following part of method update under class Window_BattleEnemy(Yanfly Engine Ace - Ace Battle Engine):




enemy.sprite_effect_type = :whiten


  When enemies die, enemy becomes nil. Game crashes when the above code is run(triggered by selecting enemies) with enemy being nil.







Video








You may've noticed a bug at 1:17 of the video, which is Isabelle picking actions before her atb bar is full. This is merely a compatibility issue with Yanfly Engine Ace - Party System Add-On: Command Party.


Features
Plug and play(You don't need to edit anything in this script but you may still do so)

How to use
Open the script editor and put this script into an open slot between the script YSA Battle System: Classical ATB and Main.  Save to take effect.

FAQ
None

Credit and Thanks
DoubleX(Giving me credit is completely optional)
The terms of use are the same as that of YSA Battle System: Classical ATB except that you must also give Yami credit(you should do this anyway) if you give DoubleX or his alias credit
 
Compatibility
Same as that of YSA Battle System: Classical ATB
 
Changelog


v1.05b(GMT 1200 26-2-2015):


- Improved the efficiency of the Party member change bug fix


v1.05a(GMT 0800 21-1-2015):


- Tried to fix buffs/debuffs not removing when reaching 0 remaining turns


v1.04c(GMT 0500 24-11-2014):


- Tried to fix more issues on dying enemy selection bug


v1.04b(GMT 0800 14-11-2014):


- Tried to fix more issues on dying enemy selection bug


v1.04a(GMT 0800 12-11-2014):


- Tried to fix windows not closing upon victory nor defeat bug


v1.03a(GMT 0200 20-8-2014):


- Tried to fix battler escape bug


v1.02d(GMT 1000 30-6-2014):


- Tried to improve the action times+ bug fix


v1.02c(GMT 0500 22-3-2014):


- Tried to fix more bugs caused by the fixes on collapse check bug


v1.02b(GMT 2330 7-3-2014):


- Tried to fix bugs caused by the fixes on collapse check bug


v1.02a(GMT 0600 7-3-2014):


- Tried to fix collapse check bug


v1.01g(GMT 0500 13-2-2014):


- Tried to fix more issues of command window bug


v1.01f(GMT 0000 27-1-2014):


- Tried to fix bugs caused by the fixes on on turn end bug


v1.01e(GMT 1500 26-1-2014):


- Tried to fix bugs caused by the fixes on action times+ bug


v1.01d(GMT 0600 22-1-2014):


- Tried to fix more issues of command window bug


v1.01c(GMT 0300 22-1-2014):


- Tried to fix bugs caused by the fixes on autobattle flag and confusion bug and left arrow output bug


v1.01b(GMT 1200 21-1-2014):


- Tried to fix bugs caused by the fix on on turn end bug


v1.01a (GMT 0000 13-1-2014):


- Tried to fix on turn end bug


v1.00a (GMT 1200 9-1-2014):


- 1st version of this script finished


(DoubleX)YSA CATB Bug Fix v1.05b.txt

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top