设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 123|回复: 0

[转载发布] Kalacious's Currency System and Shop!

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 15:56:53 | 显示全部楼层 |阅读模式
    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.
    Screenshots

    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 Scripthttps://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.',      
    btained    => 'Guild Battles'    },    'RT' => {      :full_name   => 'Resource Token',      :icon        => 278,      :max         => 9999,      :description => 'Used for crafting.',      
    btained    => 'Jobs'    },     'CC' => {      :full_name   => 'Celestial Coin',      :icon        => 526,      :max         => 9999,      :description => 'Used for Celestial gear.',      
    btained    => 'Celestial Rips'    },       }    COLOR_CURRENCY_NAME = 5  COLOR_CURRENCY_SYM = 5  COLOR_CURRENCY_OBTAINED = 2  COLOR_CURRENCY_DESCRIPT = 2    SHOW_IN_MENU = falseend

    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],      
    rice => [10, 14],    },    'RT' => {      :item_type => [0, 0],      :item_id => [1, 2],      
    rice => [10, 14],    }      }end

    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.


    本贴来自国际rpgmaker官方论坛作者:DarknessFalls处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kalaciouss-currency-system-and-shop.16603/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 00:24 , Processed in 0.064928 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表