Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

SG.Multiples currencies Rewritte.

because SandGolem its dead ;). i want to request his script or a similar script or a rewrite of his script, because the first version of this scripts have some bugs.

For example, when i gain 'Gold currency' in a X currency the same number of 'Gold currency' appears in the central gold currency, and for fix these you need to change to the central gold currency after you obtain gold in every new currency.

here is the script:

Code:
#=============================================================================
# ** SG Multiple Currencies
#=============================================================================
# sandgolem
# Version 1
# 16.03.06
#=============================================================================
#
# Part of this script was based on one "Link_05" posted to rmxp.net boards
# An additional edit to it was by him, with the icon shown on the left
# (The "Icon where currency (Gold) is" script)
#
# If you don't intend to use multiple currencies in your game, I highly
# recommend using that script instead of this one to show it's icon!
#
#=============================================================================
#
# This requires event scripting to switch, see below.
#
# The only script-related things to edit is this:
#
$sg_currency_names = ['G','Token','Ticket']
$sg_currency_icons = ['mbag','coin','card']
$sg_currency_vars =  [2,3,4]
#
# These need to be ordered exactly the same. You can increase the amount of
# currencies by adding more to the end of each.
#
# Set the first to what you have your gold name as in the database.
# Icons and vars are picked based on the order that you have your names set
# to. Make sure you name the variable in RMXP so you won't reuse it.
#
#=============================================================================
#
# To change the player's currency, use this in a call script:
# sg_change_currency('NameHere')
#
# This changes your current currency and modifies the amount of gold you have
# to whatever it is set at. The amount of gold you had before is set to the
# variable listed for it. This can be used anywhere, even in other scripts
#
#=============================================================================
#
# The variable used for your current gold is NOT altered until you change the
# currency. To do checks for that amount ingame, just use the regular gold.
#
# Or, you can save it by using this in a script: sg_save_currency
# This command is included in sg_change_currency and generally not useful
#
#=============================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# under the default scripts and Software Development Kit (optional).
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
begin
SDK.log("SG Multiple Currencies", "sandgolem", 1, "16.03.06")
if SDK.state("SG Multiple Currencies") != true
@sg_multiple_currencies_disabled = true
end
rescue
end

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if !@sg_multiple_currencies_disabled

class Window_Gold < Window_Base

def refresh
self.contents.clear
#------------------------------------------------------------------------------
# Begin SG Multiple Currencies in Window Edit
#------------------------------------------------------------------------------
self.contents.font.color = normal_color
self.contents.draw_text(4, 1, 120, 32, $game_party.gold.to_s, 2)
sg_select_currency_icon
src_rect = Rect.new(0, 0, 32, 32)
if @icon != nil
self.contents.blt(0, 3, @icon, src_rect)
end
#------------------------------------------------------------------------------
# End SG Multiple Currencies Edit
#------------------------------------------------------------------------------
end

def sg_select_currency_icon
@sg_mc_temp = 0
loop do
if @sg_mc_temp > $sg_currency_names.size
return
end
if $data_system.words.gold == $sg_currency_names[@sg_mc_temp]
@icon = RPG::Cache.icon($sg_currency_icons[@sg_mc_temp])
return
end
@sg_mc_temp+=1
end
end
end

def sg_save_currency
@sg_mc_temp = 0
loop do
if @sg_mc_temp > $sg_currency_names.size
p "You have an invalid currency name! Contact game author"
p $data_systems.words.gold
@sg_mc_currency_stop = true
return
end
if $data_system.words.gold == $sg_currency_names[@sg_mc_temp]
$game_variables[$sg_currency_vars[@sg_mc_temp]] = $game_party.gold
return
end
@sg_mc_temp+=1
end
end

def sg_change_currency(cur_new)
sg_save_currency
if @sg_mc_currency_stop == true
return
end
@sg_mc_temp = 0
loop do
if @sg_mc_temp > $sg_currency_names.size
p "Invalid currency name in command! Contact game author"
p cur_new
return
end
if cur_new == $sg_currency_names[@sg_mc_temp]
$game_party.lose_gold($game_party.gold)
$game_party.gain_gold($game_variables[$sg_currency_vars[@sg_mc_temp]])
$data_system.words.gold = cur_new
return
end
@sg_mc_temp+=1
end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

And, i want to be compatible with the SDK 2.3.

in conclusion, this is a simple rewritte of this script, but need to be compatible with the newest version of the SDK (2.3).

thanks.@_@@_@
 
I'm not dead yet. That looks like it's a way old version though. :)

I'll see if I have a newer version with bugs fixed handy when I'm back home and get back to you. I think SephirothSpawn might've made a much better multiple currency script (this was one of my first), check his testbed if you haven't.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top