RPG Maker Times

Smile Game Builder and RPG Maker Tutorials, Plugins, Resources, Windowskins

Fix: Gold Comma Separators Scriptlet

Comparison of Fixnum with String Failure

In reference to the Gold Comma Separators Scriptlet, a bug was found. It was pointed out that in RMVXA, the commas worked fine in the main Gold Window, but opening up a shop and buying items resulted in this:

Window_ShopBuy Error
Window_ShopBuy Error

And, since the previous method worked in RMXP and RMVX, but not in RMVXA, I was quite interested in finding a solution (not being one to shy away from a challenge), since I did overlook this in the first place.

A Fix Was Found

Typically, RMVXA does things a little differently. After a while, I found the solution. The Gold Comma Separators Scriptlet has now been updated with the fix.

Why It Occurred

Window_ShopBuy relies on the $game_party.gold as an integer, not as a string, so it was basically trying to compare a numerical value with a string value. The comparison returned a zero because you can’t compare numbers and strings (unless the strings are converted to integers). Hence, the error message.

A simple oversight with a fatal error. Thanks to Dahcster for finding it!

Rather than forcing a conversion, the draw_currency_value already converts the number into a string, so updating the refresh method in Window_Gold was the next logical step.

Now the next challenge is to "commify" the numbers in the shop’s bought and sold values, which is achievable through the Global Commas Delimiter Scriptlet.

Categories

Archives

Hi-Tex House Pack Vol. 1

For Smile Game Builder

The Hi-Tex House Pack Vol. 1 contains 297 assets: 284 house wall terrains and 13 models. Get your copy for only $5!

Sponsored Ad

Sponsored Ad


Follow me on Twitter

© 2008-2018, Companion Wulf. All Rights Reserved.