Barotrauma 潜渊症

Barotrauma 潜渊症

评价数不足
Configurable Stack Size (Lua)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
30.896 KB
1 月 6 日 上午 8:07
1 月 8 日 下午 8:44
5 项改动说明 ( 查看 )

订阅以下载
Configurable Stack Size (Lua)

描述
Configure the stack size of any in-game item via an editable config file. The 63-stack size limit is removed in Singleplayer but remains in Multiplayer. By default:

  • Stackable "smallitems" have a stack size of 64 (32 in player inventory).
  • Items like O2/fuel tanks remain unstackable in player inventory but stack to 64 elsewhere.
  • Ammo and battery stacks are doubled in player inventory (e.g., 24 revolver rounds instead of 12).

All defaults are customizable in the config file.

Requirements

Configuration
Launch the game once with the mod enabled to generate the default config in the "Barotrauma/ModConfigs/ConfigurableStackSize/" directory. "Barotrauma" refers to the folder where your save files are stored.

The configuration file is initially minified. It's recommended to format it with an auto-formatter before making modifications.

In Multiplayer, only the host’s configuration is used and synced to players.

Format

"itemPatches": [ { "applyOnlyToStackables": false, "tags": [ "mobilebattery", "handheldammo" ], "operations": [ { "key": "MaxStackSize", "operation": "=", "value": "{maxStackSize}" }, { "key": "MaxStackSizeCharacterInventory", "operation": "*", "value": 2 }, ] } ], "containerOptions": { "maxStackSize": 64, "characterInventoryCapacity": 32, }

The configuration uses "itemPatches" to define stack size rules based on tags or item IDs. Items are matched in top-down order, applying the operations of the first matching patch.

Each item has three stack sizes: general, player inventory, and mobile containers. Operations modify these sizes using numbers or references to container options like "{maxStackSize}".

The "containerOptions" section sets general stack size limits for different container types. For example, "maxStackSize" applies to containers that don't fall under other specific container groups. Customize these limits as needed in the config file.

If "applyOnlyToStackables" is not specified, it defaults to true.

Refer to the config file for more details.

Note:
  • I plan to add an UI to edit item stack size in-game instead of having to go through the config file.
15 条留言
Leone 16 小时以前 
hello, How can I make the amount of ammunition in my inventory the same in my belts and backpacks?
It's too OP to carry a stack of 32 assault rifle magazines in my belts🤣.
freedurof 3 月 6 日 上午 12:31 
how to remove stacks in ammunition shelves and cabinets for underwater equipment
pinkduck  [作者] 1 月 23 日 下午 3:23 
Yes it does, the stack limit in multiplayer will be 63 however.
这个人没铭字 1 月 23 日 上午 10:51 
Does this mod work in multiplayer mode?
Lucifer 1 月 11 日 上午 1:51 
@pinkduck, Tnx man. You Better! This mod very good. Good luck.)
RzR⁧⁧Telhalm 1 月 10 日 下午 5:23 
I actually prefer O2 tanks and Welding Fuel to not stack as - and this is probably just a mod interaction - the last stacksize mod I used ended up using ALL of the O2/Welding fuel if it was able to stack in a container that used ammo. e.g: I believe S.A.F.S. exoflamer used the ENTIRE stack.
pinkduck  [作者] 1 月 10 日 上午 9:36 
@Lucifer, Hotbar stacking is key `MaxStackSizeCharacterInventory`


Now, I'm assuming you meant O2 tanks by "Oxygen balone", and so here's how to do it,
Pastebin [rentry.co]

Pastebin because it'll be badly formatted in steam comments...
Lucifer 1 月 10 日 上午 8:49 
Need help. How change staxsize item in hotbar? Oxygen balone don't stack. ((((
pinkduck  [作者] 1 月 8 日 下午 8:47 
Configs are now stored in the save folder at "Barotrauma/ModConfigs/ConfigurableStackSize/"
RzR⁧⁧Telhalm 1 月 7 日 下午 8:16 
Fair enough, just figured I'd confirm so as not to change it then forget and assume the mod broke again later.