• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.
     
    22
    Posts
    365
    Days
    • Seen May 2, 2024
    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:
    188
    Posts
    9
    Years
    • Seen May 16, 2024
    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.
     
    2
    Posts
    1
    Years
    • Seen Jun 14, 2023
    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.
     
    22
    Posts
    365
    Days
    • Seen May 2, 2024
    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