• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

v21.1 Hidden Power Set Function 2026-04-14

This resource pertains to version 21.1 of Pokémon Essentials.
Pokémon Essentials Version
v21.1 ✅
If you add this into a script above main you can set your Pokèmons Hidden Power type.
It was made for a not edited version of Pokémon Essentials with Gen8 mechanics.

Ruby:
Expand Collapse Copy
##############################################################################
# Hiddenpower set function
##############################################################################

def setHiddenPowerTypePerfect(pkmn, desired_type)
  # Liste aller validen Typen (ohne NORMAL/SHADOW/Pseudo)
  types = []
  GameData::Type.each do |t|
    next if t.pseudo_type
    next if [:NORMAL, :SHADOW].include?(t.id)
    types << t.id
  end

  index = types.index(desired_type)
  return if index.nil?

  # Zielwert (0–63)
  value = (index * 63.0 / (types.length - 1)).round

  stats = [:HP, :ATTACK, :DEFENSE, :SPEED, :SPECIAL_ATTACK, :SPECIAL_DEFENSE]

  stats.each_with_index do |stat, i|
    bit = (value >> i) & 1

    # 31 = ungerade, 30 = gerade
    pkmn.iv[stat] = (bit == 1) ? 31 : 30
  end
end

In an event you could use it like this:

Ruby:
Expand Collapse Copy
pkmn_index = pbChoosePokemon(1, 3)

if $game_variables[1] < 0
  pbMessage("No Pokémon selected.")
  return
end

pkmn = $player.party[$game_variables[1]]

# Typ-Auswahl
types = []
GameData::Type.each do |t|
  next if t.pseudo_type
  next if [:NORMAL, :SHADOW].include?(t.id)
  types << t.id
end

commands = types.map { |t| GameData::Type.get(t).name }
pbMessage("\\bWhich type should Hidden Power be?")
cmd = pbShowCommands(nil, commands, -1)

if cmd >= 0
  chosen_type = types[cmd]
  setHiddenPowerTypePerfect(pkmn, chosen_type)
  pbMessage("\\bHidden Power is now #{GameData::Type.get(chosen_type).name}!")
end
Credits
Wes' Sandslash
Author
Wes' Sandslash
Views
148
First release
Last update

Ratings

0.00 star(s) 0 ratings
Back
Top