Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> [Request] Money Pouch/Currency Script, Must Read!
TheWhitosify
post Apr 14 2012, 11:21 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed




Hey guys,

I'm looking for a script that adds a new menu tab called pouch. And adds extra currencies to the game so i can go into banks in different parts of the world and exchange it for another currency, otherwise it would cost more because there would be interest,

The pouch would be for all of the currencies.
E.g.

500 Tyrans=400 Gold
etc.

If someone could make this or direct me to a script already like this, it would be much appreciated.

Thanks "biggrin.gif

This post has been edited by TheWhitosify: Apr 14 2012, 11:22 PM
Go to the top of the page
 
+Quote Post
   
mr_melee
post Apr 15 2012, 01:14 AM
Post #2


Level 1
Group Icon

Group: Member
Posts: 10
Type: Developer
RM Skill: Undisclosed




start here:
game_party currency attributes
class Game_Party < Game_Unit #affecting game party, where gold is read from.

attr_reader :gold_worth
attr_reader :tyran
attr_reader :tyran_worth
attr_reader :bronze #specific currency attributes
attr_reader :bronze_worth
attr_reader :silver
attr_reader :silver_worth
attr_reader :iron
attr_reader :iron_worth
attr_reader :coal
attr_reader :coal_worth
attr_reader :steel
attr_reader :steel_worth
attr_reader :platinum
attr_reader :platinum


alias currency_to_gold_init initialize #alias of init phase to introduce
# the values of the new attr_readers
initialize # for the game party.
@gold_worth = 0
@tyran = 0
@tyran_worth = 0
@bronze = 0
@bronze_worth = 0
@silver = 0
@silver_worth = 0
@iron = 0
@silver_worth = 0
@coal = 0
@coal_worth = 0
@steel = 0
@steel_worth = 0
@platinum = 0
@platinum_worth = 0
currency_to_gold
end

=
## GAIN specific currency methods

def gain_tyran(n)
@tyran = [[@tyran + n, 0].max, 9999999].min
end

def gain_bronze(n)
@bronze = [[@tyran + n, 0].max, 9999999].min
end

def gain_silver(n)
@silver = [[@silver + n, 0].max, 9999999].min
end

def gain_iron(n)
@iron = [[@iron + n, 0].max, 9999999].min
end

def gain_coal(n)
@coal = [[@coal + n, 0].max, 9999999].min
end

def gain_steel(n)
@steel = [[@steel + n, 0].max, 9999999].min
end

def gain_platinum(n)
@platinum = [[@platinum + n, 0].max, 9999999].min
end


#### LOSE specific currency methods

def lose_tyran(n)
gain_tyran(-n)
end
def lose_bronze(n)
gain_bronze(-n)
end
def lose_silver(n)
gain_silver(-n)
end
def lose_iron(n)
gain_iron(-n)
end
def lose_coal(n)
gain_gold(-n)
end
def lose_steel(n)
gain_gold(-n)
end
def lose_platinum(n)
gain_gold(-n)
end


end

end



if you take this and redefine the attr_readers and "gain_/loss_" methods and set what values you
want the currencies to be worth, post it back here and I'll see what i can do. this script initializes the values
you want, but you need to define the value of the currency before you can determine the formula to compare
them.
Go to the top of the page
 
+Quote Post
   
TheWhitosify
post Apr 15 2012, 03:24 AM
Post #3


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed





Thankyou, i'll get back to you in the next few days. i need to set up my other computer.
Go to the top of the page
 
+Quote Post
   
mr_melee
post Apr 15 2012, 12:31 PM
Post #4


Level 1
Group Icon

Group: Member
Posts: 10
Type: Developer
RM Skill: Undisclosed




hehe, i was a little drunk last night and spoke hastily..

i was thinking about it today and i figured that there's a couple of ways we could set this up. this first method i think is the most effective because it allows us to set gold as the most expensive currency and work our way down. but then we have to deal with how these currencies are gained/spent/lost etc. another way, if they were all going to be currencies worth more than the value of gold, we could make them items in the database which cost a certain price of gold and could be sold back to other shops, etc.

but i still think that the simplest way is for us to define them the same way we define the gold value and make a formula of determining their worth in gold with whole numbers in prime ratios. so basically we would say this:

1 gold = 2 tyran (so 2 tyran is one gold, etc)
3 silver
4 bronze
5 steel
6 iron
10 coa

