• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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