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

[转载发布] Inventory Limitations

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    Draconis Inventory Limitations v1.2
    by DraconisKnight

    Introduction:
    I made this plugin for my own project after finding other limited inventory plugins, such as the one by Mr. Trivel.  I couldn't get how I wanted my inventory to work since I was wanting to use a variable and items to control my max limit.

    With Inventory Limitations, you can use variables to limit and adjust the cap with usage of items.  All it takes is setting your variables up and events that either increase or decrease the max limit.

    Features:
    - Limiting your party's inventory with $gameVariables
    - Making it were a stack can equal a space with the Exempt note tag

    • Three options: Numerical, Mathematical, and $data

      • Numerical: <Exempt: 0> and <Exempt: 1>

        • <Exempt: 0> makes all items in that stack count towards the inventory cap.
        • <Exempt: 1> tells the plugin not to count that item.  This one is best used on key items.

      • Mathematical: <Exempt: $gameVariables.value(i) -1>

        • $gameVariables.value(i) would equal the variable assigned to the number of that particular item the party has in possession.  The minus one in the equation will deduce one item for the inventory count.  The rest will be exempt.

      • $data

        • Added to the help file by Zarsla.  They use data straight from the database.  To use this option, use the following note tags as each will be for their respective category in your project database.

          • <Exempt: $gameParty.numItems($dataItems(i))> or <Exempt: $gameParty.numItems($dataItems(i)) - 1>
          • <Exempt: $gameParty.numItems($dataWeapons(i))> or <Exempt: $gameParty.numItems($dataWeapons(i)) - 1>
          • <Exempt: $gameParty.numItems($dataArmors(i))> or <Exempt: $gameParty.numItems($dataArmors(i)) - 1>









    Note that will be the object's index your database. And use the square brackets around i.​






    -Some customization to Scene Shop after adding inventory count to the status window.  Inventory count can be set to show used space over the total space (inventory cap), only the remaining slots available, or the remaining slots available over the inventory cap.

    - Script call: $gameParty.getInventUsedSpace (); => Returns the occupied space.  Can be used in your events to see if the party can carry anymore new items/item stacks.

    Setting up Inventory Limitations: (Added 6 March 2018)
    Install Draconis_InventoryLimitations.js in your Plugin Manager.  If you are using Yanfly's Item Core, make sure Inventory Limitations in under it.

    Follow the help file with the parameters.  The only one that does not need input is "Exempt".

    On your first map, make a parallel process.  All you need to do here is assign variables: one for the inventory cap (if using the variable method) and several more for the number of X items the party has.  Those variables will be used in the math version of the Exempt note tag.

    EX:  10x Potions
    Event Page will have Control Variables: #001 Potions Exempt = Number of Potions

    In the items tab of the database, select potion and enter <Exempt: $gameVariables.value(1)-1> .

    Screenshots:
    Attached.

    Downloads:
    Download plugin only here.
    Download Demo Project here.

    Terms of Use:
    This plugin is free to use for both non-commercial and commercial use.  All I ask is credit for using this plugin.

    Also credit Zarsla as they added a new gain item function to the plugin.

    Modifications are fine as long credit is given.

    Thanks goes to:
    -Mr. Trivel => Author of MrT_LimitedInventory as it started my coding journey.

    -Yanfly => Whose plugins I picked apart and reverse engineered while also reading the core files.

    -TheoAllen => Author of a weight based inventory that was also studied for version 1.1.

    Compatible with:
    -Yanfly Core Engine
    -Yanfly's Item Core without Independent Items engaged.

    Upcoming Features:
    -A non-stacking inventory system with its own discard and discard confirm. [Current Project]

    -A way for those using a static inventory cap to increase if they wish

    -[Finished: April 2018 to January 2019] Discard works for all item categories with the exception of Key Items.

    -[Finished: July 2019 to January 2020] A confirm window before the discard to help prevent accidental discarding.

    -Layering windows because MV just overwriting it looks tacky. Purely for aesthetics.

    -Possibly adding a speed option. Maybe after tinkering with the concept.

    Note:
    - I just noticed a small bug with if you are awarding one item (such as a potion), I'm already working on a fix.  But it works fine if you award more one. (Resolved- Help file expanded on how to avoid this.)

    -Item Limit Window refreshes after opening the item menu if using YEP_X_ItemDiscard.  (Resolved between April 2018 to January 2018.  The plugin now has its own discard function that YEP_X_ItemDiscard isn't needed.  Within the discard function, this plugin updates the limit window automatically.)

    -Any bought item (that exceeds the inventory limit) is automatically deleted. I still want to address this in the plugin, but after hitting the JS books and taking time to understand how the shop functions work.  (Resolved April 2018 by overwriting the shop's isEnabled function.)

    -A bug with <Exempt: 0> and the current gainItem function.  Function currently discards an item stack if it exceeds the inventory cap. [Current Project]
    Versions:
    1.2-
    Added a Discard Confirm for a stacking inventory system along with a command that gives the option to jump to Scene_Equip on weapons and armors.  The option to change all new (current) windows for those wishing/planning to use a plugin that changes the scene's background.

    1.1a- Fixed bug with Window_ShopBuy's isEnabled function.  Also added a few customization options to Scene Shop.

    1.1- Big update including:

    • Added an action window with three commands: use, throw away,  and cancel.  Discard works with items only. [Completed April 2018]
           -Fixed bug in the use command.  Before it was enabled on all or disabled                         [Completed January 2019.]

           -Made it were discard is disabled for all items that register as a 'Key Item'.

         2. Overwrote the original Window_ShopBuy.prototype.isEnabled to update with                inventory. [Completed April 2018]

             -Meaning if the bag is full and the party doesn't have one of the items the                       vendor is selling, that item cannot be bought unless room is made.

    1.0d - *Done by Zarsla* Thank you very much.   They added a new gain item function to the plugin that doesn't require any checks.  The plugin now automatically discards any items over the inventory cap as well as adding the new note tags to the help file.  In addition, the party's gold can be included as a 'stack' in the inventory.

    1.0c - Added script calls and one set of instructions for inventory checks. (Gaining new and size.)

    1.0b - Figured out how to code the note tag for one item.  Instructions have been edited and included an example on how to set up the variable.

    1.0 - Released.


    本贴来自国际rpgmaker官方论坛作者:DraconisKnight处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/inventory-limitations.92093/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 06:37 , Processed in 0.081061 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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