• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Battle✓] Pokemon Emerald send-in AI

  • 11
    Posts
    4
    Years
    • Seen Nov 8, 2022
    Hi everyone,

    I've played emerald kaizo in the past. (Some 50 attempts of a hard core nuzlocke, furthest attempt to Flannery.) One thing that bugged me was which pokemon the AI sends into battle after one is KOed. I won't go into much detail here, but often the AI sends in the pokemon with the weakest type against yours. In my opinion it should be the pokemon with the strongest type. Now that I'm making my own rom hack, I want to change that.

    At first I tried to use binary hacking, but while that's fine for almost anything I want to do, this specific problem seems to be pretty much unsolvable. So I turned to disassemblies. However, I'm unable to find the subroutines I'm looking for. Sure there is something about battle_ai, but that's only about which moves the AI chooses.

    If you can tell me in which file I can find the code I'm seaching for, that would be very helpful. (You don't need to explain how to change the code, I can figure that part out myself.) Even better (though much less likely) would be a solution for binary hacking.
     
    Last edited:
    If you can tell me in which file I can find the code I'm seaching for, that would be very helpful. (You don't need to explain how to change the code, I can figure that part out myself.) Even better (though much less likely) would be a solution for binary hacking.

    Assuming you're working with pokeemerald or pokefirered, src/battle_ai_switch_items.c will have what you're looking for. More specifically, the functions AI_TrySwitchOrUseItem and GetMostSuitableMonToSwitchInto would be of particular interest.
     
    Back
    Top