• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Better AI system

StCooler

Mayst thou thy peace discover.
9,301
Posts
4
Years
    • Seen May 5, 2024
    well... it worked when I remove
    Code:
    skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler) || 0

    Not sure if it has any affect on the script...

    I suggest you write this instead:

    Code:
    skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler) rescue 0
    (This is what the author of the script meant)
     

    DarrylBD99

    Content Creator and Game Developer
    321
    Posts
    4
    Years
  • So um... I can't really say how I got this error...
    I was test battling against a trainer that used a Honedge. I selected a move and I don't know what move the Honedge used cause immediately after I selected my move, it gives me this error.

    2021-04-22 (6).png

    and after the error disappears, my pokemon is able to use the move I assigned to the pokemon and the turn ends. And the turn after, everything is just normal and the opponent can then use moves. The moves I assigned to the Honedge are fury cutter, pursuit, metal sound and swords dance. But reading the error, it is most likely that the error was caused when it used pursuit. [p.s. I know I have EBDX installed, but I have high doubts that this is an EBDX compatibility error]

    Edit: OK... I did a little more testing... and it wasn't because of pursuit... in fact, it only appears if the honedge is faster than my pokemon in battle in the very first turn.
     
    Last edited:
    37
    Posts
    8
    Years
    • Seen Apr 28, 2024
    is it compatible with v19 ? If not, are you planning on making a version for v19?
     
    29
    Posts
    5
    Years
    • Seen Feb 27, 2023
    Can someone help me here?
    I have battle logs activated and I got something like this:

    [AI] Move choices for the opposing Emolga (1): Tail Whip=90, Charge=87
    [AI] The opposing Emolga (1) will use Charge

    Last time I asked, in another thread, for help about terminating the random factor used by the AI to make it choose its move. That makes the highest scored move to be the chosen one. Always.
    It works every single time but, very rarely the above happens instead. Anyone knows why?
    I know it's not directly related to this thread since it's just an AI question rather than something related with "Not Important"'s script, but maybe someone can help?
     
    Last edited:
    13
    Posts
    3
    Years
    • Seen Sep 9, 2023
    Hi there. this script looked interesting but when trying to install it I kept getting this error in any battle I was in.

    [Pokémon Essentials version 18.1]
    Exception: NoMethodError
    Message: undefined method `priority' for [1, 280, 0]:Array

    Backtrace:
    Better AI (Not Important):454:in `pbChooseMoves'
    Better AI (Not Important):452:in `each'
    Better AI (Not Important):452:in `pbChooseMoves'
    Better AI (Not Important):174:in `pbDefaultChooseEnemyCommand'
    Battle_Phase_Command:200:in `pbCommandPhaseLoop'
    Battle_Phase_Command:191:in `loop'
    Battle_Phase_Command:248:in `pbCommandPhaseLoop'
    Battle_Phase_Command:183:in `pbCommandPhase'
    BattleScript_Main:100:in `pbBattleLoop'
    BattleScript_Main:100:in `logonerr'

    I'm not that good at scripting so any help would be appreciated.
     
    8
    Posts
    3
    Years
    • They/Them
    • Seen Jun 13, 2022
    I really want to use this, but how do I install it exactly? Is it meant to be in its own script section, or do I need to put each chunk of the script in its corresponding script section?
     

    Karthick__

    Pokemon Fan Game Developer
    48
    Posts
    4
    Years
  • How to use this script, just paste below main or change the value's in trainer.txt and trainertype.txt ?
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    Hi there. this script looked interesting but when trying to install it I kept getting this error in any battle I was in.

    [Pokémon Essentials version 18.1]
    Exception: NoMethodError
    Message: undefined method `priority' for [1, 280, 0]:Array

    Backtrace:
    Better AI (Not Important):454:in `pbChooseMoves'
    Better AI (Not Important):452:in `each'
    Better AI (Not Important):452:in `pbChooseMoves'
    Better AI (Not Important):174:in `pbDefaultChooseEnemyCommand'
    Battle_Phase_Command:200:in `pbCommandPhaseLoop'
    Battle_Phase_Command:191:in `loop'
    Battle_Phase_Command:248:in `pbCommandPhaseLoop'
    Battle_Phase_Command:183:in `pbCommandPhase'
    BattleScript_Main:100:in `pbBattleLoop'
    BattleScript_Main:100:in `logonerr'

    I'm not that good at scripting so any help would be appreciated.

    I also had the same error, did you manage to fix it?
     
    10
    Posts
    5
    Years
    • Seen Dec 27, 2021
    hi all I was just wondering if the better ai system could become compatible with PE v19.1 in the future cause I'm working on a pokemon fan game in PE v19.1 that could use a better ai system in it but I don't know how to code so I'm just wondering if it can be done also if the creator needs help I might be able to help with it by looking at pokemon showdown and the pokemon competitive circuit
     

    OverusedNameHere

    Head Dev - Pokémon Throne
    23
    Posts
    5
    Years
  • hi all I was just wondering if the better ai system could become compatible with PE v19.1 in the future cause I'm working on a pokemon fan game in PE v19.1 that could use a better ai system in it but I don't know how to code so I'm just wondering if it can be done also if the creator needs help I might be able to help with it by looking at pokemon showdown and the pokemon competitive circuit

    if i may second this
     
    1
    Posts
    3
    Years
    • Seen Aug 9, 2022
    If I may third this. From the looks of it, this seems like a good enough AI fix. Would be nice to have an updated version.
     

    curryofthepast

    Were they a fool, a sage or a lonely friend?
    14
    Posts
    5
    Years
  • Learning enough Ruby to tweak the AI is easy enough I'd call it middle school level. Look at the script on front page. You can copy the function style shown in the script. The conditions that do stuff are mostly ifs ending on an end at the same level of indentation. The score and weight of moves are what's being changed. 40 score is usually enough to get a preferred move to happen in most circumstances, you could go 50 for something that the AI should highly favor given the conditions. The logic of the script is what takes the most thinking and it's something you should fiddle with anyways if your game adds any new moves or types. One common thing I can think of is making the AI consider moves that have a similar effect to Freeze-Dry. You can get good work done by reading the AI script, using it as a base to copy for new functions and reading about loops in Ruby, in a day.

    Besides that, if your work isn't too far done to be unportable, I'd recommend updating to v20.1. Looking through the github many improvements have been made to the AI and it's a somewhat active process. Essentials github version is better for heavy scripting because it lets you do version control and pull updates for your scripts while merging your own work. When I was using it though, it was less compatible with resources from here and relic castle.
     
    Back
    Top