Problems with counteraatack addon of Atoa Custom Battle System
#9
Okay I managed to solve this problem. This topic can be closed by now.
EDIT: Theres still little problem: The actor does also counterattack when somebody uses a heal skill or a cure skill. Is there a chance to fix that problem? Please do not cloe.

Here is what I've done to make it work. First how to make it work WITHOUT an ctb or atb addon

1. put the counterattack addon above main.
2. go to line 475/ 476 put an # infront of these lines.
They should look like this now:

Code:
#target.counter_info = [target.current_action.kind, target.current_action.basic,#target.current_action.skill_id, target.current_action.item_id, target.action_scope]


3. go to line 387
and replace this line here:


Code:
if battler.cast_action != nil and battler.counter_action_set

with this
Code:
if battler.counter_action != nil and battler.counter_action_set



4. Put this script below your counterattack script:


Code:
class Game_Battler
define_method(:cast_action) { |*a| } unless method_defined?(:cast_action)
define_method(:counter_info=) { |*a| } unless method_defined?(:counter_info=)

def remember_current_action
@remembered_action = [@current_action.clone, self.action_scope]
end

def restore_current_action
@current_action, self.action_scope = *@remembered_action
clear_remembered_action
end

def clear_remembered_action
@remembered_action = nil
end
end


class Scene_Battle

#--------------------------------------------------------------------------
# * Check allow next action
# EDIT: Always allow Counter-Actions
#--------------------------------------------------------------------------
def allow_next_action
return false if cant_if_same
return false if cant_if_damaged_or_invisible
return false if cant_target_invisible
return true if @active_battlers.empty?
# --- EDIT: ---
@action_battlers.each_with_index do |battler, index|
next unless battler.counter_waiting != nil
next unless battler.counter_waiting.wait_counter
next if @active_battlers.include?(battler)
@action_battlers.delete_at(index)
@action_battlers.unshift(battler)
return true
end
# -------------
return false if cant_if_enemy_target and not Allow_Enemy_Target
return false if cant_target_active and not Allow_Active_Target
return false if cant_target_moving? and not Allow_Moving_Target
return true if next_before_return? and Next_Before_Return
return true if allow_same_targets? and Allow_Same_Target
return true if allow_diff_targets? and Allow_Diff_Targets
return false
end

#--------------------------------------------------------------------------
# * Update battler phase 5 (part 1)
# battler : active battler
# EDIT: Do not remove Countering Targets from the queue!
#--------------------------------------------------------------------------
def step5_part1(battler)
step5_part1_counter(battler)
if battler.counter_waiting != nil
battler.counter_waiting.wait_counter = false
battler.counter_waiting = nil
end
for target in $game_party.actors + $game_troop.enemies
if target.counter_action != nil and target.inputable? and not
target.hp0? and not battler.counter_action_set
set_counter_action(battler, target)
target.counter_action_set = true
@action_battlers.unshift(target)
#@action_battlers.uniq!
if target.returning? and target.moving?
target.current_phase = 'Phase 2-1'
target.target_x = target.actual_x
target.target_y = target.actual_y
end
end
target.counter_action = nil
end
end

#--------------------------------------------------------------------------
# * Set counter action
# battler : battler
# target : target
# EDIT: Remember original action to restore it after Execution;
# Force Counter Action to suppress Restriction-Effects.
#--------------------------------------------------------------------------
alias_method(:set_counter_action_ILC_remember_action, :set_counter_action)
def set_counter_action(battler, target)
target.remember_current_action
set_counter_action_ILC_remember_action(battler, target)
target.current_action.forcing = true
end

#--------------------------------------------------------------------------
# * Update battler phase 5 (part 4)
# battler : active battler
# EDIT: Restore remembered Action when terminating a Counter
#--------------------------------------------------------------------------
def step5_part4(battler)
# ---
battler.restore_current_action if battler.counter_action_set
# ---
step5_part4_counter(battler)
battler.counter_action_set = false
battler.valid_counters.clear
end

end



Now it should work fine unless you use ctb or atb addon








5.1 If yo want to use the ctb or atb addon you have to do the same but add little things.
(REMEMBER: YOU HAVE TO DO THE SAME STEPS BEFORE TOO)


5.2 go to line 63 of the little script and replace:
Code:
target.inputable?



with
Code:
target.inputable_by_status?



5.3 Add this little code between the line 4 and 6.


Code:
alias_method(:inputable_by_status?, :inputable?)



Now it should work also if you use one of the ctb or atb addon.


Thank you very much wulfman and admin or moderator please close this topic..
Reply }


Messages In This Thread
RE: Problems with counteraatack addon of Atoa Custom Battle System - by Djigit - 07-10-2014, 04:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   ForeverZer0 Custom Resolution + Littledrago's Zoom Solitaire 20 1,194 10-27-2024, 09:32 PM
Last Post: Solitaire
   GW Animated Battle backs Patch for Atoa ACBS Solitaire 21 1,430 10-17-2024, 06:37 AM
Last Post: Solitaire
   Atoa ACBS, Equipment Set Add-on Error Solitaire 10 821 10-13-2024, 11:41 PM
Last Post: Solitaire
   ACBS - Atoa Custom Battle System and TP System zlsl 2 4,567 10-20-2021, 05:09 AM
Last Post: zlsl
   [RMXP] Showing skill gained by leveling up on battle result FrQise 12 12,647 05-07-2021, 02:05 PM
Last Post: FrQise
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,839 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 13,890 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 12,759 08-08-2019, 02:50 PM
Last Post: aeliath
   YAMI Battle symphony + Holder add on (Loop casting anim) Starmage 0 4,253 03-01-2018, 09:03 AM
Last Post: Starmage
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,910 02-14-2018, 04:25 PM
Last Post: Starmage



Users browsing this thread: 6 Guest(s)