Help - Search - Members - Calendar
Full Version: Monetary System
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
onidsouza
- Oni Series - Monetary System


Part 1 of the Oni Complete Pack

What it does?
This script transforms your game monetary system to a system like world of warcraft one. It has gold coins, silver coins and bronze coins.

100 Bronze -> 1 Silver
100 Silver -> 1 Gold

It is Plug&Play?
Yes. There are optional configurations, but as the name says, it's optional.

You are going to play-it?
For sure!

It's compatible with the Oni Complete Pack? (Coming Soon)

Yes it is.

Download the script
<div style="margin:20px; margin-top:5px"><div style="margin-bottom:2px">[Show/Hide] Download Script now</div><div style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;">
CODE
#=============================================
# ** Oni Monetary System
#---------------------------------------------
# Developed by Onidsouza
# Do not redestribute without permission
# Remember: MAX_GOLD always is 999.999
# Do not make a item that costs more than that
#==============================================

module OnidsouzaGold
  
  # ▼ OPTIONAL ▼
  
  #If not using icons
  GOLD = "G"
  SILVER = "S"
  BRONZE = "B"
  
  USE_ICON = true
  
  #If using icons, icon ID
  GOLD_ICON = 102
  SILVER_ICON = 98
  BRONZE_ICON = 97
  
end

class Game_Party < Game_Unit
  
  alias onidsouzagoldinit initialize
  
  def initialize
    onidsouzagoldinit
    @gold = [0, 0, 0]
  end
  
  def gold_array
    return @gold
  end
  
  def gold
    return total_gold
  end
  
  def gain_gold(n)
    @gold[2] += n
    update_gold
  end
  
  def lose_gold(n)
    gain_gold(-n)
  end
  
  def total_gold
    return (@gold[2] + (@gold[1]*100) + (@gold[0]*1000000))
  end
  
  def gold_to_silver
    return (@gold[2]/100) + (@gold[1]) + (@gold[0]*100)
  end
  
  def gold_to_gold
    return @gold[0] + (@gold[1]/100) + (@gold[2]/100000)
  end
  
  def update_gold
      times = @gold[2] / 100
      @gold[2] -= times * 100
      @gold[1] += times
      times = @gold[1] / 100
      @gold[1] -= times * 100
      @gold[0] += times
      if @gold[0] > 99
        @gold[0] = @gold[1] = @gold[2] = 99
      end
  end
    
  def make_gold_text
    return to_monetary_system(total_gold)
  end
    
end

class Window_Base < Window
  
  def draw_currency_value(value, x, y, width, gold = true)
    if not OnidsouzaGold::USE_ICON
      self.contents.font.color = normal_color
      self.contents.draw_text(x, y, width, WLH, to_monetary_system(value), 2)
    elsif OnidsouzaGold::USE_ICON and gold
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[2])
    else
      arr = to_monetary_array(value)
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[2])
    end
  end
  
end


class Window_ShopBuy < Window_Selectable
  
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.total_gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    if item != nil
      draw_icon(item.icon_index, rect.x, rect.y, enabled)
      self.contents.font.color = normal_color
      self.contents.font.color.alpha = enabled ? 255 : 128
      wid = contents.text_size(item.name).width
      self.contents.draw_text(rect.x + 24, rect.y, wid, WLH, item.name)
    end
    #rect.width -= 4
    price = to_monetary_system(item.price)
    self.contents.draw_text(rect.x + 24 + wid, rect.y, rect.width - 24 - wid, WLH, price, 2)
    # ▼ NEW
    #self.contents.draw_text(rect.x + 30, rect.y, rect.width - rect.x - 30, WLH, to_monetary_system(item.price), 2)
    #draw_currency_value(item.price, rect.x + rect.width + 8, rect.y, rect.width, false, )
  end
  
end

