Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
EmilyAnnCoons

Currency Script

Recommended Posts

Okay, so, here's the deal...My game has multiple worlds in it, each from a different video game series. Problem is, each game series also has its own currency, and I can't figure out a way to create a unified currency for all of them. So, what I need is a way to change the name of the currency in the game based on the world. Like, if someone went into the Mario world, the currency would be called "Coins" but in say the Zelda world it would be "Rupees". Is there a way to do this? If not, can someone gives me an idea of how to still make money make sense for all of the worlds?

Share this post


Link to post
Share on other sites

The simplest way to manage the currency name dynamically (if using the default menu) would be to create a global variable, probably in an empty script directly above Main.  For simplicity, something like $currency = 'Rupees' would suffice.  Then change line 25 of Window_Gold from:

 

self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)

 

to

 

self.contents.draw_text(124-cx, 0, cx, 32, $currency, 2).

 

Then, whenever you need to change currency, use the script event command and change $currency to whatever string you would like.  If you are using a custom menu script, then you can actually change $data_system.words.gold, but you would need to change it to the appropriate currency every time you load the game as well, since you can't change database information permanently during play.

 

If you want to have different currency amounts in every world, you have to do a lot more work.  You would need to create a hash with keys and values for your currencies and amounts.  Then you would need to Marshal the hash object specially in Scene_Save, and load it in Scene_Load.  Are you wanting the simple or the complex method?

Share this post


Link to post
Share on other sites

You would have to change more than just that. You will have to change every scene that gives money, takes money, saves money, and shops. You would have to make your own variable class or something to store the different types of currencies.

 

How are you trying to do this, each place has its own type of money so if you get money from world A it wont work in world B or are you just trying to make it so only the currency name changes but you can use all the money you get no matter what world you get the money from?

Share this post


Link to post
Share on other sites

The simple method is fine. I don't need to change the amount, I just need to change the name. I'm also kind of script dumb...so I don't actually know how I'd set that script up.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...