• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
3
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:

    JulyArt

    New Developer
    70
    Posts
    3
    Years
    • Seen Dec 17, 2021
    show PBS textfile edit section of question, would help us help you
     

    YashPokeFan123

    #PokeFan
    283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    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
     

    RatRunner48

    Main Gardefender
    11
    Posts
    3
    Years
  • 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
     

    YashPokeFan123

    #PokeFan
    283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    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