Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Decimal amounts in my currency? Weird glitch
solar5star
post Sep 24 2012, 11:58 AM
Post #1



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




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.
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Sep 24 2012, 12:37 PM
Post #2


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




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


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
solar5star
post Sep 24 2012, 01:48 PM
Post #3



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




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!
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Sep 25 2012, 12:07 AM
Post #4


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




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

This post has been edited by Jens of Zanicuud: Sep 25 2012, 12:10 AM


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   
diamondandplatin...
post Sep 25 2012, 01:19 AM
Post #5


Level 5
Group Icon

Group: Member
Posts: 72
Type: Writer
RM Skill: Skilled
Rev Points: 45




QUOTE
CTRL+MAIUSC+F

LOL laugh.gif


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

This post has been edited by diamondandplatinum3: Sep 25 2012, 01:20 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Jens of Zanicuud
post Sep 25 2012, 05:27 AM
Post #6


Dark Jentleman
Group Icon

Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120




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 post has been edited by Jens of Zanicuud: Sep 25 2012, 05:28 AM


__________________________
"Thorns are the rose's sweetest essence..."
-Jens of Zanicuud


Games I'm working on:
>

official website: TryAdIne eFfeCt

>

Games I worked on (mainly as a scripter):
>
(Warning: it's a 3rr3's project and it's in Italian!)


Awards

Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 07:50 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker