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

[Scripting Question] (v17) Problem with Mr. Gela's HGSS Trainer Card

NanaelJustice

AbsoluteXandy
64
Posts
5
Years
  • I had been using Mr. Gela's HGSS Trainer Card script just fine in my game, but after I made a new save I started geting an error when I try to see it after getting coins for the game corner.

    7k2YhKj.png

    The script worked perfectly on my old ongoing save, so I think the problem is the way my edits get the coin information but I'm not really sure. This is my edited version of the script:
    Spoiler:

    Anyone knows how to fix it? Thank you for the attention.

    EDIT: I was doing some testing and realised that the game stop crashing if I spend coins until I get my coins under 4 digits, but If I buy enough to overflow the 3 digits I start getting the crash again.
     
    Last edited:
    139
    Posts
    8
    Years
  • The format specifier for "sprintf" is looking for an integer (%d = integer), but the "pbCommaNumber" function I think is giving the number of coins as a string which includes a comma. Since a comma isn't a valid digit, it's throwing a fit.

    You could either change the %d into %s if you want the comma to show up, or you can remove the "pbCommaNumber" function if you don't want the commas.

    So change line 257 to one of these two:
    #keep comma:
    [sprintf("%s",pbCommaNumber($PokemonGlobal.coins)),302+2,208,1,baseColor,shadowColor],
    # no commas:
    [sprintf("%d",$PokemonGlobal.coins),302+2,208,1,baseColor,shadowColor],
     

    NanaelJustice

    AbsoluteXandy
    64
    Posts
    5
    Years
  • The format specifier for "sprintf" is looking for an integer (%d = integer), but the "pbCommaNumber" function I think is giving the number of coins as a string which includes a comma. Since a comma isn't a valid digit, it's throwing a fit.

    You could either change the %d into %s if you want the comma to show up, or you can remove the "pbCommaNumber" function if you don't want the commas.

    So change line 257 to one of these two:
    #keep comma:
    [sprintf("%s",pbCommaNumber($PokemonGlobal.coins)),302+2,208,1,baseColor,shadowColor],
    # no commas:
    [sprintf("%d",$PokemonGlobal.coins),302+2,208,1,baseColor,shadowColor],
    It worked, thank you!
     
    Back
    Top