• 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 2.5

Amazing resource here! I'd like to ask a question before i give it a try: is there a way to force the AI to prioritize using a certain move on the first turn of a battle? I have an Ice Gym Leader whose lead has Snow Warning and I want that lead to prioritize using Aurora Veil, then U-turning out to provide support to its team.
 
Amazing resource here! I'd like to ask a question before i give it a try: is there a way to force the AI to prioritize using a certain move on the first turn of a battle? I have an Ice Gym Leader whose lead has Snow Warning and I want that lead to prioritize using Aurora Veil, then U-turning out to provide support to its team.
I've already included almost all VGC strategies in the plugin, so it should use Aurora Veil
 
Idk if it is a bug or just not logging real numbers, but math is not mathing here. Seviper uses coil vs Pikachu

┌─ MOVE SCORE: Enrosque (Seviper vs Pikachu) ─┐
Base Score: 100
+ Setup Value: +70
- Personality: -20.0
─────────────────────────────────
= Final Score: 420.0
└───────────────────────────────────┘

Other similar errors, Rampardos Scary Face vs Pikachu

┌─ MOVE SCORE: Cara Susto (Rampardos vs Pikachu) ─┐
Base Score: 100
- Role Synergy: -15
─────────────────────────────────
= Final Score: 105.0
└───────────────────────────────────┘

EDIT: I think this happens in general with status moves, Dragon Dance Tropius and Shell Smash Cloyster also score unusually high numbers and keep spamming them even when stats are already maxed
 
Last edited:
I have a problem with where trainers. When a Pokémon has protect it'll spam that move till it runs out. I don't know how to show a log, but I'll send one when I find out how. Also, is it possible to make it so the first Pokémon is random instead of the first choice?
 
Idk if it is a bug or just not logging real numbers, but math is not mathing here. Seviper uses coil vs Pikachu

┌─ MOVE SCORE: Enrosque (Seviper vs Pikachu) ─┐
Base Score: 100
+ Setup Value: +70
- Personality: -20.0
─────────────────────────────────
= Final Score: 420.0
└───────────────────────────────────┘

Other similar errors, Rampardos Scary Face vs Pikachu

┌─ MOVE SCORE: Cara Susto (Rampardos vs Pikachu) ─┐
Base Score: 100
- Role Synergy: -15
─────────────────────────────────
= Final Score: 105.0
└───────────────────────────────────┘

EDIT: I think this happens in general with status moves, Dragon Dance Tropius and Shell Smash Cloyster also score unusually high numbers and keep spamming them even when stats are already maxed

Yeah did a error in stat stages, thanks for the report
I have a problem with where trainers. When a Pokémon has protect it'll spam that move till it runs out. I don't know how to show a log, but I'll send one when I find out how. Also, is it possible to make it so the first Pokémon is random instead of the first choice?
its a bug, need to tweak on the point/penalty system

i will provide a fix for both
 
2. When it comes to the Terastallization plugin, NPCs seem to ignore the "NoTera = true" line in the trainer PBS.
In /[AAI] Advanced AI System/7_Integration/DBK_Compatibility.rb, I made the following changes to fix this:
1. Added return nil if !terastal_able? on line 100, so it looks like:
Code:
Expand Collapse Copy
def tera_type
      return nil if !terastal_able? # New line of code
      # If @tera_type is explicitly set (e.g., via editWildPokemon), return it
      # This allows wild Pokemon to have their tera_type even if !terastal_able?
      if @tera_type && !@tera_type.nil?
        return @tera_type
      end
      # Otherwise use original logic
      aai_compat_tera_type
    end
2. Added return nil if !@pokemon.terastal_able? to line 232, so it looks like:
Code:
Expand Collapse Copy
def tera_type
      return nil if !@pokemon
      return nil if !@pokemon.terastal_able? # New line of code
      # For trainer Pokemon, directly return the stored tera_type
      if !wild?
        stored_tera = @pokemon.instance_variable_get(:@tera_type)
        return stored_tera if stored_tera
      end
      # For wild Pokemon or if no stored value, use original logic
      return @pokemon.tera_type
    end

Disclaimer: I haven't done much testing and don't know ruby very well.
 
Hi, really like this plugin. Just wanted to report something I noticed. I didn't see anything in the debug that takes the UsePokemonInOrder flag into account. Not sure if that's by design, but thought it was worth mentioning.
 
Hey!
First of all - amazing plugin!
Since I integrated it, the endless flow of complaining about the battle AI stopped - so great work!

I think I found a bug though. If a pokemon has to switch (since it used uturn or batton pass, for example because it is its only move),
alias aai_choose_best_replacement_pokemon choose_best_replacement_pokemon
def choose_best_replacement_pokemon(idxBattler, terrible_moves = false)

will return -1 if there is no better replacement, resulting in the pokemon just staying :D
I fixed it like this (pivot_moves_failsafe is just your PIVOT_MOVES constant array copied), but I think there is a better solution + wanted to let you know so you can have a look and fix it as well ;)

Ruby:
Expand Collapse Copy
if pivot_moves_failsafe.any?(@user.battler.lastMoveUsed) # has to switch
    return aai_choose_best_replacement_pokemon(idxBattler, terrible_moves)
else
    return -1
end

Again, keep up the good work!
 
Hey!
First of all - amazing plugin!
Since I integrated it, the endless flow of complaining about the battle AI stopped - so great work!

I think I found a bug though. If a pokemon has to switch (since it used uturn or batton pass, for example because it is its only move),
alias aai_choose_best_replacement_pokemon choose_best_replacement_pokemon
def choose_best_replacement_pokemon(idxBattler, terrible_moves = false)

will return -1 if there is no better replacement, resulting in the pokemon just staying :D
I fixed it like this (pivot_moves_failsafe is just your PIVOT_MOVES constant array copied), but I think there is a better solution + wanted to let you know so you can have a look and fix it as well ;)

Ruby:
Expand Collapse Copy
if pivot_moves_failsafe.any?(@user.battler.lastMoveUsed) # has to switch
    return aai_choose_best_replacement_pokemon(idxBattler, terrible_moves)
else
    return -1
end

Again, keep up the good work!
I hope you don't mind me asking here. I'm kind of a noob at coding and am struggling where exactly to place this.

I understand that the array being used would be something like:
Ruby:
Expand Collapse Copy
pivot_moves_failsafe = [:UTURN, :VOLTSWITCH, :FLIPTURN, :PARTINGSHOT, :BATONPASS, :SHEDTAIL, :CHILLYRECEPTION, :TELEPORT]
Followed by the code you wrote.

I believe that code should be included in the "Override replacement Pokemon selection to use Advanced AI logic" part of the Core.rb scripts, but I'm struggling to understand how exactly to call it.

I noticed the same bug you did. I was attempting to figure out a way to fix this and was failing miserably. >.<
 
I hope you don't mind me asking here. I'm kind of a noob at coding and am struggling where exactly to place this.

I understand that the array being used would be something like:
Ruby:
Expand Collapse Copy
pivot_moves_failsafe = [:UTURN, :VOLTSWITCH, :FLIPTURN, :PARTINGSHOT, :BATONPASS, :SHEDTAIL, :CHILLYRECEPTION, :TELEPORT]
Followed by the code you wrote.

I believe that code should be included in the "Override replacement Pokemon selection to use Advanced AI logic" part of the Core.rb scripts, but I'm struggling to understand how exactly to call it.

I noticed the same bug you did. I was attempting to figure out a way to fix this and was failing miserably. >.<
I talked to Nononever, he will update the plugin, so just wait for him to release the 2.6 version :)
 
Back
Top