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

[Scripting Question] How do I increase the AI of a Wild Pokemon?

107
Posts
3
Years
    • Seen Apr 27, 2023
    How do I increase the AI of a Wild Pokemon? It would be nice to have smarter savages.
     
    1,682
    Posts
    8
    Years
    • Seen today
    What a coincidence, I actually did this in v17 and v18 a couple of weeks ago.
    the v18 version is very similar to the code the v19 version would have, so I just changed the respective calls to match.
    didn't test it, but the other versions I mentioned were and this is just variable name changes
    You do want to change how I calculate skill though, as it bases it off inverse catch rate, which can range from 0 to 255, while trainer AI levels only check between 1 and 100 (anything higher acts like champion AI).
    You might also want to change how a "wild battler" (wild mon that will use the ai) is defined, as the way I have here is less than 2 badges and the mon is less than level 25
    Spoiler:
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    What a coincidence, I actually did this in v17 and v18 a couple of weeks ago.
    the v18 version is very similar to the code the v19 version would have, so I just changed the respective calls to match.
    didn't test it, but the other versions I mentioned were and this is just variable name changes
    You do want to change how I calculate skill though, as it bases it off inverse catch rate, which can range from 0 to 255, while trainer AI levels only check between 1 and 100 (anything higher acts like champion AI).
    You might also want to change how a "wild battler" (wild mon that will use the ai) is defined, as the way I have here is less than 2 badges and the mon is less than level 25
    Spoiler:

    Thanks Vendily
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    What a coincidence, I actually did this in v17 and v18 a couple of weeks ago.
    the v18 version is very similar to the code the v19 version would have, so I just changed the respective calls to match.
    didn't test it, but the other versions I mentioned were and this is just variable name changes
    You do want to change how I calculate skill though, as it bases it off inverse catch rate, which can range from 0 to 255, while trainer AI levels only check between 1 and 100 (anything higher acts like champion AI).
    You might also want to change how a "wild battler" (wild mon that will use the ai) is defined, as the way I have here is less than 2 badges and the mon is less than level 25
    Spoiler:

    ---------------------------
    PokeFallen v4.0
    ---------------------------
    [Pokémon Essentials version 18.1]

    [EBDX v1.0.15]

    Exception: NoMethodError

    Message: undefined method `badge_count' for #<PokeBattle_Trainer:0x10fe0cf8>



    Backtrace:

    AI_Move:8:in `pbChooseMoves'

    PokeBattle_AI:67: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_ebdx'

    [EBDX] Battle Core:155:in `pbCommandPhase'

    Battle_StartAndEnd:320:in `pbBattleLoop_ebdx'

    Battle_StartAndEnd:320:in `logonerr'

    Battle_StartAndEnd:320:in `pbBattleLoop_ebdx'



    This exception was logged in

    C:\Users\USERNAME\Saved Games\PokeFallen v4_0\errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------

    I replaced your def pbChooseMoves (idxBattler) but this error appears in v18 with EBSDX, how to fix it?
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    What a coincidence, I actually did this in v17 and v18 a couple of weeks ago.
    the v18 version is very similar to the code the v19 version would have, so I just changed the respective calls to match.
    didn't test it, but the other versions I mentioned were and this is just variable name changes
    You do want to change how I calculate skill though, as it bases it off inverse catch rate, which can range from 0 to 255, while trainer AI levels only check between 1 and 100 (anything higher acts like champion AI).
    You might also want to change how a "wild battler" (wild mon that will use the ai) is defined, as the way I have here is less than 2 badges and the mon is less than level 25
    Spoiler:

    Okay, replace the error line with this one:
    wildBattler = (@ battle.wildBattle? && @ battle.opposes? (idxBattler) && @ battle.pbPlayer.numbadges <2 && user.level <25)

    But a new error has come up in which I have not yet succeeded:
    ---------------------------
    PokeFallen v4.0
    ---------------------------
    [Pokémon Essentials version 18.1]

    [EBDX v1.0.15]

    Exception: NoMethodError

    Message: undefined method `species_data' for #<PokeBattle_Pokemon:0x10931b10>



    Backtrace:

    AI_Move: 14: in `pbChooseMoves'

    PokeBattle_AI: 67: 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_ebdx '

    [EBDX] Battle Core:155:in `pbCommandPhase'

    Battle_StartAndEnd: 320: in `pbBattleLoop_ebdx '

    Battle_StartAndEnd: 320: in `logonerr '

    Battle_StartAndEnd: 320: in `pbBattleLoop_ebdx '



    This exception was logged in

    C: \ Users \ USERNAME \ Saved Games \ PokeFallen v4_0 \ errorlog.txt.

    Press Ctrl + C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
     
    1,682
    Posts
    8
    Years
    • Seen today
    Oh man you were on v18 the whole time!
    well, at least you have it working, sorry for assuming.
    edit: sent to early
    Spoiler:
     
    107
    Posts
    3
    Years
    • Seen Apr 27, 2023
    Oh man you were on v18 the whole time!
    well, at least you have it working, sorry for assuming.
    edit: sent to early
    Spoiler:

    you are one of the most caring people in this community, thank you
     
    90
    Posts
    6
    Years
    • Seen Nov 24, 2023
    What a coincidence, I actually did this in v17 and v18 a couple of weeks ago.
    the v18 version is very similar to the code the v19 version would have, so I just changed the respective calls to match.
    didn't test it, but the other versions I mentioned were and this is just variable name changes
    You do want to change how I calculate skill though, as it bases it off inverse catch rate, which can range from 0 to 255, while trainer AI levels only check between 1 and 100 (anything higher acts like champion AI).
    You might also want to change how a "wild battler" (wild mon that will use the ai) is defined, as the way I have here is less than 2 badges and the mon is less than level 25
    Spoiler:

    Can you also post the method of increasing the AI of wild Pokemon for version 17.2?
     
    1,682
    Posts
    8
    Years
    • Seen today
    Can you also post the method of increasing the AI of wild Pokemon for version 17.2?

    Certainly!
    Edit: wrong one!
    Spoiler:
     
    90
    Posts
    6
    Years
    • Seen Nov 24, 2023
    Certainly!
    Edit: wrong one!
    Spoiler:

    Thanks a lot!
     
    Back
    Top