Jump to content
DoubleX

DoubleX RMVXA Compatibility Fix to YSA Battle System: Classical ATB

Recommended Posts

Note

The below snippet fixes compatibility issues with Moghunter's Schala AT Gauge. It may be later included in that script or mine, however. Also, this snippet is written by bloodyliao so you may have to credit him/her if you use it:

(source: http://www.rpgmakervxace.net/topic/865-ysa-battle-system-classical-atb/page-4?hl=%20active%20%20time%20%20battle reply #66)

 

 

#--------------------------------------------------------------------------

  #--------------------------------------------------------------------------
  # * AT
  #--------------------------------------------------------------------------  
  def actor_at
      return @target.at if $imported[:mog_atb_system]
      return @target.atb if $imported[:ve_active_time_battle]
      return @target.catb_value if $imported["YSA-CATB"]
      return @target.ap if @ccwinter_atb != nil
      return 0
  end
 
  #--------------------------------------------------------------------------
  # * Max AT
  #--------------------------------------------------------------------------  
  def actor_max_at
      return $game_system.at_max if $imported[:mog_atb_system]
      return @target.max_atb if $imported[:ve_active_time_battle]
      return 100.0 if $imported["YSA-CATB"]
      return ATB::MAX_AP if @ccwinter_atb != nil
      return 1
  end
 
  #--------------------------------------------------------------------------
  # â— Actor Cast
  #--------------------------------------------------------------------------            
  def actor_cast
      return @target.at_cast[1] rescue nil if $imported[:mog_atb_system]
      return -@target.atb if $imported[:ve_active_time_battle]
      return -@target.ct_catb_value if $imported["YSA-CATB"]
      return @target.chant_count rescue 0 if @ccwinter_atb != nil 
      return 0
  end
 
  #--------------------------------------------------------------------------
  # â— Actor Max Cast
  #--------------------------------------------------------------------------            
  def actor_max_cast
      return @target.at_cast[0].speed.abs if $imported[:mog_atb_system]
      return @target.max_atb if $imported[:ve_active_time_battle]
      return 100.0 if $imported["YSA-CATB"]
      return -@target.max_chant_count rescue 1 if @ccwinter_atb != nil 
      return 1
  end
 
  #--------------------------------------------------------------------------
  # â— Actor Max Cast
  #--------------------------------------------------------------------------            
  def gauge_cast
      return @gauge_size if $imported[:mog_atb_system]
      return 0
  end
  
  #--------------------------------------------------------------------------
  # â— Actor Cast?
  #--------------------------------------------------------------------------            
  def actor_cast?
      if $imported[:mog_atb_system]
         return true if !@target.at_cast.empty? rescue false
      end   
      if $imported[:ve_active_time_battle]
         return true if @target.cast_action? rescue false
      end  
      if $imported["YSA-CATB"]
         return true if @target.catb_ct_filled_rate > 0 rescue false
      end 
      if @ccwinter_atb 
         return true if @target.chanting? rescue false
      end
      return false
  end   

end 

Actually the constant 100.0 in method actor_max_at and actor_max_cast has to be equal to MAX_CATB_VALUE(its default value is 100000.0). It seems to me that he/she modified the latter to 100.0 too.

 

 

WARNING: EMBEDDING THE ABOVE SNIPPET INTO THIS COMPATIBILITY FIX YOURSELVES WITHOUT both bloodyliao and Moghunter's PERMITTIONS WILL VIOLATE THIS SCRIPT'S TERMS OF USE

(Embedding here means inserting that snippet as a part of this compatibility fix; Using it as a separate snippet won't violate this compatibility fix's terms of use)

 

Prerequisites

DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB

YSA Battle System: Classical ATB

 

Scripts addressed

Yanfly Engine Ace - Party System Add-On: Command Party

Yanfly Engine Ace - Command Autobattle

(v1.01a+)TH_BattleReactions

(v1.02b+)Actor Personal Hotkeys

(v1.03a+)Yanfly Engine Ace - Instant Cast

(v1.04a+)Yanfly Engine Ace - Skill Restrictions

(v1.05a+)DoubleX RMVXA Enemy MP/TP Bars Addon to Yanfly Engine Ace - Ace Battle Engine

(v1.06a+)Yanfly Engine Ace - Lunatic States

(v1.08a+)Yami Engine Ace - Guardian Summon

(v1.09a+)Yanfly Engine Ace - Target Manager

 

Script name

DoubleX RMVXA Compatibility Fix to YSA Battle System: Classical ATB

 

Author

DoubleX:

- This script

- DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB

Yami:
- YSA Battle System: Classical ATB

 

Terms of use

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

 

Introduction

Tries to fix compatibility issues I've found in YSA Battle System: Classical ATB

 

 

- (v1.09a+)YEA-TargetManager issues

  Skills/items not for opponents only or allies only won't execute

  Causes:

 

 

  Consider the following method on_skill_ok under class Scene_Battle(YEA-BattleEngine)

  def on_skill_ok
    @skill = @skill_window.item
    $game_temp.battle_aid = @skill
    BattleManager.actor.input.set_skill(@skill.id)
    BattleManager.actor.last_skill.object = @skill
    if @skill.for_opponent?
      select_enemy_selection
    elsif @skill.for_friend?
      select_actor_selection
    else
      @skill_window.hide
      next_command
      $game_temp.battle_aid = nil
    end
  end

It means that neither select_enemy_selection nor select_actor_selection will be shown for skills not for opponents only or allies only

As on_enemy_ok and on_actor_ok, which confirms the inputted action(YSA-CATB), won't be called if select_enemy_selection and select_actor_selection aren't called respectively, skills not for opponents only or allies only won't be confirmed, and hence won't execute.

 

 

- (v1.08a+)YSE-GuardianSummon issues

  Summoning doesn't doesn't work with CATB at all

  Causes:

 

 

  Consider the following method on_summon_ok under class Scene_Battle(YSE-GuardianSummon):

  def on_summon_ok
    @summon_window.hide
    BattleManager.actor.input.summon_id = @summon_window.guardian
    @skill_window.hide if $imported["YEA-BattleEngine"]
    next_command
  end

  Every skill/item inputted by players need to have the confirm flag as true, while the above method just doesn't do that, causing summoning to fail entirely.

 

 

- (v1.06a+)YEA-LunaticStates issues:
  close effect never triggers while begin effect triggers whenever an actor makes an action

  Causes:

 

 

  begin effect-

  Consider the following method turn_start under class Scene_Battle(YEA-LunaticStates):

alias scene_battle_turn_start_lsta turn_start
def turn_start
  scene_battle_turn_start_lsta
  for member in all_battle_members; member.run_lunatic_states(:begin); end
end

  And the following method next_command under the same class(Default RMVXA):

def next_command
  if BattleManager.next_command
    start_actor_command_selection
  else
    turn_start
  end
end

  This method's called whenever the fight command in party command window is selected or an actor finished inputting an action.

  They makes begin effect triggers whenever the next_command method is called with BattleManager.next_command returning false.

  Combining with the following method under module BattleManager(YSA-CATB):

def self.next_command
  return false if btype?(:catb)
  catb_next_command
end

  begin effect will always trigger whenever the fight command in party command window is selected or an actor finished inputting an action, as now BattleManager.next_command always return false if the battle system is catb.

 

  close effect-

  As "at the end of a turn" is effectively the same as "at the start of each turn" in YSA-CATB, close effect is essentially the same as begin effect.

 

 

 

 

 

- (v1.05a+)DoubleX RMVXA Enemy MP/TP Bars Addon to YEA-BattleEngine issues:

  ATB bars overlap with hp or mp bars

  Causes:

 

 

  Consider the following method update_position under class Enemy_CATB_Gauge_Viewport(YSA-CATB):

def update_position
  dx = @battler.screen_x - @start_width / 2
  self.rect.x = dx
  dh = self.rect.height + 1
  dh += 2 unless @type == :back
  dy = [@battler.screen_y, Graphics.height - dh - 120].min
  dy += 1 unless @type == :back
  dy -= YEA::BATTLE::ENEMY_GAUGE_HEIGHT if $imported["YEA-EnemyHPBars"]
  self.rect.y = dy
end

  It shows that the atb bars are placed YEA::BATTLE::ENEMY_GAUGE_HEIGHT pixels above the bottom, meaning that the ATB bars are placed above the HP bars. However, consider the same method under class Enemy_HP_Gauge_Viewport, Enemy_MP_Gauge_Viewport and Enemy_TP_Gauge_Viewport respectively(DoubleX RMVXA Enemy MP/TP Bars Addon to YEA-BattleEngine):

alias update_position_mp_tp_addon update_position
def update_position
  update_position_mp_tp_addon
  # This part is added by this script to put hp bars above mp and tp bars
  self.rect.y -= ENEMY_MP_GAUGE_HEIGHT + ENEMY_TP_GAUGE_HEIGHT
  #
end # update_position
def update_position
  dx = @battler.screen_x - @start_width / 2
  dy = @battler.screen_y
  self.rect.x = dx
  self.rect.y = dy
  dh = self.rect.height + 1
  dh += 2 unless @type == :back || @type == :percent
  dy = [@battler.screen_y, Graphics.height - dh - 120].min
  dy += 1 unless @type == :back || @type == :percent
  dy -= ENEMY_TP_GAUGE_HEIGHT
  self.rect.y = dy
end # update_position
def update_position
  dx = @battler.screen_x - @start_width / 2
  dy = @battler.screen_y
  self.rect.x = dx
  self.rect.y = dy
  dh = self.rect.height + 1
  dh += 2 unless @type == :back || @type == :percent
  dy = [@battler.screen_y, Graphics.height - dh - 120].min
  dy += 1 unless @type == :back || @type == :percent
  self.rect.y = dy
end # update_position

It shows that the TP bars are placed at the bottom, MP bars are placed ENEMY_TP_GAUGE_HEIGHT pixels above the bottom and HP bars are placed ENEMY_MP_GAUGE_HEIGHT + ENEMY_TP_GAUGE_HEIGHT above the bottom, meaning that the HP bars are placed above the MP bars, which are placed aboe the TP bars.

All these mean that the ATB bars should be placed ENEMY_HP_GAUGE_HEIGHT +ENEMY_MP_GAUGE_HEIGHT + ENEMY_TP_GAUGE_HEIGHT pixels above the bottom as they should be placed above all the HP, MP and TP bars. This contradicts from the fact that the ATB bars are indeed placed ENEMY_HP_GAUGE_HEIGHT above the bottom, causing them to overlap with hp or mp bars.

 

 

 

 

 

- (v1.04a+)YEA-SkillRestrictions issues:
  Skills with cooldown restrictions won't update their cooldown

  Causes:

 

 

  Consider the following method update_restrictions under class Game_Unit:

def update_restrictions
  for member in members; member.update_cooldowns; end
end

    It's the only method that updates the cooldown of skills for each battler and this method is only called by the following method turn_start under class Scene_Battle:

def turn_start
  $game_party.update_restrictions
  $game_troop.update_restrictions
  scene_battle_turn_start_srs
end

    However, this whole thing's gone in YSA-CATB as it aliased the above method to the following one:

def turn_start
  if BattleManager.btype?(:catb)
    @party_command_window.close
    @actor_command_window.close
    @status_window.unselect
    @log_window.wait
    @log_window.clear
  else
    catb_turn_start
  end
end

    Now the aliased method won't be called when the battle system is :catb, so the skill cooldown for each battler will never update, causing this compatibility issue.

 

 

 

 

 

- (v1.03a+)YEA-InstantCast issues:
  YEA-InstantCast doesn't work as intended and causes issues on status window and actor command window.

  Causes:

 

 

  Consider the following methods next_command and perform_instant_action under Scene_Battle(YEA-InstantCast):

def next_command
  if instant_action?
    perform_instant_action
  else
    scene_battle_next_command_instant
  end
end
def perform_instant_action
  hide_instant_action_windows
  @subject = BattleManager.actor
  @subject.check_instant_action
  execute_action if @subject.current_action.valid?
  process_event
  loop do
    @subject.remove_current_action
    break if $game_troop.all_dead?
    break unless @subject.current_action
    @subject.current_action.prepare
    execute_action if @subject.current_action.valid?
  end
  process_action_end
  @subject.make_actions
  @subject.restore_instant_action
  @subject = nil
  show_instant_action_windows
end

  As it bypasses some features of YSA-CATB like charging of skills and tick action update, YEA-InstantCast won't work as intended. It also causes issues on status window and actor command window due to the following part of method hide_instant_action_windows under Scene_Battle(YEA-InstantCast):

@status_window.show
@actor_command_window.show

 

 

 

 

 

- (v1.02b+)RIFF_HOTKEYS issues:

  Hotkey bar window won't setup in battles under catb battle system.

  Causes:

 

 

  Consider the following part of method start_actor_command_selection under Scene_Battle(RIFF_HOTKEYS):

@hotkeys_bar_window.setup(BattleManager.actor)

  As it's the only instance that setups the hotkey bar window and YSA Battle System: Classical ATB won't use the method start_actor_command_selection when the battle system is catb, the hotkey bar window just won't setup.

 

 

 

 

 

- (v1.01a+)TH_BattleReactions issues:

  Game freezes when skill reactions are triggered in catb battle system.

  Causes:

 

 

  Consider the following part of method perform_reactions under class Scene_Battle(TH_BattleReactions):

while @subject.current_action
  process_action
end

  It works fine if the original method process_action is called. However, YSA Battle System: Classical ATB aliased it as catb_process_action and method process_action becomes the following:

def process_action
  if BattleManager.btype?(:catb)
    process_catb 
    perform_catb_action(@subject, true) if BattleManager.action_forced?
  end
  catb_process_action unless BattleManager.btype?(:catb)
end

  As the original method process_action is called if the battle system isn't catb, the bug only occurs when the battle system is catb. Method perform_catb_action won't be called here as TH_BattleReactions doesn't use force action anymore. It also won't be called by process_catb due to @subject not being nil, as shown in its following part(DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB):

BattleManager.action_list.each { |battler|
  battler.make_actions if (battler.enemy? || battler.input.confirm) && battler.max_catb_value? && battler.ct_catb_value <= 0
  perform_catb_action(battler) if !@subject
}

  As @subject.current_action aren't even touched at all uptil now, @subject.current_action is still not nil when process_action finishes running, causing the while loop running forever and the game freezing.

 

 

 

 

 

- YEA-CommandParty issues:

  As shown in video http://www.youtube.com/watch?v=QNkErCR2PwI

  Causes:

 

 

  Consider the following part of the method command_party under class Scene_Battle(Yanfly Engine Ace - Party System Add-On: Command Party):

if previous_party != $game_party.battle_members
  $game_party.make_actions
  $game_party.set_party_cooldown
end

  This causes members with autobattle flag or confusion to pick actions automatically whenever there're changes in the party member lineup.

 

 

 

 

 

- YEA-CommandAutobattle issues:

  Party and actor autobattle simply don't work with catb battle system.

  Causes:

 

 

  Consider the method command_aautobattle and the following part of the method command_pautobattle under class Scene_Battle respectively(Yanfly Engine Ace - Command Autobattle):

def command_aautobattle
  BattleManager.actor.make_auto_battle_actions
  next_command
end
for member in $game_party.battle_members
  next unless member.inputable?
  member.make_auto_battle_actions
end

  Actions are made but the inputs aren't confirmed after calling either of them, causing actions never actually taking place in autobattle.

 

 

 

 

 

Video

http://www.youtube.com/watch?v=Ym1FfVlcv6A&feature=youtu.be

 

Features

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

 

Instructions

To use this script, open the script editor and put this script into an open slot below DoubleX RMVXA Bug Fix to YSA Battle System: Classical ATB and the addressed scripts but above any DoubleX RMVXA Addon to YSA Battle System: Classical ATB. Save to take effect.

Some Hidden YSA Battle System: Classical ATB Tips and Tricks

 

Compatibility

Same as that of YSA Battle System: Classical ATB except those fixed in This script

 

FAQ

None

 

Changelog

v1.09a(GMT 1400 1-4-2016):

- Fixed not confirming skills/items not for opponents only or allies only

v1.08c(GMT 1400 15-12-2015):

- Fixed setting the wrong actor's item_instant upon action input confirm

v1.08b(GMT 1200 30-6-2015):

- Fixed wait or quarter not waiting when the summon window's active bug

v1.08a(GMT 1400 29-6-2015):

- Tried to fix compatibility issues with Yami Engine Ace - Guardian Summon

v1.07a(GMT 1100 14-4-2015):

- Fixed general enemy atb bar compatibility issues with overlapping windows

- Changed this script's terms of use

v1.06c(GMT 1100 26-2-2014):

- Fixed bugs on the improved fixes with Yanfly Engine Ace - Instant Cast

- Improved the efficiency of fixes with Actor Personal Hotkeys

v1.06b(GMT 1100 25-2-2014):

- Improved the efficiency of fixes with Yanfly Engine Ace - Instant Cast

v1.06a(GMT 0300 6-9-2014):

- Tried to fix compatibility issues with Yanfly Engine Ace - Lunatic States

v1.05a(GMT 0700 29-8-2014):

- Tried to fix compatibility issues with DoubleX RMVXA Enemy MP/TP Bars Addon to Yanfly Engine Ace - Ace Battle Engine

v1.04b(GMT 0200 20-8-2014):

- Included the battlers escape bug fix

v1.04a(GMT 0100 11-8-2014):

- Tried to fix compatibility issues with Yanfly Engine Ace - Skill Restrictions

v1.03b(GMT 1000 30-6-2014):

- Updated the action times+ bug fix

v1.03a(GMT 0100 9-4-2014):

- Tried to fix compatibility issues with Yanfly Engine Ace - Instant Cast

v1.02c(GMT 0400 27-1-2014):

- Tried to fix more compatibility issues with Actor Personal Hotkeys

v1.02b(GMT 1500 26-1-2014):

- Tried to fix compatibility issues with Actor Personal Hotkeys

v1.01b(GMT 0400 23-1-2014):

- Updated the fix to compatibility issues with TH_BattleReactions

v1.01a (GMT 0400 17-1-2014):

- Tried to fix compatibility issues with TH_BattleReactions

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

- 1st version of this script finished

 

(DoubleX)YSA CATB Compatibility Fix v1.09a.txt

Edited by DoubleX

Share this post


Link to post
Share on other sites

Hey good job on the compatibility fix, It'll be a big help for implementing strategies without VE's Automatic battlers (not quite the same, but it'll more than do.)

 

EDIT: Sorry, I spoke too soon. :(

 

Interestingly, Hime released a new version of Battle Reactions that doesn't depend on forced actions.

However, this new version doesn't work even with the most barebones YEA+CATB project with your fixes in the proper order; it just freezes up (no crash) when an enemy tries a reaction. It's the same freezing with or without your compatibility fixes.

 

Using the old version of the script (provided in Tsuki's demo) and instead of crashing right after the reaction, the target does the same reaction attack again and YEA Battle Engine crashes on line 717 with NoMethodError. :S Again, very barebones project with only the prerequisite scripts.

 

The fix is working in the sense that reaction attacks now function the way they are intended, (minus it happening twice and crashing out part)

 

Mime works awesomely though :) I had to put it under most of my scripts as opposed to putting the mime script where you suggested. (Victor's toggle target script). I find that aesthetically it's best to just set the scope of Mime to the user. Merci beaucoup~

Edited by joeyjoejoe

Share this post


Link to post
Share on other sites

For me at least, there's still the same "enemy does reaction twice and crashing" issue with TH_BattleReactions... I made a fresh new project to test it out and have these scripts in this order:

YEA Yanfly Ace Core 1.09

YEA Battle Engine Ace 1.22

YSA Classical ATB

Yami Engine Symphony 1.15

Yami Engine 8D Battlers

Tsukihime Battle Reactions OLD VERSION

DoubleX Compatibility fixes 1.01b

DoubleX Bug fixes 1.01d

 

Do I need anything else besides this to make it work? With the new version of Tsukihime's battle reaction it freezes instead of crashes, just like with 1.01a of this script.

 

Thanks again. 

Edited by joeyjoejoe

Share this post


Link to post
Share on other sites

For me at least, there's still the same "enemy does reaction twice and crashing" issue with TH_BattleReactions... I made a fresh new project to test it out and have these scripts in this order:

 

YEA Yanfly Ace Core 1.09

YEA Battle Engine Ace 1.22

YSA Classical ATB

Yami Engine Symphony 1.15

Yami Engine 8D Battlers

Tsukihime Battle Reactions OLD VERSION

DoubleX Compatibility fixes 1.01b

DoubleX Bug fixes 1.01d

 

Do I need anything else besides this to make it work? With the new version of Tsukihime's battle reaction it freezes instead of crashes, just like with 1.01a of this script.

 

Thanks again. 

I'll investigate but my wild guess right now is that there're compatibility issues with Yami Engine Symphony 1.15 or Yami Engine 8D Battlers as they weren't even considered in my compatibility fixes.

Edited by DoubleX

Share this post


Link to post
Share on other sites

I tried again by taking out Yami Engine Symphony 1.15 along with the 8D Battlers, and it still crashes the exact same way.

 

 The fix is supposed to be used with the old version of Battle Reactions, correct?

 

Anyway, thanks again for all your work in trying to fix compatibility issues :)

Share this post


Link to post
Share on other sites

I tried again by taking out Yami Engine Symphony 1.15 along with the 8D Battlers, and it still crashes the exact same way.

 

 The fix is supposed to be used with the old version of Battle Reactions, correct?

 

Anyway, thanks again for all your work in trying to fix compatibility issues :)

It's supposed to be used with the new version(Jan 22, 2014) of Battle Reactions and it's merely my fault that I didn't point it out earlier :)

Share this post


Link to post
Share on other sites

Oddly enough, everything is playing nice together in my full project (with all the scripts).

 

Thanks for your patience and for everything :)

Share this post


Link to post
Share on other sites

Updates

v1.03a(GMT 0100 9-4-2014):

- Tried to fix compatibility issues with Yanfly Engine Ace - Instant Cast

v1.02c(GMT 0400 27-1-2014):

- Tried to fix more compatibility issues with Actor Personal Hotkeys

v1.02b(GMT 1500 26-1-2014):

- Tried to fix compatibility issues with Actor Personal Hotkeys

Edited by DoubleX

Share this post


Link to post
Share on other sites

Thanks for fixing that problem with the hotkey bar updating
that was getting to be a problem I would have to press left or right to refresh it over and over
now that its fixed battle is buttery as possible

Share this post


Link to post
Share on other sites

Updates

v1.05a(GMT 0700 29-8-2014):

- Tried to fix compatibility issues with DoubleX RMVXA Enemy MP/TP Bars Addon to Yanfly Engine Ace - Ace Battle Engine

v1.04b(GMT 0200 20-8-2014):

- Included the battlers escape bug fix

v1.04a(GMT 0100 11-8-2014):

- Tried to fix compatibility issues with Yanfly Engine Ace - Skill Restrictions

v1.03b(GMT 1000 30-6-2014):

- Updated the action times+ bug fix

Edited by DoubleX

Share this post


Link to post
Share on other sites

Updates

v1.06c(GMT 1100 26-2-2014):

- Fixed bugs on the improved fixes with Yanfly Engine Ace - Instant Cast

- Improved the efficiency of fixes with Actor Personal Hotkeys

v1.06b(GMT 1100 25-2-2014):

- Improved the efficiency of fixes with Yanfly Engine Ace - Instant Cast

Edited by DoubleX

Share this post


Link to post
Share on other sites

Hey, long time no speak DoubleX. Nice to see you're still into scripting :)

 

I've noticed there's some incompatibility between YSA Classical ATB and YEA Target Manager. I came up with the idea of making a skill to hit all enemies and allies, but as soon as you put any target notetags (i.e. "targets: everybody", "targets: all but user, etc.") the ATB bar isn't expended and the skill does nothing. I disabled YSA Classical ATB and of course, it worked as it should.

Share this post


Link to post
Share on other sites

Updates

v1.09a(GMT 1400 1-4-2016):

- Fixed not confirming skills/items not for opponents only or allies only

Edited by DoubleX

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×