• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Scripting Question] Change Rarity of Natures

  • 4
    Posts
    4
    Years
    • Seen Aug 31, 2021
    Hey, does anyone know how to make it so that pokemon natures have different rarities instead of just being randomly selected out of a list? I want to make some of them have say, an only .05% chance of showing up. I'm not using this code for natures themselves, but for something I'm working on that uses essentially an identical code.
     
    To set the probability of getting a Pokemon with a certain nature go to PField_EncounterModifiers
    and add
    Code:
      if rand(10000) > 0 #0.05% chance of something happening. 
        pokemon.setNature(X) #X is equal to the value of your desired nature.
      else
        pokemon.setNature(default value)
      end
    If you don't want the default value to be twice as likely as the other values minus the one that is 0.05% then you will need to do some math instead of setting a default value.

    Since your not using natures directly I hope this can give you the foundation you need to create your own random chances.
     
    Back
    Top