Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - A VX request for decimals in windows showing gold

Save-Point

Full Version: A VX request for decimals in windows showing gold
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Alright, sounds simple, but apparently isn't. I've been to numerous people for this, and tried it myself, and it's apparently more difficult than it sounds. So, why not just make an open thread, right?

Basically you know the gold windows? Like at shops, showing prices and at battle gains, at the main menu, and the sort? I would love to be able to actually include a decimal point. Instead of 457 gold, it's now 4.57 gold. Sounds simple, but no one has been able to get the whole thing going (and unfortunately I missed the chance to get the parts that worked on some windows).

Anyone wanna help a brotha out? Much love and hugs are in store lol
There isn't a one-way fix for this it seems. You need to find every instance of "$game_party.gold.to_s" or similar. Window_Gold, the battle results screen, and other places.

The gold screen is actually pretty easy. You should be able to follow this sort of setup with other scripts:
Code:
def refresh
self.contents.clear
cash = ($game_party.gold.to_f / 100).to_f
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, cash.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end

...

But as you say, it is indeed not that simple! If you have 100 gold internally, this ought to equate to 1.00 - but it doesn't. It shows up as 1.0. If the stuff behind the decimal is zero, it's going to be one digit. I wonder what the best way to tackle this is.

Turning into a string, splitting the number up, turning it back to an integer, and counting zeros? Seems a little over the top and clunky, but it's all that comes to mind right now.

EDIT: Wait, FFFFFFFF you said VX. That's an XP script there. I am stupid and tired I'm sorry bluhhhhh. ... but the whole to_f deal, along with the issue I pointed out, that still applies.