def to_monetary_system(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 100
  data[2] -= times * 100
  data[1] += times
  times = data[1] / 100
  data[1] -= times * 100
  data[0] += times
  return "#{data[0]} #{OnidsouzaGold::GOLD} - #{data[1]} #{OnidsouzaGold::SILVER} - #{data[2]} #{OnidsouzaGold::BRONZE}"
end

def to_monetary_array(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 100
  data[2] -= times * 100
  data[1] += times
  times = data[1] / 100
  data[1] -= times * 100
  data[0] += times
  return data
end

</div></div></div>

Credit
Onidsouza
breadlord
Nice, I always disliked only being able to have the very simple money system. So thank you for providing an alternitive.

onidsouza
Thank's
That will be part of my ultimate scripts packcage. I'm modifying that script so that it can show icons.
Xeyla
if thats the case, i'll wait to download it. I'd like to get everything in one swipe smile.gif
onidsouza
I'm uploading the new one now, with icons!
I'm not going to modify anything now, unless requested.
Uploading now...

EDIT: Fixed codebox error
drebenk
@onidsouza why the icons for each coin type appear on top of the name of the items in the shop?
onidsouza
It's fixed now
drebenk
@onidsouza nope, still the money values show over the items name - especially if the item name is long.
onidsouza
Sorry, i forgot to edit one line, should work now.
drebenk
@onidsouzanow it is better but still if you have an item name like - Small health potion - or longer one the values become so small and even don't show. ^^ I guess I'll just have to use shorter item names. ^^
onidsouza
Yes, shorter names or bigger windows. I'm limited to the window size, and unless you change the window size that will happen.
IkaruTak
Great script! but I have a problem xD. How can I put the price to something in bronze or silver?
onidsouza
You want a item to cost 12 silver.
To put in silver:
Put the item price * 100
to put in gold:
put the item price * 100000

So 12 silver will be:
1200
IkaruTak
Oh xD Ok, so simply xD thnx
onidsouza
smile.gif Download the complete pack too.
rural_monk
I was looking 4 something quite like this! Cool. thanks Onidsouza! I'm really looking forward 2 some of your future scripts happy.gif
onidsouza
Uh... i'm only making scritps by request, and making bug-fixing. I'm not at RPG Maker anymore. But thanks!
doogle423
QUOTE (onidsouza @ Jun 27 2009, 10:48 AM) *
You want a item to cost 12 silver.
To put in silver:
Put the item price * 100
to put in gold:
put the item price * 100000

So 12 silver will be:
1200


OK...this doesn't explain anything really where do i put the Price * 100 what you have said is very confusing Tbh
onidsouza
In the database, like you always did.
Just remeber that 100 bronze is 1 silver; and that 100 silver is 1 gold.
dorky106
i got a idea for ya if u feel like makeing it
its a party script for EXP share
creator can change the % of exp the characters get from finishing the fight between 1-100%

2nd part would be for the character that finishs the fight gets +10% exp from the fight

think it would be possible?
onidsouza
QUOTE (dorky106 @ Nov 9 2009, 04:10 PM) *
i got a idea for ya if u feel like makeing it
its a party script for EXP share
creator can change the % of exp the characters get from finishing the fight between 1-100%

2nd part would be for the character that finishs the fight gets +10% exp from the fight

think it would be possible?


Yes it would be possible. My work computer is with problems, and i will fix it only at the end of the year (Make HD backups, and buy new parts). I'm only with a notebook. I will have to ask you to ask someone else. I'm sorry.
craven123
huh.gif i dnt get it, i copy the script onto my game and hope it works but it dnt. How do i make it so it works??
onidsouza
QUOTE (craven123 @ Jan 29 2010, 01:33 PM) *
huh.gif i dnt get it, i copy the script onto my game and hope it works but it dnt. How do i make it so it works??


Do you know how to put scripts in your game right?

Copy it, and paste it under materials in your script editor. Then customize it as you want in the Part written OPTIONAL.

If it gives error, or don't work, post a screenshot of the error\scene so i can have a reference to help you.

Onidsouza
ASCIIgod
hey i just wonder, i was having trouble doing my monetary standards, i kinda like your algorithms but it is kinda small change, how do i made it

1 silver = 500 bronze

and

1 gold = 10,000 silver or ( 5,000,000 bronze)

i kinda like that kind of conversion so gold and silver isnt made too easy
onidsouza
oh, well, I think that before posting something here again I own apologies for this whole community. When I used to make these scripts, I was the worst kind of person someone could be. Selfish, ignorant and I wasn't open to criticism, thinking I was the best and all that stuff. I, I'm sorry for all that. I'm sorry for all the dicussions I had with some users, with all mistakes I made. I couldn't take all that guilty at the time, so I just ran away from all this. I hope i'm ready to take it now, I hope i'm ready to be not only a better member, but a better person. So, I decided to get back here, and, try to help were I'm able to. I'm really sorry and I hope you guys take me back as a friend.

Now, @ASCIIgod , I'll look foward for that, I'm kind without practice in scripting hehe, but i'm downloading RPG maker again and I'll make that special algorithim for you as soon as it installs ^^

EDIT: Ok, I tweaked it the way you said:

script
CODE
#=============================================
# ** Oni Monetary System
#---------------------------------------------
# Developed by Onidsouza
# Do not redestribute without permission
# Remember: MAX_GOLD always is 999.999
# Do not make a item that costs more than that
#==============================================

module OnidsouzaGold
  
  # ▼ OPTIONAL ▼
  
  #If not using icons
  GOLD = "G"
  SILVER = "S"
  BRONZE = "B"
  
  USE_ICON = true
  
  #If using icons, icon ID
  GOLD_ICON = 102
  SILVER_ICON = 98
  BRONZE_ICON = 97
  
end

class Game_Party < Game_Unit
  
  alias onidsouzagoldinit initialize
  
  def initialize
    onidsouzagoldinit
    @gold = [0, 0, 0]
  end
  
  def gold_array
    return @gold
  end
  
  def gold
    return total_gold
  end
  
  def gain_gold(n)
    @gold[2] += n
    update_gold
  end
  
  def lose_gold(n)
    gain_gold(-n)
  end
  
  def total_gold
    return (@gold[2] + (@gold[1]*500) + (@gold[0]*5000000))
  end
  
  def gold_to_silver
    return (@gold[2]/500) + (@gold[1]) + (@gold[0]*10000)
  end
  
  def gold_to_gold
    return @gold[0] + (@gold[1]/10000) + (@gold[2]/5000000)
  end
  
  def update_gold
      times = @gold[2] / 500
      @gold[2] -= times * 500
      @gold[1] += times
      times = @gold[1] / 10000
      @gold[1] -= times * 10000
      @gold[0] += times
      if @gold[0] > 99
        @gold[0] = 99
        @gold[1] = 9999
        @gold[2] = 499
      end
  end
    
  def make_gold_text
    return to_monetary_system(total_gold)
  end
    
end

class Window_Base < Window
  
  def draw_currency_value(value, x, y, width, gold = true)
    if not OnidsouzaGold::USE_ICON
      self.contents.font.color = normal_color
      self.contents.draw_text(x, y, width, WLH, to_monetary_system(value), 2)
    elsif OnidsouzaGold::USE_ICON and gold
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[2])
    else
      arr = to_monetary_array(value)
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[2])
    end
  end
  
