• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

Resource Advanced AI System 1.5.1

I'm having issues with ReserveLastPokemon, debug shows that it is true for my trainer (gym leader) but it switches to its ace anyways. Also, it keeps switching back and forth between two mons with same score, I'm using the last version of the plugin.
 
Nononever updated Advanced AI System with a new update entry:

Switch Intteligence, Ace Pokemon Rule, Critical Hits

Switch Intelligence
ReserveLastPokemon Support**: Fixed an issue where the AI would switch into its Ace (last Pokemon) prematurely. It now respects the ReserveLastPokemon trainer flag.
Switch Loop Fix**: Implemented stability checks to prevent the AI from endlessly switching between two Pokemon with similar matchups.

Added a new Rule in Setting
RESPECT_RESERVE_LAST_POKEMON = true

You can turn it off with falsee

Move Scoring (Critical Hits)
Always Critical Hits*: Moves...

Read the rest of this update entry...
 
Hiya, Here's a battle log from my first test run using this plugin! I ran into an error spam after a particular progression through a battle which I think might be worth looking into.

Log here:
View: https://pastebin.com/z29BHUMA


some noteworthy points about this battle:
- This battle was between two AI-controlled battlers (player autobattle vs enemy NPC)

- The move "Realm Shatter" does damage to all enemy mons, removes field effects/weather/rooms (like trick room) and sets psychic terrain if it's not set. if it is, it doesn't reapply it.

- after Realm Shatter was used, Psychic terrain was set, and thus priority moves won't work.

- During the turn phase, there was then NoMethodError spam a few times, I can only assume it trying to factor in Psychic terrain and priority moves.

Happy to provide more info or context if desired!
 
Hi, after a lot of testing we found this:

Ruby:
Expand Collapse Copy
Message: 'undefined method priority' for #<Battle::AI::AIMove>
Exactly in that block of code
Ruby:
Expand Collapse Copy
    def self.terrain_bonus(battle, move, user, target)
      return 0 unless battle.field.terrain
      
      bonus = 0
      terrain = battle.field.terrain
      
      case terrain
      when :Electric
        if move.type == :ELECTRIC && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 40 if move.id == :SLEEPPOWDER || move.id == :SPORE  # Can't sleep
        
      when :Grassy
        if move.type == :GRASS && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 20 if move.id == :EARTHQUAKE || move.id == :MAGNITUDE  # x0.5 power
        bonus += 15 if move.id == :GIGADRAIN || move.id == :DRAINPUNCH  # Better healing
        
      when :Psychic
        if move.type == :PSYCHIC && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 40 if move.priority > 0  # Priority blocked
        
      when :Misty
        if move.type == :DRAGON
          bonus -= 30  # x0.5 power
        end
        bonus -= 40 if move.statusMove? && target && target.affectedByTerrain?  # Status blocked
      end
      
      # Ability Synergies
      ability = user.ability_id
      bonus += 20 if ability == :SURGESURFER && terrain == :Electric
      
      bonus
    end
in
Ruby:
Expand Collapse Copy
bonus -= 40 if move.priority > 0  # Priority blocked
 
Hi, after a lot of testing we found this:

Ruby:
Expand Collapse Copy
Message: 'undefined method priority' for #<Battle::AI::AIMove>
Exactly in that block of code
Ruby:
Expand Collapse Copy
    def self.terrain_bonus(battle, move, user, target)
      return 0 unless battle.field.terrain
     
      bonus = 0
      terrain = battle.field.terrain
     
      case terrain
      when :Electric
        if move.type == :ELECTRIC && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 40 if move.id == :SLEEPPOWDER || move.id == :SPORE  # Can't sleep
       
      when :Grassy
        if move.type == :GRASS && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 20 if move.id == :EARTHQUAKE || move.id == :MAGNITUDE  # x0.5 power
        bonus += 15 if move.id == :GIGADRAIN || move.id == :DRAINPUNCH  # Better healing
       
      when :Psychic
        if move.type == :PSYCHIC && user.affectedByTerrain?
          bonus += 25  # x1.3 power
        end
        bonus -= 40 if move.priority > 0  # Priority blocked
       
      when :Misty
        if move.type == :DRAGON
          bonus -= 30  # x0.5 power
        end
        bonus -= 40 if move.statusMove? && target && target.affectedByTerrain?  # Status blocked
      end
     
      # Ability Synergies
      ability = user.ability_id
      bonus += 20 if ability == :SURGESURFER && terrain == :Electric
     
      bonus
    end
in
Ruby:
Expand Collapse Copy
bonus -= 40 if move.priority > 0  # Priority blocked
thanks for the report, i provide a update today
 
Back
Top