• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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 with randomized team

  • 5
    Posts
    12
    Years
    • Seen Nov 20, 2024
    Hello!
    So, I'm working on my not-yet-announced GBA hack. So far it's going pretty well. However, I am stumped by one feature. At one point in the game, I wanted to implement the fight with the trainer that has a randomized team. Or rather, it's more like this:
    -The trainer can have 12 possible pokemon with custom sets. Of course, a standard limitation of 6 pokemon in battle is in place.
    -Each pokemon has 4 possible sets. So 48 sets total.
    -The trainer can have only one unique pokemon. No duplicates.
    Would be also great to manipulate what pokemon that trainer is more likely to have, but that's luxury stuff.
    The closest thing I could find from the game itself was Battle Tower trainers. So I could use that as a starting point (kinda), but I still don't know how to... well, actually implement it. I think I get the idea, but I don't consider myself the best programmer. Still, I learned so much while making my hack, so this could be another great lesson.
    I assume it's quite advanced stuff, so I don't expect a full tutorial about it. Still, any advice on how to do it would be awesome!
     
    Hello!
    So, I'm working on my not-yet-announced GBA hack. So far it's going pretty well. However, I am stumped by one feature. At one point in the game, I wanted to implement the fight with the trainer that has a randomized team. Or rather, it's more like this:
    -The trainer can have 12 possible pokemon with custom sets. Of course, a standard limitation of 6 pokemon in battle is in place.
    -Each pokemon has 4 possible sets. So 48 sets total.
    -The trainer can have only one unique pokemon. No duplicates.
    Would be also great to manipulate what pokemon that trainer is more likely to have, but that's luxury stuff.
    The closest thing I could find from the game itself was Battle Tower trainers. So I could use that as a starting point (kinda), but I still don't know how to... well, actually implement it. I think I get the idea, but I don't consider myself the best programmer. Still, I learned so much while making my hack, so this could be another great lesson.
    I assume it's quite advanced stuff, so I don't expect a full tutorial about it. Still, any advice on how to do it would be awesome!

    Looking at how the battle tower trainers work could indeed be a good starting point.
    They seem to be created with the DoSpecialTrainerBattle scripting special, which handles several kinds of special trainer battles.
    You could add a new case for your trainer in the function and use the same special.
    Something like:
    Code:
    case SPECIAL_BATTLE_RANDOMIZED_TRAINER:
        gBattleTypeFlags = BATTLE_TYPE_TRAINER;
        FillRandomizedTrainerParty(); //define this
        CreateTask(Task_StartBattleAfterTransition, 1);
        PlayMapChosenOrBattleBGM(0);
        BattleTransition_StartOnField(GetTrainerBattleTransition());
        break;

    You would of course have to create the FillRandomizedTrainerParty function and make it set the trainer's party. You can look at the FillTrainerParty function to see how you can give pokemon to a trainer.
     
    Awesome! That is a fantastic answer. :)
    Thank you very much! Can't wait to start working on it.
     
    Back
    Top