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

[Error] ArgumentError with giving pokedex to player

  • 5
    Posts
    3
    Years
    • she/her
    • Seen May 10, 2022
    Hello, I'm trying to give the player the national dex, and according to the wiki, you're supposed to not put a number after pbUnlockDex. While implementing this, the debug output window told me this function was being depreciated, and I should use $Trainer.pokedex.unlock. However, when I try to use it without a number, the game crashes giving me the error:

    Exception: ArgumentError
    Message: wrong number of arguments (given 0, expected 1)

    Obviously this means I should be including some number but I can't seem to find anywhere which says how this is done using this new function.
     
    Hello, I'm trying to give the player the national dex, and according to the wiki, you're supposed to not put a number after pbUnlockDex. While implementing this, the debug output window told me this function was being depreciated, and I should use $Trainer.pokedex.unlock. However, when I try to use it without a number, the game crashes giving me the error:

    Exception: ArgumentError
    Message: wrong number of arguments (given 0, expected 1)

    Obviously this means I should be including some number but I can't seem to find anywhere which says how this is done using this new function.
     

    Attachments

    • [PokeCommunity.com] ArgumentError with giving pokedex to player
      Screenshot 2022-03-07 183140.png
      7 KB · Views: 10
    okay, I apologize for not thinking of this before but I did a Ctrl + Shift + F search in scripts for "$Trainer.pokedex.unlock" and found a couple entries relating to it. Several mentioned national dex, and lo and behold, here's the way:

    as NoNoNever said,

    Code:
    $Trainer.has_pokedex = true

    and then to unlock the national dex itself,

    Code:
    $Trainer.pokedex.unlock(-1)
     
    Back
    Top