Help - Search - Members - Calendar
Full Version: Decimal amounts in my currency? Weird glitch
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
solar5star
I dont know what I did wrong, I've never seen this problem before when making a game using RPG Maker XP. Everything starts out fine, but after about an hour or so into the game, it starts adding decimals onto my gold amount. At first it looks pretty cool, because it's always .25, .50, or .75, so it's kind of like quarters lol. But then it doesn't take long to start adding more, until it looks like "Your current gold is 223.6593479403". Anyone ever had this problem bfore, or know how to fix it? It doesn't appear to affect anything in game, so it's just an aesthetic problem. But one I'd like to take care of regardless.
Jens of Zanicuud
Are you using some script or only RMXP in its default configuration?
In the latter case, this would be really strange.
In the former, just find every istance of this line:

CODE
$game_party.gold.to_s


and replace it with:

CODE
$game_party.gold.to_i.to_s


This will surely work, but is only a temporary medicine.
There should be something more complicated behind that error...

Are you using some difficulty change or enemy levels script?
These could be the root of all evil...

I hope this could help,

Jens
solar5star
QUOTE (Jens of Zanicuud @ Sep 24 2012, 12:37 PM) *
Are you using some script or only RMXP in its default configuration?
In the latter case, this would be really strange.
In the former, just find every istance of this line:

CODE
$game_party.gold.to_s


and replace it with:

CODE
$game_party.gold.to_i.to_s


This will surely work, but is only a temporary medicine.
There should be something more complicated behind that error...

Are you using some difficulty change or enemy levels script?
These could be the root of all evil...

I hope this could help,

Jens


thank you for the quick reply, Jens! I am using a number of extra scripts(Blizz ABS mostly, and a few arbitrary ones like Death Counts, and HUDs), but no enemy leveling or difficulty ones. I'll try your suggestion and see how much that helps.

It's no terrible, game breaking bug, but it still just looks ugly ya know? And I'm afraid once I get too far into the game it will be like hundreds of digits long!
Jens of Zanicuud
Uhm... this is actually difficult to handle.
I feel there's something odd as regards gold amount...

Open your script editor and launch CTRL+MAIUSC+F.
Search for:
CODE
$game_party.gain_gold

and tell me if this line appears in some non-canon script.

If so, can you report here the lines in which you can find that code in the custom scripts?
I'd like to see them in this format:
<script name> - line # - contents of the line

e.g. <JoZ Enemy Level> - line 92 - $game_party.gain_gold(self.gold)

This could be useful to find the real problem.

Jens
diamondandplatinum3
QUOTE
CTRL+MAIUSC+F

LOL laugh.gif


'CTRL+SHIFT+F' is what you were looking for.
MAIUSC is the Italian equivalent wink.gif
Jens of Zanicuud
QUOTE (diamondandplatinum3 @ Sep 25 2012, 11:19 AM) *
QUOTE
CTRL+MAIUSC+F

LOL laugh.gif


'CTRL+SHIFT+F' is what you were looking for.
MAIUSC is the Italian equivalent wink.gif


Urgh! What a stupid mistake!
I apologize for having Italianized SHIFT to MAIUSC.
I didn't really notice...

Jens
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.