• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist 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.

[Scripting Question] V18.1 - preset IV/EV number in script and activate by switch

  • 55
    Posts
    8
    Years
    • Seen Nov 24, 2023
    I know that you can fill those in in the PBS, but I want to make it so that if I flip a switch, I can set the IVs and/or EVs of the opposing trainer's Pokemon to the value I want. Same going for Ability and such.

    Is there a way to do so? Would help a lot in boss battles and gyms.
     
    As far as I know, the only way would be to create two different forms of the same trainer: let's call them Bug Cather Fred.
    Bug Catcher Fred,1 will have a Butterfree with a certain set of EV/IV, while Bug Catcher Fred,2 will have a Butterfree with a complete different set.

    Then you create an event where you face either Fred,1 or Fred,2 according to which Switch you activated beforehand.
    It's the most simple method I can think of, but I honestly don't know if there are other ways to achieve this result.
     
    I know that you can fill those in in the PBS, but I want to make it so that if I flip a switch, I can set the IVs and/or EVs of the opposing trainer's Pokemon to the value I want. Same going for Ability and such.

    Is there a way to do so? Would help a lot in boss battles and gyms.

    Like a switch to flip between easy battles and hard battles?
     
    Yeah but with defined EV's and IV's and possibly more.

    What you need to do is set your difficulty as a number in a Game Variable. You'd then note down it's ID as XXX. The value of this variable, in our case would be, 0 - Easy, 1 - Normal and 2- Hard.

    Then look for the line def pbLoadTrainer in PTrainer_NPCTrainers and in that line change the partyid=0 to partyid = -1

    A few lines below that you'll see trainers = pbLoadTrainersData and just above it add that
    Code:
    partyid = $game_variables[XXX] if partyid == -1

    Then in your PBS, define a trainer with version numbers corresponding to your difficulty variables value. In this case its
    0 - Easy, 1 - Normal and 2- Hard. So your Hard Trainer would have defined EVs and IVs and stuff.

    Then whenever you call a pbTrainerBattle in the default condition, it'll always load the proper trainer for the difficulty unless specified otherwise.
     
    That sounds like a good thing, except wouldn't it be easier just to have a switch that you can trigger to set IVs en EVs like with Wild Battles in EncounterModifiers (I set a wild Pokeemon through a switch with 31 IVs on every stat for testing)
     
    Back
    Top