Save-Point
ACBS FIX SCRIPT #1: Victory Cries Patch - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: ACBS FIX SCRIPT #1: Victory Cries Patch (/thread-7521.html)



ACBS FIX SCRIPT #1: Victory Cries Patch - DerVVulfman - 08-08-2019

ACBS FIX SCRIPT #1
Victory Cries Patch
Version: 1.0



Introduction
This fixes a major flaw with the ACBS (Atoa's CBS) by Victor Sant. The bug was caused by an oversight which would crash the system if one wished to have audible cues from actors when they win a battle (or enemies taunting the heroes if they lose).



Script
Code:
#==============================================================================
# ** ACBS FIX SCRIPT #1:  Victory Cries Patch
#------------------------------------------------------------------------------
#     by DerVVulfman (08/07/2019) MM/DD/YYYY
#------------------------------------------------------------------------------
#  The ACBS System has a flaw with audible victory cries.  This fixes a major
#  flaw that can crash the system due to missing array content.
#==============================================================================



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Set Victory battlecry for enemies
  #--------------------------------------------------------------------------
  def set_enemy_victory_battlecry
    @victory_battlercry_enemy = nil
    battle_cry_set = []
    for battler in $game_troop.enemies
      if check_bc_basic(battler, "VICTORY") and not battler.dead?
        battle_cry_set << battler
      end
    end
    unless battle_cry_set.empty? or $game_temp.no_enemy_victory_bc
      @victory_battlercry_enemy = battle_cry_set [rand(battle_cry_set.size)]
    end
    if @last_active_enemy != nil and not @last_active_enemy.dead? and not
       $game_temp.no_enemy_victory_bc and battle_cry_set.include?(@last_active_enemy)
      @victory_battlercry_enemy = @last_active_enemy
    end
  end
  #--------------------------------------------------------------------------
  # * Set allies victory battlecry
  #--------------------------------------------------------------------------
  def set_victory_battlecry
    @victory_battlercry_battler
    battle_cry_set = []
    for battler in $game_party.actors
      if check_bc_basic(battler, "VICTORY") and not battler.dead?
        battle_cry_set << battler
      end
    end
    unless battle_cry_set.empty? or $game_temp.no_actor_victory_bc
      @victory_battlercry_battler = battle_cry_set [rand(battle_cry_set.size)]
    end
    if @last_active_actor != nil and not @last_active_actor.dead? and not
       $game_temp.no_actor_victory_bc and battle_cry_set.include?(@last_active_enemy)
      @victory_battlercry_battler = @last_active_actor
    end
    battle_cry_basic(@victory_battlercry_battler, "VICTORY") if @victory_battlercry_battler != nil
  end
end



Instructions
Paste this directly below the ACBS | Scene_Battle 4 script so it can take effect and replace the broken methods in question.



FAQ
A surprise, this is the first bug I've seen in the system... ever?



Compatibility
Specifically geared for the ACBS.



Credits and Thanks
To aeliath who supplied me with the error message that pointed out the bug.



Terms and Conditions
Free for use with just due credit required.


RE: ACBS FIX SCRIPT #1: Victory Cries Patch - aeliath - 08-08-2019

Again, lemme thank you for all your effort man. I get this is an old system and maybe people don't actually use it, but it's really amazing and important to me.
I hope no one goes through this issue anymore xD
Thank you bro