Multi-Hit script activates animation mulitple times per hit

The default implementation...
Well, you gotta remove any battle related script from the script editor except the multi-hit one. Playtest it and see if you get any other errors. If you're still getting the same error, we'd need the backtrace to see more or less where it did assign a target as array.
Err, you could also check if there are other battle scripts modifying either @target_battlers or a method placed BEFORE make_skill_action_result is called by any script.
all right after a bit of a test run, i found out that the HP Sacrifice Script
is the messing up with the skill_effect array thingy
but i don't want it to remove that script! its for the physical skills!
😳 Well, where's the link to that script?
Just upload your scripts.rxdata
here is the testing version of my first game
Litten's Adventure (Test Game)

here is the HP Sacrifice Script @kyonides
Well now I know why the backtrace script didn't work. You didn't fully copy it...

You were missing the most important part at the end:
Code:
rescue SyntaxError
  $!.message.sub!($!.message, mod_error($!))
  raise
rescue
  $!.message.sub!($!.message, mod_error($!))
  raise
end
@KK20
i re-check the edited Main Script and i forgot that is there...
whoops! 😅

EDIT: i added the missing lines of code. playtest. and...
1596947399489.png

OH GOSH
Can you give a detailed step-by-step on how to reproduce in your demo? I'm not seeing it. Rather, I'm getting completely different, unrelated errors.
@KK20
i don't know how i can reproduce it, but i think it goes...
- go to menu
- add Popplio to your active party (just in case)
- attack enemies
- and finish the battle by killing the last enemy with Double Kick or "Double" Slap.
any other attacks will end the battle normally.
Litten has Double Kick, and Popplio has "Double Kick"
- and i believe that should occurred the error

here is the batch of scripts for my game
How in the world are you even getting your game to run?? I keep running into other errors.

Immediately starting the game, I get a crash for an incorrect configuration:
Code:
  # Increase of Skills After reaching specific Levels : Level => Increase
  LVLUPMAX = [{ 10 => 1, 20 => 1, 40 => 2 }]
This shouldn't be an array. Remove the square brackets.

Upon opening the party switcher, I'm met with undefined method 'battler_name' for nil. So now I'm going to figure out what is causing that...
just remove the "[]" in the script and you should be fine.
gonna update that...😅
I never added such brackets in my KSkillMax script. I wonder why you added such a thing to that constant, Mario. Anyway, it's a lesson you'll never forget I think. 😀
I never added such brackets in my KSkillMax script. I wonder why you added such a thing to that constant, Mario. Anyway, it's a lesson you'll never forget I think.
i just thought it might fix the "LVLUPMAX still active even when set to false" problem
Then use empty braces {} instead.
Code:
LVLUPMAX = {}
tested it, still didn't work...
Figured out the multi-hit problem. Turns out it was a bug, even with the original script from Tons of Add-ons.

You can replace the corresponding method in the script with this:
Ruby:
  alias update_phase4_step5_multi_hit_later update_phase4_step5
  def update_phase4_step5(battler = nil)
    if battler != nil
      update_phase4_step5_multi_hit_later(battler)
      return
    end
    update_phase4_step5_multi_hit_later
    if @active_battler.current_action.kind == 1
      if BlizzCFG::SKILL_RANDOM.include?(@skill.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.current_action.kind == 2
      if BlizzCFG::ITEM_RANDOM.include?(@item.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.is_a?(Game_Actor)
      if BlizzCFG::WEAPON_RANDOM.include?(@active_battler.weapon_id)
        @active_battler.current_action.decide_random_target_for_actor
      else
        @active_battler.current_action.decide_last_target_for_actor
      end
    elsif @active_battler.is_a?(Game_Enemy)
      if BlizzCFG::ENEMY_RANDOM.include?(@active_battler.id)
        @active_battler.current_action.decide_random_target_for_enemy
      else
        @active_battler.current_action.decide_last_target_for_enemy
      end
    end
    @phase4_step = 2 if @repeat[0] > 1 && @repeat[2] > 0
    @repeat[0] -= 1
  end
Main reason I never saw this error before was because the skill I was testing with was also configured in SKILL_RANDOM. Removing it from there reproduced the issue. The fix I applied makes the active battler target the same enemy as it did at the start of its multi-hit. However, if the enemy dies before all hits are applied, then the attack stops immediately; it does not find a new target to apply the remaining hits to. Let me know if that is okay with you, otherwise I'll have to take a look at it again later.
NOW its working!
thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/multi-hit-script-activates-animation-mulitple-times-per-hit.122428/