Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Kingly Kounters
#17
Um... allow me to point out that ... no counter will work?  Now, I will also say that I ran into no error messages with this. But no counter will work at all.  Allow me to set the example text below in Courier New so you can see...

  # Actor Counters
  # ==============
  # Define the actors perfoming counter attacks:  the chance of a counter,
  # the skill ID used (or 0 for melee), and optionally the SP cost.
  #
  #            Chance  Skill  SPCost
  #==========  ======  ======  ======
  ACTOR[2]  = [  0,    0]                # Basil delivers melee 0%

  # Enemy Counters
  # ==============
  # Define the enemies perfoming counter attacks:  the chance of a counter,
  # the skill ID used (or 0 for melee), and optionally the SP cost.
  #
  #            Chance  Skill  SPCost
  #==========  ======  ======  ======
  ENEMY[1]  = [  0,    7,      true]    # Ghosts use Fire 0% (never)



This is your config, spaced out and lined up... and the first value in the array is 'chance of performing'.  In both your cases, you have NONE.

Now... here's the kick.



  def counterattack_phase4_step5
    #
    # Cycle through targets
    for target in @target_battlers
      #
      # Next if no damage
      next if target.damage.nil?
      #
      # Next if paralyzed - 'Can't Move'
      next if target.restriction == 4
      #
      # Skip if no HP loss (healing ignored)
      next unless (target.damage).to_i > 0
      # Skip if attack was a counter
      next if @counterattack == true
      #
      # Define chance
      chance = 0

      # Determine counterattack chance for enemy/actor
      if target.is_a?(Game_Enemy)
        if CounterAttack::ENEMY.has_key?(target.id)
          chance = CounterAttack::ENEMY[target.id][0]
        end
      else
        if CounterAttack::ACTOR.has_key?(target.id)
          chance = CounterAttack::ACTOR[target.id][0]
        end
      end
      #
      # Skip if there is no chance of counter
      next if chance == 0

      # Skip if counterattack failed
      next if chance < rand(100)
      # Push active battler into array
      target.countertargets.push(@active_battler)
      #
    end 
    #
  end


Um... this was the section I fixed prior when you had actors or enemies attempting to attack when not defined.  Now let me explain something.

The first yellow block assumes that the counter has 0 chance of being performed.
The second and third yellow blocks are the 'chance of counter' per your actor or enemy*
And the fourth yellow block says 'If still no chance... just go to the next guy'

So if there is 0 chance of success... you go and check the next guy and never reach the ORANGE block which sets up your actor to even do the counter attack.  And (*) Your actors are, from your own config, never going to have a counter attack as their chance value is set to 0.

Insofar as the method with the error you are receiving....

(06-20-2022, 09:19 PM)DerVVulfman Wrote: for target in @target_battlers
  #
  # Ignore if dead
  next if target.dead?
  # Ignore if no countertargets
  next if target.countertargets == []

This I only just posted to you, but I don't have to go any further with the script than here.

The last line, I replied that if you have no defined counterattacks, you skip the battler.

So if you have 0 chance of a counter, you never have the counter pushed into the countertargets array shown in the orange block.  And this section says if you have no countertargets, skip.

In essence, in no way should you be having this error as you have no way for a counterattack to even be registered.

There has got to be something else in play.  There is nothing in the script itself that would cause your issue.
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
Kingly Kounters - by DerVVulfman - 04-06-2022, 10:07 PM
RE: Kingly Kounters - by kingray100 - 04-12-2022, 05:54 PM
RE: Kingly Kounters - by DerVVulfman - 04-12-2022, 09:52 PM
RE: Kingly Kounters - by kingray100 - 04-15-2022, 07:23 AM
RE: Kingly Kounters - by kingray100 - 06-01-2022, 07:09 PM
RE: Kingly Kounters - by DerVVulfman - 06-02-2022, 01:47 AM
RE: Kingly Kounters - by DerVVulfman - 06-14-2022, 02:51 AM
RE: Kingly Kounters - by kingray100 - 06-02-2022, 06:33 PM
RE: Kingly Kounters - by DerVVulfman - 06-03-2022, 02:12 AM
RE: Kingly Kounters - by kingray100 - 06-19-2022, 07:02 AM
RE: Kingly Kounters - by DerVVulfman - 06-19-2022, 01:26 PM
RE: Kingly Kounters - by kingray100 - 06-19-2022, 11:59 PM
RE: Kingly Kounters - by DerVVulfman - 06-20-2022, 01:17 AM
RE: Kingly Kounters - by kingray100 - 06-20-2022, 08:25 PM
RE: Kingly Kounters - by DerVVulfman - 06-20-2022, 09:19 PM
RE: Kingly Kounters - by kingray100 - 06-20-2022, 11:12 PM
RE: Kingly Kounters - by DerVVulfman - 06-21-2022, 02:11 AM
RE: Kingly Kounters - by DerVVulfman - 06-22-2022, 02:09 AM
RE: Kingly Kounters - by kingray100 - 06-21-2022, 05:22 AM
RE: Kingly Kounters - by DerVVulfman - 06-21-2022, 05:29 AM
RE: Kingly Kounters - by kyonides - 06-21-2022, 06:11 AM
RE: Kingly Kounters - by kingray100 - 06-21-2022, 03:50 PM
RE: Kingly Kounters - by kingray100 - 06-22-2022, 06:57 AM
RE: Kingly Kounters - by DerVVulfman - 06-22-2022, 07:33 PM
RE: Kingly Kounters - by kingray100 - 06-23-2022, 06:54 AM
RE: Kingly Kounters - by kyonides - 06-23-2022, 10:04 AM
RE: Kingly Kounters - by DerVVulfman - 06-23-2022, 03:20 PM
RE: Kingly Kounters - by kingray100 - 06-23-2022, 06:20 PM
RE: Kingly Kounters - by DerVVulfman - 06-23-2022, 08:53 PM
RE: Kingly Kounters - by kingray100 - 06-24-2022, 07:05 AM
RE: Kingly Kounters - by DerVVulfman - 06-25-2022, 02:08 AM



Users browsing this thread: