• 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.
Fill PokéDex / View Pokedex via event

v20.1 Fill PokéDex / View Pokedex via event N/A

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
1666712057878.png
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:
Expand Collapse Copy
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:
Expand Collapse Copy
  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
There's no v19 version of this script, I never got around to updating it before v20 came out. It shouldn't be hard to make, though, so I might add it if someone requests it.

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)
Author
TechSkylander1518
Views
3,513
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from TechSkylander1518

Latest updates

  1. v20 Update

    Quick v20 update. Also adds it as an option in the debug menu.
Back
Top