• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Trainer sending out incorrect second Pokemon

pokemonmasteraaron

The blind Pokémon Master!
  • 322
    Posts
    14
    Years
    Hi!

    I'm using Pokeemerald with Pokemon expansion, Item Expansion and Battle Expansion.

    I edited the grunt that stole Pico the Wingull and switched his team of 1 poochyena to read as follows in the trainer parties header:
    static const struct TrainerMonItemCustomMoves sParty_GruntRusturfTunnel[] = {
    {
    .iv = 150,
    .lvl = 15,
    .species = SPECIES_SNEASEL,
    .heldItem = ITEM_NEVER_MELT_ICE,
    .moves = {MOVE_ICY_WIND, MOVE_FEINT_ATTACK, MOVE_QUICK_ATTACK, MOVE_NONE}

    },
    {
    .iv = 150,
    .lvl = 16,
    .species = SPECIES_SANDILE,
    .heldItem = ITEM_ORAN_BERRY,
    .moves = {MOVE_BITE, MOVE_FIRE_FANG, MOVE_DIG, MOVE_NONE}

    }
    };
    For his entry in trainers.h, I changed the items statement to read .items = {ITEM_SUPER_POTION},
    I edited the ai to read .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY,
    I edited the line setting the party to .party = {.ItemCustomMoves = sParty_GruntRusturfTunnel},


    In case I'm forgetting anything, the rest of his entry reads:
    {
    .partyFlags = 0,
    .trainerClass = TRAINER_CLASS_TEAM_AQUA,
    .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA,
    .trainerPic = TRAINER_PIC_AQUA_GRUNT_M,
    .trainerName = _("GRUNT"),
    .items = {ITEM_SUPER_POTION},
    .doubleBattle = FALSE,
    .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY,
    .partySize = ARRAY_COUNT(sParty_GruntRusturfTunnel),
    .party = {.ItemCustomMoves = sParty_GruntRusturfTunnel},
    },

    Sneasel is sent out perfectly, but his second Pokemon is a level 75 Krabby.

    I'm discouraged by this, because I suspect it has something to do with offsets and horrible things I'm accustomed to screwing with in binary hacking but thought I'd get to by and large ignore in decomp land.

    Anyway, thanks for reading, hoping there's a trivial solution.
     
    Last edited:
    Figured it out! For any other n00bs, you have to edit PartyFlags in trainers.h. It is a bit mask, you can just look at other trainers that do this and copy what they do. Very simple.
     
    Back
    Top