• 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.

[Question] Error when I open my national dex with Galarian scripts

RatRunner48

Main Gardefender
  • 11
    Posts
    4
    Years
    Hi, i got a problem when adding Galarian or custom mons, almost everything runs fine when i add those, but when i try to open the national dex crashes.

    Thats the err log:

    [Pokémon Essentials version 18.1]
    Exception: NoMethodError
    Message: undefined method `[]' for nil:NilClass

    Backtrace:
    PScreen_PokedexMain:328:in `pbGetDexList'
    PScreen_PokedexMain:325:in `each'
    PScreen_PokedexMain:325:in `pbGetDexList'
    PScreen_PokedexMain:345:in `pbRefreshDexList'
    PScreen_PokedexMain:260:in `pbStartScene'
    PScreen_PokedexMain:1186:in `pbStartScreen'
    PScreen_PokedexMenu:121:in `pbStartScreen'
    PScreen_PokedexMenu:118:in `pbFadeOutIn'
    PScreen_PokedexMenu:122:in `pbStartScreen'
    PScreen_PokedexMenu:113:in `loop'

    PD: I am making the custom ones from scratch, and i use the bulbasaur data as a template but i changed most of those data (Name, internal name, typing, removing regional numbers and adding evo routes)

    i dont know what is missing or messed, but hope can be fixed or something
    Thanks.
     
    Last edited by a moderator:
    Hi, i got a problem when adding Galarian or custom mons, almost everything runs fine when i add those, but when i try to open the national dex crashes.

    Thats the err log:

    [Pokémon Essentials version 18.1]
    Exception: NoMethodError
    Message: undefined method `[]' for nil:NilClass

    Backtrace:
    PScreen_PokedexMain:328:in `pbGetDexList'
    PScreen_PokedexMain:325:in `each'
    PScreen_PokedexMain:325:in `pbGetDexList'
    PScreen_PokedexMain:345:in `pbRefreshDexList'
    PScreen_PokedexMain:260:in `pbStartScene'
    PScreen_PokedexMain:1186:in `pbStartScreen'
    PScreen_PokedexMenu:121:in `pbStartScreen'
    PScreen_PokedexMenu:118:in `pbFadeOutIn'
    PScreen_PokedexMenu:122:in `pbStartScreen'
    PScreen_PokedexMenu:113:in `loop'

    PD: I am making the custom ones from scratch, and i use the bulbasaur data as a template but i changed most of those data (Name, internal name, typing, removing regional numbers and adding evo routes)

    i dont know what is missing or messed, but hope can be fixed or something
    Thanks.

    In PScreen_PokedexMain around line 328
    Replace


    Code:
    form = ($Trainer.formlastseen[nationalSpecies][1] || 0)

    with this

    Code:
    if defined?($Trainer.formlastseen[nationalSpecies][1])
       form = ($Trainer.formlastseen[nationalSpecies][1] || 0)
    else
       form = 0
    end
     
    In PScreen_PokedexMain around line 328
    Replace


    Code:
    form = ($Trainer.formlastseen[nationalSpecies][1] || 0)

    with this

    Code:
    if defined?($Trainer.formlastseen[nationalSpecies][1])
       form = ($Trainer.formlastseen[nationalSpecies][1] || 0)
    else
       form = 0
    end

    Hey, no kidding, thank you very much for this, you saved me. The bug consisted that when i started a test battle with a custom one (eg: Cactonieta) run fine, everything normal, but when i opened the dex after, crashed, but not anymore. Thanks for this, even you will appear on the credits as a gift
     
    Hey, no kidding, thank you very much for this, you saved me. The bug consisted that when i started a test battle with a custom one (eg: Cactonieta) run fine, everything normal, but when i opened the dex after, crashed, but not anymore. Thanks for this, even you will appear on the credits as a gift

    Not credit me.
    I found here - (broken link removed)
     
    Back
    Top