- Joined
- Jun 7, 2013
- Messages
- 1,393
- Reaction score
- 210
- First Language
- English
Kalacious Currency Generator and Currency Shop! 1.0.1
Creator: Kalacious (AKA Vindictive Personality)
Introduction
This set of scripts is designed to allow you to create your own currencies and also set up shops to use those scripts.
Features
- Create new currencies
- Create new shops for those currencies.
Currencies Screen:
Currencies Shop For GC currency:
How to Use
The details are in the headers of both scripts. The headers are well detailed, well documented.
Demo
None.
Script
Currency Script https://gist.github.com/AdamKyle/6046633
Currency Shop - Requires Currency Script https://gist.github.com/AdamKyle/6046623
FAQ
Questions? Please make sure to read the script headers as they are well documented. If you have questions or bug fixes or what have you please post.
Credit and Thanks
RM Community for your help.
Author's Notes
Version 1.0.1 brings some small fixes.
Version 1.0.2 Aligns some text in the description window and moves some icons over. We also allow for a bit longer Text for description, for exmple: Used for Ascended gear and stuffs..... Will work. I wouldn't go over it.
Tutorial 1 - Making a shop using the script (not script calls)
Some people have been having issues setting up shops using currencies and I thought I would take a moment to explain how to do that using no script calls, other then one you need for the NPC to open the shop.
First lets set up our currencies in the currency script:
module CURR #-------------------------------------------------------------------------- # * Currency hash object created. The vocab here is the key, where # as the value is a hash of key=>value that defines the currency. #-------------------------------------------------------------------------- CURR_HASH = { 'GC' => { :full_name => 'Guild Coin', :icon => 330, :max => 9999, :description => 'Used for Ascended gear.',
Next, we need to head over to the script shop and pick a currency to make shops from:
module SHOPS #-------------------------------------------------------------------------- # * Create your shop objects here based on a particular vocab. #-------------------------------------------------------------------------- SHOPS_HASH = { 'GC' => { :item_type => [0, 0], :item_id => [1, 2],
Here you can see that I went ahead and created two shops, notice how the Key of in the hash matches that of the currency in the currency script? You cannot have shops for currencies that do not exist.
Ok so now you want to call the shop, GS.create_shop('RT', true); will create a shop using the RT Currency, and set it so you can only buy items.
Tutorial 2 - Using the Script calls to create shops!
Some people are confused on how to create shops using only the script calls. lets delve into that, shall we? First we need to make sure we have some currencies set up, tutorial one, above, goes into that. Once we have some currencies set up we need to understand some basic and fundamental scrip calls: $kc_shop.create_item(item_type, item_id, price) - This creates a single item, this item is then stored in object of items call the master inventory list. item type is: 0 - items, 1 - weapons or 2 - armor. Item id is the id of that item in its respected type, where as price is - well how much it costs.
So: $kc_shop.create_item(0, 1, 20) is: an item of id 1 at the price of 20.
No lets create some items shall we?
$kc_shop.create_item(0, 1, 20)$kc_shop.create_item(0, 2, 20)$kc_shop.create_item(0, 3, 20)There, now we have three items. - wait, where am I creating these? All of these script calls are being done on the NPC you want, or the event, that is the shop for this type of shop.
--- See the Screen Shot ---
Next, since we have out items created, and our currency we need to create and call the shop into existence.
So we need this call: GS.call_shop(master_inventory, 'curr', puchase_only = false). How do we use it? like so:
GS.call_shop($kc_shop.inventory, 'GC', false)The above states, create me a shop based on the inventory list I passed in for the currency value of GC (note the string GC), where I can buy and sell items.
So we have the following:
Ok now lets run this:
Your database is going to be different from mine but you can see we have items 1, 2 and 3.
WAIT!!!!!!! - I have a shop called GC already set up in the hash with item 4,5 and 6....
So you created a hash shop called GC with item id 4, 5 and 6. Then you used the script calls to create a GC shop with item id 1,2 and 3? No problem. Two different script calls. The script call from Tutorial 1: GS.create_shop('RT', true); will create you shops BASED on that currencies hash in the shop script where as GS.call_shop($kc_shop.inventory, 'GC', false) will create you a shop BASED on the inventory list you created for the NPC or event that is to act as the shop.
Why have both?
The hash is good for setting up static shops, shops that wont change. the other is for setting up fresh shops on the fly. You must always create the inventory list BEFORE calling the shop, you cannot alter the inventory list after the shop is called.
Note: you cannot create static shops and then have the script calls manipulate the static shop inventory list. That is not a feature I have built yet one I am looking at.
Last edited by a moderator: