DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A

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
 

Attachments

Last edited by a moderator:

Dr.Yami

。◕‿◕。
Developer
Joined
Mar 5, 2012
Messages
1,003
Reaction score
757
First Language
Vietnamese
Primarily Uses
Other
It's very nice. xD
 

joeyjoejoe

Villager
Member
Joined
Dec 26, 2012
Messages
15
Reaction score
1
First Language
English
Primarily Uses
Props to you DoubleX for the fixes and Yami for writing the original script. =)

I really enjoy Yami's Classical ATB, works quite well so far. I shouldn't be complaining because these scripts are a godsend for what I wanna do, but a few compatibility issues with scripts like Tsukihime's Mime, Victor's Automatic Battlers, and Tsukihime's Battle Reactions (I've been told anything to do with Forced Actions is a no-go) have limited the scope of what the battle system can provide so far.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Props to you DoubleX for the fixes and Yami for writing the original script. =)

I really enjoy Yami's Classical ATB, works quite well so far. I shouldn't be complaining because these scripts are a godsend for what I wanna do, but a few compatibility issues with scripts like Tsukihime's Mime, Victor's Automatic Battlers, and Tsukihime's Battle Reactions (I've been told anything to do with Forced Actions is a no-go) have limited the scope of what the battle system can provide so far.
Tried to fix compatibility issues with Tsukihime's Battle Reactions in the below script:

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

Fixing compatibility issues between YSA CATB and Victor's Automatic Battlers will probably be an incredibly hellish nightmare(maybe even for a team having DoubleX, Yami, Yanfly and Victor Sant) as the former requires YEA Ace Battle Engine while the latter requires VE Basic Module and it seems that VE Basic Module have compatibility issues with YEA Ace Battle Engine.
 
Last edited by a moderator:

joeyjoejoe

Villager
Member
Joined
Dec 26, 2012
Messages
15
Reaction score
1
First Language
English
Primarily Uses
Edit: Sorry, wrong page. ^_^''
 
Last edited by a moderator:

turtlerock

Villager
Member
Joined
Jan 12, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Hi, 

Ever since I updated to ver.1.01d from 1.01b on battle win, EXP is awarded to the party, repeated again, and the game immediately crashes.

The only thing I have above this is Yanfly Battle Engine and Yanfly Ace Engine and ATB, the issue immediately stopped when I took it out.
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Hi, 

Ever since I updated to ver.1.01d from 1.01b on battle win, EXP is awarded to the party, repeated again, and the game immediately crashes.

The only thing I have above this is Yanfly Battle Engine and Yanfly Ace Engine and ATB, the issue immediately stopped when I took it out.
There're no crashes nor repeated EXP awarding on game tests or battle tests battle win in my test in a project with the following custom scripts with the ordering following that in the project:

Yanfly Engine Ace - Ace Core Engine v1.09

Yanfly Engine Ace - Ace Battle Engine v1.22

YSA Battle System: Classical ATB

DoubleX RMVXA Bug Fixes v1.01d to YSA Battle System: Classical ATB

I'm interested if there' any custom script BELOW the v1.01d bug fixes.
 

turtlerock

Villager
Member
Joined
Jan 12, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Was afraid of this...

Going to remove scripts one by one.

I'll edit this post if there is any change after ripping them out.

*

Edit:1 Results:

Nothing. Removed all scripts except for the exact list you have, EXP double crash still happens.

Moving on to more aggressive methods: Will make a new project with only those scripts and try again.

Edited when job done.

Edit 2:

I was able to reproduce the crash in a fresh project with no changes to the database, and only that script list.

Interestingly, the game wont crash when the default was DTB. Once I changed it to CATB to use atb system it started

crashing.
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Was afraid of this...

Going to remove scripts one by one.

I'll edit this post if there is any change after ripping them out.

*

Edit:1 Results:

Nothing. Removed all scripts except for the exact list you have, EXP double crash still happens.

Moving on to more aggressive methods: Will make a new project with only those scripts and try again.

Edited when job done.

Edit 2:

I was able to reproduce the crash in a fresh project with no changes to the database, and only that script list.

Interestingly, the game wont crash when the default was DTB. Once I changed it to CATB to use atb system it started

crashing.
Then I'm afraid you'll have to quote the whole crash log(if any) due to my incompetence:

Script '(script name)' line (line number): (error type) occured.

(Error description)

If there's no crash log at all, I'll probably need a ridiculously long time(thus causing you to wait for a ridiculously long time) just to reproduce the crash, let alone investigating its causes. I hope I could be competent enough to skip this step though :)
 

turtlerock

Villager
Member
Joined
Jan 12, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Nightmare come true, no crash log it crashes straight to the desktop. I'll keep trying to fiddle with things to see if I can help.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A

turtlerock

Villager
Member
Joined
Jan 12, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Hmm that didn't work. Hope you can still figure it out.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Updates

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

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

turtlerock

Villager
Member
Joined
Jan 12, 2014
Messages
11
Reaction score
0
First Language
english
Primarily Uses
Sweet everything working, thanks so much!
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Props to you DoubleX for the fixes and Yami for writing the original script. =)

I really enjoy Yami's Classical ATB, works quite well so far. I shouldn't be complaining because these scripts are a godsend for what I wanna do, but a few compatibility issues with scripts like Tsukihime's Mime, Victor's Automatic Battlers, and Tsukihime's Battle Reactions (I've been told anything to do with Forced Actions is a no-go) have limited the scope of what the battle system can provide so far.
You may try to use DoubleX RMVXA Autobattle Edit to replace Victor's Automatic Battlers if you have decent scripting knowledge:

http://www.rpgmakervxace.net/topic/21760-doublex-rmvxa-autobattle-edit/
 

vanti

Villager
Member
Joined
Jan 20, 2014
Messages
6
Reaction score
0
Primarily Uses
Many thanks for the fixes!

However, there is one more little bug I found with CATB: when a battler is KO'd by any form of slip damage and not by a direct action, the death state is applied "silently" (no collapse effect, enemies stay on screen but are dead, not being able to act and cannot be targeted + Yanfly's Death Common Events does not trigger, same for actors but not as noticeable)... if all enemies die, victory processing is started but it looks funny as the enemies who were killed by slip damage are still standing there

Can this be fixed?

Thanks again!
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Many thanks for the fixes!

However, there is one more little bug I found with CATB: when a battler is KO'd by any form of slip damage and not by a direct action, the death state is applied "silently" (no collapse effect, enemies stay on screen but are dead, not being able to act and cannot be targeted + Yanfly's Death Common Events does not trigger, same for actors but not as noticeable)... if all enemies die, victory processing is started but it looks funny as the enemies who were killed by slip damage are still standing there

Can this be fixed?

Thanks again!
I've tested and it's Yanfly Engine Ace - Ace Battle Engine's bugs. I don't know if Yami's CATB may make things "worse" but I'll try to fix them in Yanfly Engine Ace - Ace Battle Engine if there's no such bugfix scripts uptil now :)
 

vanti

Villager
Member
Joined
Jan 20, 2014
Messages
6
Reaction score
0
Primarily Uses
I've tested and it's Yanfly Engine Ace - Ace Battle Engine's bugs. I don't know if Yami's CATB may make things "worse" but I'll try to fix them in Yanfly Engine Ace - Ace Battle Engine if there's no such bugfix scripts uptil now :)
Thank you for checking it out!

Interesting, this bug did not show up with the default dtb. Did not think it was a bug with YEA - Ace Battle Engine... now I see that apparently it was fixed with version 1.24 but it was reverted back to 1.22
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Thank you for checking it out!

Interesting, this bug did not show up with the default dtb. Did not think it was a bug with YEA - Ace Battle Engine... now I see that apparently it was fixed with version 1.24 but it was reverted back to 1.22
I tried to find its 1.24 version but failed, so I used v1.22 in my test XD
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top