• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Other Question] How to make Wild Pokémon have their hidden abilites?

  • 2
    Posts
    1
    Years
    • Seen Jun 14, 2023
    I've been trying to figure out how to make Wild Pokémon have a chance of having their Hidden Ability, but I really can't figure it out.

    I've seen people add to the script code but that's from older versions.

    I've also tried downloading this ( (broken link removed) ) But it downloads as a 7Zip files and I can't open it.

    Any help is greatly appreciated.
     
    If you are using Pokemon Essentials 20.1 (as the plugin you shared suggests), you can create a script above main and add this:
    Code:
    EventHandlers.add(:on_wild_pokemon_created, :wild_hidden_ability,
        proc { |pkmn|
          if rand(1..100) <= $game_variables[27]
            pkmn.ability_index = 2
          end
        }
      )
    As a note, I used a variable here to define the random value to compare to so I can change it anytime during the game but you can change it to a number or for Settings::HIDDEN_ABILITY_CHANCE (or any name you want to give it) and define it in the settings plugin. In the case I put, if the value of the variable is greater than 99, all wild pokémon will have their hidden ability.
     
    Last edited:
    As a suggestion, a 5% chance of a wild Pokémon having its hidden ability is a fair probability; but as a coder, you're calling the shots.
     
    If you are using Pokemon Essentials 20.1 (as the plugin you shared suggests), you can create a script above main and add this:
    Code:
    EventHandlers.add(:on_wild_pokemon_created, :wild_hidden_ability,
        proc { |pkmn|
          if rand(1..100) <= $game_variables[27]
            pkmn.ability_index = 2
          end
        }
      )
    As a note, I used a variable here to define the random value to compare to so I can change it anytime during the game but you can change it to a number or for Settings::HIDDEN_ABILITY_CHANCE (or any name you want to give it) and define it in the settings plugin. In the case I put, if the value of the variable is greater than 99, all wild pokémon will have their hidden ability.

    Thank you so much for this! I wasn't able to get the $game_variables bit to work but after changing it for the HIDDEN_ABILITY_CHANCE in the settings method I got it working perfectly! I tried changing it around so it would work for Gift Pokémon like Starters, but I couldn't quite figure that out. I tried switching the word "Wild" to "Gift" but I'm very new to essentials and coding in general.
     
    For gift pokemon you don't really need to do this. You can define the pokemon before and after giving it so you can have in the event a variable that picks a random value between 0 and 100 (or any numbers you prefer), then in a conditional branch check if the value chosen is equal or lower than, for example, 10. If it is, edit the pokemon to have its hidden ability.
     
    Back
    Top