• 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!
  • 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] Editing Individual Values (IVs) of Wild Pokémon

  • 9
    Posts
    5
    Years
    • Seen Jun 18, 2020
    I would like to make Pokémon in the game have set Individual Values, as opposed to a random number. Where is the IV code located, and how should I rewrite it?

    In PokeBattle_Pokemon under the def initialize(species,level,player=nil,withMoves=true), line 930:
    Code:
      @iv            = []
        for i in 0...6
          @iv[i]       = rand(32)
        end

    do I replace with something like:

    Code:
      @iv            = []
        for i in 0...6
          case @iv.random(2)
               when 0
            @iv[i]=iv[0,0,0,0,0,0]
               when 1
            @iv=iv[31,31,31,31,31,31]
        end

    Update: Didn't work. Didn't expect it to, but not giving up.

    This seemed to work:

    Code:
        case rand(2)
          when 0; @iv  =  [0,0,0,0,0,0]
          when 1; @iv  =  [31,31,31,31,31,31]
        end

    Now Pokémon will randomly come with full IVs or no IVs. Please tell me if this is the best way, or if there will be issues later on?
     
    Last edited by a moderator:
    Create a new game_switches and code for it, like we have for SHINY_ENCOUNTER (use CTRL SHIFT F to dig the code) and edit it to make the pokémon with all IVs 31, just by using 'pokemon.iv=[31,31,31,31,31,31]'.
     
    Back
    Top