Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V  < 1 2  
Reply to this topicStart new topic
> Monetary System, Gold, silver and bronze coins,.
onidsouza
post Nov 14 2009, 06:51 AM
Post #21


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




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.


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
craven123
post Jan 29 2010, 08:33 AM
Post #22



Group Icon

Group: Member
Posts: 1
Type: Event Designer
RM Skill: Skilled




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??
Go to the top of the page
 
+Quote Post
   
onidsouza
post Jan 29 2010, 02:25 PM
Post #23


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




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


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
ASCIIgod
post Jan 16 2011, 06:51 AM
Post #24


Demonic God of Snippets of Doom +10
Group Icon

Group: Revolutionary
Posts: 271
Type: Scripter
RM Skill: Intermediate




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


__________________________

Go to the top of the page
 
+Quote Post
   
onidsouza
post Jan 20 2011, 01:55 PM
Post #25


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




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


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
ASCIIgod
post Jan 25 2011, 12:46 AM
Post #26


Demonic God of Snippets of Doom +10
Group Icon

Group: Revolutionary
Posts: 271
Type: Scripter
RM Skill: Intermediate




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


__________________________

Go to the top of the page
 
+Quote Post
   
FyiGeek
post Feb 18 2011, 06:24 PM
Post #27



Group Icon

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




It works great thanks, i might use this if i ever finish my game will give credit thanks!

This post has been edited by FyiGeek: Feb 18 2011, 07:46 PM
Go to the top of the page
 
+Quote Post
   
Tacoghandi
post Jun 24 2011, 09:41 AM
Post #28


Level 1
Group Icon

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




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]

This post has been edited by Tacoghandi: Jun 24 2011, 11:40 AM
Go to the top of the page
 
+Quote Post
   
InfinateX
post Jul 6 2011, 12:13 PM
Post #29


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Developer
RM Skill: Advanced




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!


__________________________
I Support:






Legal Stuff:

If you use any of my resouces please credit me. I put © on all of them so you pretty much have to anyways.


Click Here

Some of you may have seen what I had posted in this spot before but now it just says that the request was fufilled on March 28, 2011 :)


I bet nobody knows how I did this:

If you think you figured it out PM me and if your correct you will earn this valueble skill... or you can just brag about it :D


Current Projects:

At rmrk.net/index.php/topic,42236.new.html#new and omega-dev.net/forums/showthread.php?tid=1086&pid=21328
Go to the top of the page
 
+Quote Post
   
DoctorTodd
post Jul 12 2011, 08:17 AM
Post #30


Level 2
Group Icon

Group: Member
Posts: 19
Type: Developer
RM Skill: Advanced




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

This post has been edited by DoctorTodd: Jul 14 2011, 11:42 AM
Go to the top of the page
 
+Quote Post
   
KJ55
post Aug 21 2011, 08:35 AM
Post #31



Group Icon

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




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

This post has been edited by KJ55: Aug 21 2011, 08:38 AM
Go to the top of the page
 
+Quote Post
   
Shaddow
post Dec 21 2011, 12:40 PM
Post #32


The Eventer Inventor
Group Icon

Group: Local Mod
Posts: 1,250
Type: Event Designer
RM Skill: Masterful
Rev Points: 90




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.


__________________________




I support these projects! -------------





Go to the top of the page
 
+Quote Post
   

2 Pages V  < 1 2
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: 20th May 2013 - 11:07 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker