Calestian 20 Posted February 8, 2015 (edited) Author: Calestian Name: Multiple Currencies Version: 1.1 Features: User can set more than one different currencies. There is a new Menu tab displaying all currencies. Different shops can use different currencies. Images: Script: Link:Multiple Currencies Edited February 20, 2015 by Calestian 5 Share this post Link to post Share on other sites
Necromedes 103 Posted February 8, 2015 Very nice! I'll have to give this a test run soon. Share this post Link to post Share on other sites
CrowTheAlmighty 27 Posted February 9, 2015 Author: Calestian Name: Multiple Currencies Version: 1.0 Features: User can set more than one different currencies. There is a new Menu tab displaying all currencies. Different shops can use different currencies. Images: Script: Link:Multiple Currencies .... Did you see my Theory and Development post? XD I was asking for this exact script!! Share this post Link to post Share on other sites
Calestian 20 Posted February 9, 2015 @CrowTheAlmighty Heh not really, I just started scripting a a week ago, so thought this might be good practice Share this post Link to post Share on other sites
CrowTheAlmighty 27 Posted February 9, 2015 Well, I still love it. How do I add to the currencies though? Like, ok, adding money is easy but what about others? Share this post Link to post Share on other sites
Calestian 20 Posted February 9, 2015 (edited) The script itself can support up to 11 currencies, anything more than that and the Currency window in your Menu is going to overflow. In the Editable Region, in the module, change the Currency hash to customize currencies. Example: 1 => [362, 0], Generally: currency_index = [icon_index, starting_amount], Note: currency_index can be 0-10. This means your currency #1 will have the icon 361 (You can see the icon IDs in the database F9) and the starting amount of this currency for a new player will be 0. Where you set the events, before the Shop Processing, set a new event (Script, under Advanced): Example: currency(1) Generally: currency(currency_index) This means the Shop you set in that particular event will have the currency #2. To use a different currency, simply change the currency index in the brackets. Currency(2) would be Currency #2. If you want to gain gold, set a script again in the event window with the command. Example: add_currency(100, 2) Generally: add_currency(amount, currency_index) This means that when the event is triggers, you will gain 100 of currency #2. There are instructions at the top of the script as well. Edited February 9, 2015 by Calestian Share this post Link to post Share on other sites
CrowTheAlmighty 27 Posted February 9, 2015 The script itself can support up to 11 currencies, anything more than that and the Currency window in your Menu is going to overflow. In the Editable Region, in the module, change the Currency hash to customize currencies. Example: 1 => [362, 0], Generally: currency_index = [icon_index, starting_amount], Note: currency_index can be 0-10. This means your currency #1 will have the icon 361 (You can see the icon IDs in the database F9) and the starting amount of this currency for a new player will be 0. Where you set the events, before the Shop Processing, set a new event (Script, under Advanced): Example: currency(1) Generally: currency(currency_index) This means the Shop you set in that particular event will have the currency #2. To use a different currency, simply change the currency index in the brackets. Currency(2) would be Currency #2. If you want to gain gold, set a script again in the event window with the command. Example: add_currency(2) Generally: add_currency(amount, currency_index) This means that when the event is triggers, you will gain 100 of currency #2. There are instructions at the top of the script as well. ... Huh... Share this post Link to post Share on other sites
Calestian 20 Posted February 9, 2015 (edited) If you meant how you increase your currencies, the command would be: add_currency(amount, currency_index) Example: Lets say you want to add to currency #2 after a a battle. In the window where you set the events, your events would be something like: - Battle Processing... - add_currency(100, 2) So after the battle you will gain 100 of currency #2 Edited February 10, 2015 by Calestian Share this post Link to post Share on other sites
StuffyKnows 0 Posted February 17, 2015 Hi Calestian, Thanks for the script but I can't seem to get the increase your currencies command to work on a blank project. I get an error: Script Game_Interpreter line 1411. ArgumentError occurred. wrong number of arguments (2 for 1). I'm using the command on a chest for testing. @>Script: add_currency(100, 2) Share this post Link to post Share on other sites
Calestian 20 Posted February 18, 2015 Hello, sorry about that! Fixed! Share this post Link to post Share on other sites
StuffyKnows 0 Posted February 20, 2015 Thanks, that appears to have fixed it , however, I found another bug. When you purchase an item from a different currencies shop, your currency value/amount won't go down. Share this post Link to post Share on other sites
Calestian 20 Posted February 20, 2015 Fixed! http://pastebin.com/bQrVVM0V Share this post Link to post Share on other sites
linkinin 2 Posted April 16, 2015 Hello. How can I reduce the amount of currency? I use only 4, and when reduced, it gives an error. Share this post Link to post Share on other sites
Calestian 20 Posted April 16, 2015 If you are using 4 currencies, their indexes are (0, 1, 2, 3). 3 is the 4th currency. So if you're using gain_currency for the 4th index (5th currency) which doesnt exist, it will throw an error. I will make a better revision of the script in a week or two. Share this post Link to post Share on other sites
linkinin 2 Posted April 16, 2015 If you are using 4 currencies, their indexes are (0, 1, 2, 3). 3 is the 4th currency. So if you're using gain_currency for the 4th index (5th currency) which doesnt exist, it will throw an error. I will make a better revision of the script in a week or two. I remove the currency from 5 to 10, and when I go to the game, it gives an error. That's what's exactly the problem. Share this post Link to post Share on other sites
Calestian 20 Posted April 16, 2015 It's impossible for me to tell you whats wrong without having the script. I need you to post the script after u modified it, and then i can give u a reply tomorrow. Share this post Link to post Share on other sites
linkinin 2 Posted April 16, 2015 (edited) It's impossible for me to tell you whats wrong without having the script. I need you to post the script after u modified it, and then i can give u a reply tomorrow. Script.txt Edited April 16, 2015 by linkinin Share this post Link to post Share on other sites
Lord Vectra 414 Posted May 14, 2015 Can you increase the custom currency by a variable? Share this post Link to post Share on other sites
+ Glasses 606 Posted May 14, 2015 @Vectra, isn't it simply add_currency($game_variables[ID], Currency_ID) Share this post Link to post Share on other sites
Lord Vectra 414 Posted May 14, 2015 @Vectra, isn't it simply add_currency($game_variables[ID], Currency_ID) Thanx Share this post Link to post Share on other sites
Lord Vectra 414 Posted May 17, 2015 It's impossible for me to tell you whats wrong without having the script. I need you to post the script after u modified it, and then i can give u a reply tomorrow. Set the Icon to a blank one(on default Iconset, it's 140) and set the 2nd number to nil. It worked for me. Share this post Link to post Share on other sites
Kargan3033 8 Posted November 27, 2018 (edited) Nice script Calestian but I'd like to know if you can replace the currency icon with a name or letter instead a of picture. Also what about converting one currency to another as well as exchange rates between different currencies as well as shops who use one type of currencies being able to accept other currencies at a fit exchange rate say the shop in question uses only platinum but will accept gold at a rate of 2 gold pieces to one platinum piece. As well as money changers and banks that accept multi currencies at different interest rate for different currencies, say there is a 5% interest rate on the number platinum pieces in an account and an interest rate of 3% on the gold pieces in the account and so on. Edited November 27, 2018 by Kargan3033 1 Share this post Link to post Share on other sites
PhoenixSoul 1,404 Posted November 27, 2018 (edited) 9 hours ago, Kargan3033 said: Nice script Calestian but I'd like to know if you can replace the currency icon with a name or letter instead a of picture. You can simply make the name or letter an icon. As far as making it display text, it would require editing the script. Since the OP has long since vanished, someone else would likely have to do it. I'm no expert at this, so I would defer to another who would be better suited. 9 hours ago, Kargan3033 said: Also what about converting one currency to another as well as exchange rates between different currencies as well as shops who use one type of currencies being able to accept other currencies at a fit exchange rate say the shop in question uses only platinum but will accept gold at a rate of 2 gold pieces to one platinum piece. As well as money changers and banks that accept multi currencies at different interest rate for different currencies, say there is a 5% interest rate on the number platinum pieces in an account and an interest rate of 3% on the gold pieces in the account and so on. You can do this with variables and do the math yourself, really. Complicated? Sure. But really, that's half the fun in gamedev, unless you're the likes of Blizzard/Activision, or an asset flipper. Also, I'll note that with this script, in order to change the number of currencies from eleven to something like four or five, you have to change certain working parts. Under Class Game_Party in this script, there's a bit of code that has the following: Spoiler def initialize @currency = [] @gold = Clstn_Currencies::Currencies[0][1] 11.times { |i| if i == 0 @currency[i] = @gold else @currency[i] = Clstn_Currencies::Currencies[i][1] end } @steps = 0 @last_item = Game_BaseItem.new @menu_actor_id = 0 @target_actor_id = 0 @actors = [] init_all_items end Notice the following line: 11.times { |i| You'll want to change the number in 11.times to the number of currencies you wish to use, as well as removing/commenting out the unused currencies (commenting out is better from experience).So, for just needing five currencies, one would change that line to 5.times, and comment out currencies 5 - 10, because the currencies are 0-based; 0,1,2,3,4 should be what is left, and then boom, only those five currencies will be displayed. I'll also take this time to insert an add-on for this script, which does require a script I wrote myself. Spoiler =begin Add-On: Calestian Currencies - Set Gold and Set Currency Original Script written by Calestian Add-On/Mod written by Amyrakunejo for KB Games Instructions: Place below Calestian's Currencies script, directly below is best. Only usable with KB-Set Gold Modifier script, this script must also be placed below KB-Set Gold Modifier script. Otherwise, Plug and Play, with the following sub-set of instructions: With Calestian's Currency script, in the event's Advanced Script Call tab, you can use the following two calls to do the following: add_currency(amount, Currency_ID) to apply a currency gain add_currency(-amount, Currency_ID) to apply a currency loss With this Add-On script, and KB-Set Gold Modifier, the following script call has also been added: set_currency(amount, Currency_ID) to apply a currency set Alternatively, one can use the following script call to set the currency: $game_party.set_gold(amount, Currency_ID) =end class Game_Party < Game_Unit attr_accessor :currency #------------------------------------------------------------------------- # * Method: set_gold #------------------------------------------------------------------------- def set_gold(amount, currency_index = $game_temp.currency_index) if currency_index != 0 @currency[currency_index] = [[@currency[currency_index] = amount, 0].max, max_gold].min #not invalid by the way else @gold = [[@gold = amount, 0].max, max_gold].min end end class Game_Interpreter #-------------------------------------------------------------------------- # * Method: set_currency #-------------------------------------------------------------------------- def set_currency(amount, currency_index) $game_party.set_gold(amount, currency_index) end end end Then, my own script which goes above both Calestian's script and the add-on I made. Spoiler =begin Set Gold by KB, Amyrakunejo Assisted by r/transprogrammer Discord, Kayzee Instructions: In the events script call, use the following: $game_party.set_gold(#) $game_party.set_gold($game_variables[#]) You'll have your gold set to the amount. By setting the gold directly, there is no need to use gain or loss commands. Useful if you have an event that will decrease or increase the gold to a specific amount, or if you have an event condition that checks for a specific max or minimum gold, or, you know, whatever you may find this useful for. Usage: Place above all other modifier scripts for best performance. Script conflicts: Calestian's Currencies will need some serious editing to get this script to work with it. If you succeed at this, let me know, thanks. Addendum: I made a compatibility patch that works flawlessly. Other known conflicts: None yet. Author requirements: Commercial, Non-Commercial, I don't care. If you like this little script enough, then all I'd like in return is for you to let me know. If you gave me a free copy of your game, I'd appreciate that as well, but not necessary. Is your game 18+ only? Cool by me, by the way. I'm not skeezy like most script writers in this regard, like seriously; I'm kinky too. Jeez. =end class Game_Party < Game_Unit #-------------------------------------------------------------------------- # * Set Gold #-------------------------------------------------------------------------- def set_gold(amount) # @gold = amount @gold = [[@gold = amount, 0].max, max_gold].min end end And with that, I hope that settles the one issue someone else had a while back. Edited November 28, 2018 by PhoenixSoul Share this post Link to post Share on other sites
Kargan3033 8 Posted December 9, 2018 Thank you for the info about this script's creator as well as your own scripts PhoenixSoul. Sorry I have not gotten back to you sooner, been feeling ill as of late as well as being busy. 1 Share this post Link to post Share on other sites
PhoenixSoul 1,404 Posted December 9, 2018 @Kargan3033 It's cool. Take your time getting well, and completing tasks. Never rush it. Share this post Link to post Share on other sites