• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

National Dex- Crash?

AmethystRain

pixie-powered judgment!
  • 253
    Posts
    13
    Years
    • Seen Nov 28, 2022
    So seeing the other thread about adding a National Dex, I realised that in my own project I failed to give the player one when I should have. So today I've set off on creating a mid-game patch in which the player receives it.

    Only... After using pbUnlockDex(), the game crashes on trying to load the Pokedex. I also tried (-1) as specified by some other post I found with a quick search. I haven't modified any of the dexscripts, and pokemon.txt has only been updated for Unova Pokemon.

    Here's the error, which, as usual... means nothing to me:
    Exception: TypeError
    Message: cannot convert nil into String
    SpriteWindow:3489:in `text_size'
    SpriteWindow:3489:in `getAutoDims'
    SpriteWindow:3488:in `each'
    SpriteWindow:3488:in `getAutoDims'
    SpriteWindow:3573:in `initialize'
    PokemonPokedex:38:in `new'
    PokemonPokedex:38:in `main'
    PokemonUtilities:892:in `pbLoadRpgxpScene'
    PokemonPauseMenu:163:in `pbStartPokemonMenu'
    PokemonPauseMenu:142:in `loop'

    Any ideas what's going on here?
     
    Are you trying to add a PokéDex which has all the Pokémon instead of the first 151 or second 150 or however many?
     
    Does your DEXNAMES array in the Settings include the National Dex at the end?

    pbUnlockDex works fine on its own to unlock the National Dex (it's the same as using the number -1).
     
    Correct, Nickaloose

    Well, the array includes National Dex, and that's at the end, because that's the only thing in the array. I never wanted there to be any kind of regional dex in the first place, so I cleared out the Kanto/Johto ones.
    ...Would that be it?
    *adds a line for a dex indexed at 0*
    ...No change.
     
    When you said "adding a National Dex", that implied you had Regional Dexes.

    In your case, all you need to do is delete all lines beginning RegionalNumbers= from pokemon.txt, compile the data and start a new game. The number of Dexes in a game are determined and set by the regional numbers at the beginning of a new game.

    I suspect you didn't start a new game, so the game is still expecting there to be several Dexes and then errors when it can't find their names in the DEXNAMES array.
     
    Aha, that simple, then? Slow to apply and slow to reply, but it worked like a charm, even for older save files. Thank you much~
     
    Back
    Top