end


class Window_ShopBuy < Window_Selectable
  
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.total_gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    if item != nil
      draw_icon(item.icon_index, rect.x, rect.y, enabled)
      self.contents.font.color = normal_color
      self.contents.font.color.alpha = enabled ? 255 : 128
      wid = contents.text_size(item.name).width
      self.contents.draw_text(rect.x + 24, rect.y, wid, WLH, item.name)
    end
    #rect.width -= 4
    price = to_monetary_system(item.price)
    self.contents.draw_text(rect.x + 24 + wid, rect.y, rect.width - 24 - wid, WLH, price, 2)
    # ▼ NEW
    #self.contents.draw_text(rect.x + 30, rect.y, rect.width - rect.x - 30, WLH, to_monetary_system(item.price), 2)
    #draw_currency_value(item.price, rect.x + rect.width + 8, rect.y, rect.width, false, )
  end
  
end

def to_monetary_system(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 500
  data[2] -= times * 500
  data[1] += times
  times = data[1] / 10000
  data[1] -= times * 10000
  data[0] += times
  return "#{data[0]} #{OnidsouzaGold::GOLD} - #{data[1]} #{OnidsouzaGold::SILVER} - #{data[2]} #{OnidsouzaGold::BRONZE}"
end

def to_monetary_array(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 500
  data[2] -= times * 500
  data[1] += times
  times = data[1] / 10000
  data[1] -= times * 10000
  data[0] += times
  return data
end


just two details:

1. The limit number of silver coins is very high (up to 9999 displayed, 499 to bronze), wich may cause some visual disturb. I tested it, and those big numbers (above 99) get stretched to fit the screen. Well, just test it yourself and see if you mind.

2. Don't you think its kind unbalanced? 500 to silver, 5000000/10000 to gold, well, it really depends on how fast you gain money on your game, but I think it's something to think about ^^

Well, Glad to Help, reply and ask more if you need ^^
Onidsouza
ASCIIgod
QUOTE (onidsouza @ Jan 21 2011, 05:55 AM) *
oh, well, I think that before posting something here again I own apologies for this whole community. When I used to make these scripts, I was the worst kind of person someone could be. Selfish, ignorant and I wasn't open to criticism, thinking I was the best and all that stuff. I, I'm sorry for all that. I'm sorry for all the dicussions I had with some users, with all mistakes I made. I couldn't take all that guilty at the time, so I just ran away from all this. I hope i'm ready to take it now, I hope i'm ready to be not only a better member, but a better person. So, I decided to get back here, and, try to help were I'm able to. I'm really sorry and I hope you guys take me back as a friend.

Now, @ASCIIgod , I'll look foward for that, I'm kind without practice in scripting hehe, but i'm downloading RPG maker again and I'll make that special algorithim for you as soon as it installs ^^

EDIT: Ok, I tweaked it the way you said:

script
CODE
#=============================================
# ** Oni Monetary System
#---------------------------------------------
# Developed by Onidsouza
# Do not redestribute without permission
# Remember: MAX_GOLD always is 999.999
# Do not make a item that costs more than that
#==============================================

module OnidsouzaGold
  
  # ▼ OPTIONAL ▼
  
  #If not using icons
  GOLD = "G"
  SILVER = "S"
  BRONZE = "B"
  
  USE_ICON = true
  
  #If using icons, icon ID
  GOLD_ICON = 102
  SILVER_ICON = 98
  BRONZE_ICON = 97
  
end

class Game_Party < Game_Unit
  
  alias onidsouzagoldinit initialize
  
  def initialize
    onidsouzagoldinit
    @gold = [0, 0, 0]
  end
  
  def gold_array
    return @gold
  end
  
  def gold
    return total_gold
  end
  
  def gain_gold(n)
    @gold[2] += n
    update_gold
  end
  
  def lose_gold(n)
    gain_gold(-n)
  end
  
  def total_gold
    return (@gold[2] + (@gold[1]*500) + (@gold[0]*5000000))
  end
  
  def gold_to_silver
    return (@gold[2]/500) + (@gold[1]) + (@gold[0]*10000)
  end
  
  def gold_to_gold
    return @gold[0] + (@gold[1]/10000) + (@gold[2]/5000000)
  end
  
  def update_gold
      times = @gold[2] / 500
      @gold[2] -= times * 500
      @gold[1] += times
      times = @gold[1] / 10000
      @gold[1] -= times * 10000
      @gold[0] += times
      if @gold[0] > 99
        @gold[0] = 99
        @gold[1] = 9999
        @gold[2] = 499
      end
  end
    
  def make_gold_text
    return to_monetary_system(total_gold)
  end
    
end

class Window_Base < Window
  
  def draw_currency_value(value, x, y, width, gold = true)
    if not OnidsouzaGold::USE_ICON
      self.contents.font.color = normal_color
      self.contents.draw_text(x, y, width, WLH, to_monetary_system(value), 2)
    elsif OnidsouzaGold::USE_ICON and gold
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, $game_party.gold_array[2])
    else
      arr = to_monetary_array(value)
      self.contents.font.color = normal_color
      xx = 20
      draw_icon(OnidsouzaGold::GOLD_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[0])
      x += 40
      draw_icon(OnidsouzaGold::SILVER_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[1])
      x += 40
      draw_icon(OnidsouzaGold::BRONZE_ICON, x, y)
      self.contents.draw_text(x + 20, y, xx, WLH, arr[2])
    end
  end
  
end


class Window_ShopBuy < Window_Selectable
  
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.total_gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    if item != nil
      draw_icon(item.icon_index, rect.x, rect.y, enabled)
      self.contents.font.color = normal_color
      self.contents.font.color.alpha = enabled ? 255 : 128
      wid = contents.text_size(item.name).width
      self.contents.draw_text(rect.x + 24, rect.y, wid, WLH, item.name)
    end
    #rect.width -= 4
    price = to_monetary_system(item.price)
    self.contents.draw_text(rect.x + 24 + wid, rect.y, rect.width - 24 - wid, WLH, price, 2)
    # ▼ NEW
    #self.contents.draw_text(rect.x + 30, rect.y, rect.width - rect.x - 30, WLH, to_monetary_system(item.price), 2)
    #draw_currency_value(item.price, rect.x + rect.width + 8, rect.y, rect.width, false, )
  end
  
end

def to_monetary_system(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 500
  data[2] -= times * 500
  data[1] += times
  times = data[1] / 10000
  data[1] -= times * 10000
  data[0] += times
  return "#{data[0]} #{OnidsouzaGold::GOLD} - #{data[1]} #{OnidsouzaGold::SILVER} - #{data[2]} #{OnidsouzaGold::BRONZE}"
end

def to_monetary_array(integ)
  data = [0, 0, 0]
  data[2] = integ
  times = data[2] / 500
  data[2] -= times * 500
  data[1] += times
  times = data[1] / 10000
  data[1] -= times * 10000
  data[0] += times
  return data
end


just two details:

1. The limit number of silver coins is very high (up to 9999 displayed, 499 to bronze), wich may cause some visual disturb. I tested it, and those big numbers (above 99) get stretched to fit the screen. Well, just test it yourself and see if you mind.

2. Don't you think its kind unbalanced? 500 to silver, 5000000/10000 to gold, well, it really depends on how fast you gain money on your game, but I think it's something to think about ^^

Well, Glad to Help, reply and ask more if you need ^^
Onidsouza


for that i thank you oni my good man. and about your question on my money system. well you see, my monster on level 1 only drops 1 bronze. the bronze gain is this algorithm. enemy.level(using yerd enemy level) x (1 + actor.level % 10) so it might look a bit low but thats how i make player suffer for low money hahahahahah and your doing a great job so keep it up. and oh i loved your stuffs. make some more. i already made mine. check out consume ite Zelda style and FF1 hit style
FyiGeek
It works great thanks, i might use this if i ever finish my game will give credit thanks!
Tacoghandi
This looks like a very cool way to get a better monetary system and i will be using it in my game (giving you credit of course). I was wondering though if you could help me out by modifying it for my game. Would it be possible to use a wotc monetary system. Something more like...

10 copper = 1 silver
10 silver = 1 gold
10 gold = 1 platinum

If you could help out to make this that would be awesome. I don't need icons or anything though. I'll just use the letters.
If its not possible because of a 4 coin system then thats cool.

Otherwise i modified your current code to fit my game. Hope that that is cool with you. (I'm not going to take any creadit for it.) to make it a 10-1 money ratio for the three coins then just switched the letters to SP, GP, and PP. but i would very much like to have copper in my game. unfortunatly my coding skills are very basic which is why i would like your help as the creator of the code.

Please PM me or Post a comment with the code if you feel like you want to help. otherwise i will just use the modded code i have.

Thanks again for this awesome code.

[edit] Uh Oh i just realized that if im still restricted to a price of under 999999 silver (i.e. Bronze) I still can't get the item prices i need to put certain high priced items in my game. So essentialy this script only allows me to hold more money in my party. would there be a way to set the price in the comments of the item. Basically if i set the item price at 1 silver (i.e. Bronze). Then put a comment in that would call a script and adjust the price of the item accordingly? [edit]
InfinateX
Cool script! tongue.gif

I was thinknig before seeing tacoghandi's reply that it should be editable. By this I mean the ammount each type is worth, how many types, you know things like that.

Still a very good script though!
DoctorTodd
I found a problem with the icons when I obtain silver the icons switch on me were the silver icon is the bronze icon. never mind did something stupid
KJ55
Heya buddy, it's my 2nd day being a trainee script editor (self study), can't believe I learn so quickly.
I posted this to help out on something. I hope this isn't much of a necro-post. biggrin.gif

While I was trying something out with your monetary script (I can't believe it exists biggrin.gif),
I found some cash error.

Also you haven't configured something with Window_ShopNumber (or in Window_Base, I think)... yet; whenever you buy something, instead of showing how much an item costs, it shows the current gold of the party.

I found the error on the first post, I'm not sure if you already edited it.

here's the typo code:
CODE
  
def total_gold
    return (@gold[2] + (@gold[1]*100) + (@gold[0]*1000000))
  end
  
  def gold_to_silver
    return (@gold[2]/100) + (@gold[1]) + (@gold[0]*100)
  end
  
  def gold_to_gold
    return @gold[0] + (@gold[1]/100) + (@gold[2]/100000)
  end

here's what it should be:
CODE
  
def total_gold
    return (@gold[2] + (@gold[1]*100) + (@gold[0]*10000))
  end
  
  def gold_to_silver
    return (@gold[2]/100) + (@gold[1]) + (@gold[0]*100)
  end
  
  def gold_to_gold
    return @gold[0] + (@gold[1]/100) + (@gold[2]/10000)
  end


I found this error when I was buying something expensive (I had 1 g), the item count reaches 99, which means you can buy more.
The result cash (change) becomes negative.

I hope this help the other RPG Makers! biggrin.gif
Shaddow
This code looks great, I really appreciate the hard work Oni, I will be using this in my game and of course proper credit due.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.