Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problems with counteraatack addon of Atoa Custom Battle System
#4
I have the demo. I inserted the ATB addon (not the CTB addon) above the counter attack script, and then set up 'ALL' my actors to perform a simple general attack if they were themselves attacked. Each one had:
Code:
{'type' => 4 } => {'type' => 0}
in their case. I deleted everything else as I didn't want any counter attack except that one. And I got nothing.

I then swapped the ATB addon with the CTB. Hey, you can't use both at the same time. And with the same luck.... none.

I did some testing, and found the set_counter_condition method that detects who the attacker and defender are, and confirmed that it is passing the data, but the freakin counter attack isn't HAPPENING!!!!

You want a reaction if actor #17 is attacked by an enemy, right? Fine. I wrote an end run around. Paste THIS below the counterattack script. Just remember that the counter attack script needs either the ATB or CTB addon too.

Code:
# COUNTER ATTACK ADDENDUM

#  This system merely uses Atoa's counter attack system for the purposes of
#  turning on a switch which can be used to trigger an event, be it a battle
#  event or map event.

#
  DEFENDING_ACTOR     = 17   # This is your chosen actor (You'll prolly use 17)
  DEFENDING_STATE     = 91  # If the actor has to be status inflicted (else nil)
  
  ENEMY_INDEX         = nil #2   # Know the index of the enemy? If not, set to nil
  AGGRESSIVE_ENEMY_ID = nil #1   # Want to go by an ID Enemy Database ID?
  
  COUNTER_SWITCH_ID   = 15  # This sets what RMXP switch is turned on for your
                            # responce

                            
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias counter_attack_addon_initialize initialize
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :battle_enemy_index       # Index of current enemy in battle
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # The original call
    counter_attack_addon_initialize
    @battle_enemy_index = 0  
  end
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias counter_attack_addon_set_counter_condition set_counter_condition
  #--------------------------------------------------------------------------
  # * Set counter condition
  #     user    : user
  #     damage  : damage
  #     skill   : skill
  #--------------------------------------------------------------------------      
  def set_counter_condition(user, damage, skill = nil)
    if self.actor?
      if self.id == DEFENDING_ACTOR
        if user.is_a?(Game_Enemy)
          flag_0 = false
          flag_0 = self if user.states.include?(DEFENDING_STATE)
          flag_0 = true if DEFENDING_STATE.nil?
          flag_1 = false
          flag_1 = true if user.id == AGGRESSIVE_ENEMY_ID
          flag_1 = true if AGGRESSIVE_ENEMY_ID.nil?
          flag_2 = false
          flag_2 = true if $game_temp.battle_enemy_index == ENEMY_INDEX
          flag_2 = true if ENEMY_INDEX.nil?          
          # If all conditions are met
          if (flag_0 && flag_1 && flag_2)
            $game_switches[COUNTER_SWITCH_ID] = true
            return
          end
        end
      end
    end
    # The original call
    counter_attack_addon_set_counter_condition(user, damage, skill)
  end
end

I set the actor to be tested as actor #17, he requires to be inflicted by state #91, and I 'nil'ed out the enemy data, so any enemy attacking him will turn on an RPGMaker switch. That switch, I defined as switch #15.

These are editable at the top of the script.

You wanted a conditional branch to occur if an actor was attacked? There you go.

Just be sure to reset the switch when needed.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
RE: Problems with counteraatack addon of Atoa Custom Battle System - by DerVVulfman - 07-07-2014, 03:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   ACBS - Atoa Custom Battle System and TP System zlsl 2 3,747 10-20-2021, 05:09 AM
Last Post: zlsl
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 10,333 05-07-2021, 02:05 PM
Last Post: FrQise
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 12,888 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 11,869 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 10,909 08-08-2019, 02:50 PM
Last Post: aeliath
   YAMI Battle symphony + Holder add on (Loop casting anim) Starmage 0 3,908 03-01-2018, 09:03 AM
Last Post: Starmage
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,488 02-14-2018, 04:25 PM
Last Post: Starmage
   Atoa Individual Battle Commands Geminil 3 6,176 08-02-2017, 03:17 AM
Last Post: DerVVulfman
  Expiration States with Atoa acbs: error Noctis 5 8,119 02-18-2017, 01:10 AM
Last Post: DerVVulfman
Shocked  Help needed with Atoa's CBS jreagan406 2 5,111 02-16-2017, 12:36 PM
Last Post: jreagan406



Users browsing this thread: