Fill PokéDex / View Pokedex via event

Fill PokéDex / View Pokedex via event

Pokémon Essentials Version
v18.1 ➖
For debugging, there's the Fill Boxes command (though it's a bit slower), but if you wanted to fill a player's PokeDex without giving them a buttload of Pokemon, you'd be out of luck! So, here's that! Just paste anywhere above Main and call fillPokedex!

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

Not very useful for a traditional game, but it could be put to good use if you had a more story-based game and you wanted the player to be able to access a dex for lore!

And on that note, here's a little command we used in TLNJ to call the national PokeDex in an event! (It turns the PokeDex off after exiting, though, so keep that in mind!)
Ruby:
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
Credits
Credit to TechSkylander1518 and Maruno! (I used the debug code as a base for most of this)
Author
TechSkylander1518
Views
335
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Top