(we're going to cut out platinum just for the sake of these ratios.

so in the case that we are dealing with 1/2, 1/4, 1/5, and 1/10 ratios, we simply say that gold = 100 units of the currency/ the currency's worth value.

so for tyran, for example we would argue that gold = 100/2. stating that 100 tyran becomes 50 gold. this is a basic formula, but it'll keep the numbers simple and most importantly WHOLE. i'm too lazy to deal with decimal points; and im not much of a programmer. yet.


the reason we divide 100 by the gold worth is because we are exchanging 100 of the specified currency into gold.

in the case that we're dealing with the 1/3 and 1/6 ratio, we then say that we are going to exchange 90 of the specified currency into gold.
so we would argue that gold = 90/3 stating that 3 silver is equal to one gold.

the reason we use 90 instead of 100 is because 6 and 3 do not produce a whole number out of 100. in this case you would have change the amount of currency, or we could decide to round up/down. which i dont think is really necessary.

personally i think that you dont need to make it that complicated, and simply need to use the 1/2, 1/4, 1/5 and 1/10 ratios... and maybe a 1/20 ratio for that really worthless currency.


simple.

the other problem that we need to tackle is how we're first going to let the character view this information. and there are again, a few ways we can do this. the way i know you saw it was as a new addition to the party menu called "pouch". while i think that would look pretty cool,
we would have to rescript ourselves a party menu with that added menu item. or we could simply make the gold window scroll through the currencies when it is drawn in the party menu(which is hella cool). but, i think the best method (and the coolest) would be for us to make an item called "pouch" that brings up our pouch menu when used in the inventory. that way we only have to define the one window instead of adjusting the params of the original party menu to fit an extra selection.


SIMPLE!

the next major issue is deciding how the player can use these currencies, if he can use them to buy at certain shops that only accept the one kind of currency, (which involves a lot of code because we have to set the value of every item in every currency!) set up our shopkeeper so he either has all currencies or the specific one... Personally I think it might be easier to just say that every shop trades in gold. You might be in a different country where people pay you for work in their currency or the enemies there drop the currency... whatever you want. we just have to say, no matter how you get that money you can only buy things with it if you turn it into gold. and then we make a custom shop window to act as our currency exchange menu, which could be initialized by interacting with something like an ATM in a sci-fi setting or a banker in the more traditional fantasy setting.


i leave this part up to you to decide, i am going to opt for the simple steps in all of these situations. so we will be displaying additional currencies that we view through our pouch item in the inventory(a handy map of the world could also be scripted this way!), setting certain events/enemies/etc to give you the currencies and then make a menu for our banker NPC who would convert those currencies into gold so we can use the gold at shops.


at this point it isn't so much a currency exchange but a commodity exchange. once we establish this system we could set up modifiers
that adjust the conversion rates based on, say... how much currency you have exchanged. like maybe the more currency you
exchange, the higher the modifier, resulting in a better exchange rate.

we could even set limits for certain bankers, where if you have brought them a certain amount of currency type he'll say, "no i can't exchange that anymore". kind of like inflation, where because he's exchanged that money to the point that it isnt worth its weight in gold.


think it over, pick five more currencies besides tyran and we will go from there.

This post has been edited by mr_melee: Apr 15 2012, 12:32 PM
Go to the top of the page
 
+Quote Post
   
X-M-O
post Apr 15 2012, 12:38 PM
Post #5


Level 82
Group Icon

Group: Director
Posts: 6,347
Type: None
RM Skill: Undisclosed




Moved to RGSS2 Script Requests.


__________________________
Go to the top of the page
 
+Quote Post
   
TheWhitosify
post Apr 15 2012, 02:03 PM
Post #6


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed






That all sounds pretty much perfect! the simple ratios sound good and customizable to a certain degree. The way you suggested the pouch and ATM's sound awesome. I would like to keep it simple. so we would use the simple ratios. Could we have 1 currency that is worth more than gold? and you find it rarely. Eg is a boss battle. or a rare trade. ect. so yes this all sounds great! woot.gif
I'll get back to you with those names. thanks.gif

This post has been edited by TheWhitosify: Apr 15 2012, 02:11 PM
Go to the top of the page
 
+Quote Post
   
TheWhitosify
post Apr 16 2012, 03:12 PM
Post #7


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed




Hey, so i have all the names here:

assuming gold doesn't count as one of the other currency's.

So we would have
- Platinum ( Worth more than gold? like 2/1)
- Bronze
- Silver
- Tanze
- Tyrans
- Zustios
woot.gif
Go to the top of the page
 
+Quote Post
   
mr_melee
post Apr 17 2012, 12:53 PM
Post #8


Level 1
Group Icon

Group: Member
Posts: 10
Type: Developer
RM Skill: Undisclosed




yes i think that will work. in that case we could actually make platinum an item you could trade, then you could set any value you want on it. that way later if you decide you want to make another item that is also rare and worth more we don't have to code anything it just becomes another item entry in the database. the main reasoning behind this is because gold is already the trading standard in the system, it would make sense that a commodity of higher value could also be used in trade. that and platinum would be the only equation devaluing gold. my hope is that with the five remaining currencies we can use one equation, as we will only need to use 1/2, 1/4, 1/5, 1/10, 1/20. it will cut out the headache of the 1/3 and 1/6 equation. basically just simplifying the calculation method we will use to convert these currencies into gold.
i'm trying to focus on this on-map battle system for the next couple of days, but i will give this serious attention this weekend and hopefully next monday we'll have something to work with, at least have the system in place with a window displaying the currencies and their values attached to the pouch, then we can work on the atm and its conversion method. would you prefer to have the character select which currency and how many increments of 100 they would like to convert, or should the conversion automatically convert all currencies into gold? you wont be using them any other way, so to me it makes sense for the atm to just convert what it can and leave the rest. you might say have:

115 tyran
90 bronze
160 silver

etc...

the method would look and see 115 tyran, so it would convert the 100 tyran into gold and leave the remaining 15.
it would not convert bronze, as bronze is under 100
and again, 100 silver would be converted into its value in gold and the remaining 60 would stay.

so this would all become one calculation instead of hassling the player with converting each increment of a currency manually.
if you had 10000 silver and you had to convert it 100 at a time i think that would be rather tedious, as a pose to, okay this is all the currency you can convert, here's what it is worth in gold.
Go to the top of the page
 
+Quote Post
   
TheWhitosify
post Apr 17 2012, 03:31 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed




automatically convert all currencies into gold sounds perfect! sounds good. I look forward to seeing it!
Go to the top of the page
 
+Quote Post
   
TheWhitosify
post May 16 2012, 01:48 PM
Post #10


Level 1
Group Icon

Group: Member
Posts: 8
Type: None
RM Skill: Undisclosed




Hey. haven't hear from you in a while. hows everything going?
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 04:50 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker