• 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!
  • 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
    6
    Years
    I had been using (broken link removed) 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.

    [PokeCommunity.com] (v17) Problem with Mr. Gela's HGSS Trainer Card

    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:
    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],
     
    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