- Pokémon Essentials Version
- v20.1 ➖
To see this script in action, check out The Last Nurse Joy!
Simple bit of code to allow you to fill the player's PokéDex without filling the boxes, and to access a PokéDex via an event rather than via the pause menu. v20 version adds a "Fill PokéDex" option in the debug menu, under Player Options. Mostly useful for non-traditional games.
Code
Paste in a new script section above Main.
Ruby:
def fillPokedex
GameData::Species.each do |species_data|
sp = species_data.species
f = species_data.form
# Record each form of each species as seen and owned
if f == 0
if species_data.single_gendered?
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
$player.pokedex.register(sp, g, f, 0, false)
$player.pokedex.register(sp, g, f, 1, false)
else # Both male and female
$player.pokedex.register(sp, 0, f, 0, false)
$player.pokedex.register(sp, 0, f, 1, false)
$player.pokedex.register(sp, 1, f, 0, false)
$player.pokedex.register(sp, 1, f, 1, false)
end
$player.pokedex.set_owned(sp, false)
elsif species_data.real_form_name && !species_data.real_form_name.empty?
g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
$player.pokedex.register(sp, g, f, 0, false)
$player.pokedex.register(sp, g, f, 1, false)
end
end
end
MenuHandlers.add(:debug_menu, :fill_pokedex, {
"name" => _INTL("Fill Pokédex"),
"parent" => :player_menu,
"description" => _INTL("Register all species and forms in the Pokédex."),
"effect" => proc { fillPokedex
}
})
def pokeDex
$player.has_pokedex = true
$player.pokedex.unlock(-1)
pbFadeOutIn {
scene = PokemonPokedex_Scene.new
screen = PokemonPokedexScreen.new(scene)
screen.pbStartScreen
menu.pbRefresh
}
$player.has_pokedex = false
end
Ruby:
def fillPokedex
for i in 1..PBSpecies.maxValue
$Trainer.setSeen(i)
$Trainer.setOwned(i)
$Trainer.formseen[i] = [[],[]]
speciesData = pbLoadSpeciesData
formdata = pbLoadFormToSpecies
formdata[i] = [i] if !formdata[i]
for form in 0...formdata[i].length
next if !formdata[i][form] || formdata[i][form]==0
fSpecies = pbGetFSpeciesFromForm(i,form)
formname = pbGetMessage(MessageTypes::FormNames,fSpecies)
genderRate = speciesData[i][SpeciesGenderRate] || 0
gender = (genderRate==PBGenderRates::AlwaysFemale) ? 1 : 0
if form==0
case genderRate
when PBGenderRates::AlwaysMale,
PBGenderRates::AlwaysFemale,
PBGenderRates::Genderless
$Trainer.formseen[i][gender][form] = true
$Trainer.formlastseen[i] = [gender,form]
else # Both male and female
$Trainer.formseen[i][0][form] = true
$Trainer.formseen[i][1][form] = true
$Trainer.formlastseen[i] = [0,form]
end
elsif formname && formname!=""
$Trainer.formseen[i][gender][form] = true
end
end
end
end
def pokeDex
$Trainer.pokedex=true
$PokemonGlobal.pokedexDex=-1
$PokemonGlobal.pokedexUnlocked.length-1
scene = PokemonPokedex_Scene.new
screen = PokemonPokedexScreen.new(scene)
screen.pbStartScreen
$Trainer.pokedex=false
end
Using the script
Just two calls here.
fillPokedex
fills the dex with entries of all species in the National Dex.pokeDex
opens up the dex in an event. It gives the player access to the dex to open it, and then immediately removes it -if you want to let the player keep access, comment out$player.has_pokedex = false
- Credits
- Credit to TechSkylander1518 and Maruno! (I used the debug code as a base for most of this)