Multiple currencies?

So... I created 2 additional currencies. They are pretty much just items that are in inventory and have their value. And they are all worth the same:

1G = 1 bill = 1 coin

Don't ask why I did that. I just really need it for the game.

Thing is... I would like them to add up. So that when I have 500G + 200 bills + 300 coins, I am able to buy stuff that costs 1000G in a shop. Is there a way to do that?
the simplest way i can think of doing that is by making all three currencies items, removing the G window from the menu and have a common event add up the three to a single variable, remove all of the player's RM currency and add the value of the variable
when leaving the menu, though, you'll have to remove the amount that has decreased fromt he player's inventory. Considering that all of them are worth the same you'd have to create an arbitrary hierarchy (ie. coins go first, bills go second, G goes last in the removal process)

So basically:

-Common event adds up values of items (G) (bill) (coin) to variable (money)
-removes all of the player's money (but not currency items)
-add money to the player equal to variable (money)
-call shop
-upon exiting shop, add up values of all currency items in a new variable, compare to the one used in the first event. If it's less than the original amount, check if the player has any (coin). They do? Remove (coin) from the inventory equal to the amount of money that has decreased. Check if there's still debt left (say, the player doesnt have enough (coin) so he paid with (bill) too
If that wasnt enough, then go remove (bill) equal to the amount of debt left. if you still need to remove (G) then do so.
IF the amount of money has increased though, simply add either (G), (bill) or (coin) equal to the amount of money that has increased to the player's inventory -- probably you can set this on a shop by shop basis (some shops give u G when you sell to them, some shops give u (bill) etc

well, that's it
kinda cumbersome though, but if you say you need it...
That's a nice idea - you're definitely helping me get on the right track. Can't I just do what you suggest, but while keeping the default currency of the game?

I mean, if the common event just adds up them all and temporarily makes them all G, then why remove the G in the first place?
because that'd mess up the calculation and would look un-uniform, too. IF 2 currencies are items, programming wise it's definitely much cleaner ifyou made all 3 currencies item-based =))
then just remove the currency from the main menu or add an item display (with the 3 currency items) instead, to the player it will feel the same
(why would they want to see G but not bills / coins in the main menu? inconsistent )
(gold + bills + coins) * marketvalue

if they're all worth the same, there's no conversion to be made!
Alright, I'll play around with this. Thanks for the suggestions, guys!
the simplest way i can think of doing that is by making all three currencies items, removing the G window from the menu and have a common event add up the three to a single variable, remove all of the player's RM currency and add the value of the variable

This is, actually, a very interesting idea to ponder. Thanks for your thoughts.
You're welcome!
On my own IGMC game, I did something similar, but with Stats. Characters have Specialty levels, which are abilities like Constitution which grants +75HP per level. These are actually stored as variables, and the game is constantly setting the character's HP to 1, then adding their base max Hp (since the game doesnt use levels) then adding 75 * Constitution (variable) maxHp to the character, and then proceeding to fully heal them (bc players are fully healed after battle)
I did the same for Mp, Attack and Agility : )

There's lots of neat little systems you can do with events!
There's lots of neat little systems you can do with events!
Sounds very interesting. =)
I have not looked into "events" in details yet. Mostly spent my "beginner" time learning how to operate windows. Sill working on it. =D
Thanks for the ideas. Definitely something to keep in mind for range of possibilities.
Okay, I figured out the common events to manage all that. As soon as I implement it and see if it works, I can share what I did.

There's one thing I am missing though - maybe someone can help me. What is the java script command to display the value of a variable? (I need it to display the total money variable value on hud).

Original thread: https://forums.rpgmakerweb.com/threads/multiple-currencies.88429/