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

[Battle✓] Pokemon Emerald send-in AI

11
Posts
3
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:
    247
    Posts
    6
    Years
    • Seen May 2, 2024
    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