Project Zomboid

Project Zomboid

95 个评价
JB Max Capacity Override
2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
570.611 KB
3 月 25 日 下午 4:36
9 月 5 日 下午 7:24
13 项改动说明 ( 查看 )

订阅以下载
JB Max Capacity Override

描述
Pure Lua Max Capacity Override (v1.1)
Now with 98.355% less jank!
Compatible ONLY with Build 42 — does NOT work with Build 41.



If you're here from Customizable Containers
Dane's mod uses a custom implementation of this mod.
This mod works fine(so far) in B42.12




Requires Starlit Library by albion for correct tooltip capacity display.
Regarding the "require=\StarlitLibrary" line in the mod.info: As of Build 42, the backslash is required. https://pzwiki.net/wiki/Mod.info



This mod does nothing on its own. It’s intended for your friendly neighborhood modder.



Summary
This mod provides a pure Lua MAX_CAPACITY override without needing any Java mod installations. It works on:
  • "Equipable" Bags
  • Crates / Containers
  • Truck beds / Trunks
  • Sprite containers (with some limitations)



07/31/25
Re-added mod data override for single containers. Example usage:
yourContainer:getModData()["JB_MaxCapacityOverride"] = { capacity = 75 }

- Works if the container type exists in the lookup table
- Compatible with bags and sprite containers
- Mod data override not yet compatible with trunks (WIP)



Current To-Do List
  • [ ] Add equipped weight override
  • [ ] Handle right-click grab bug
  • [ ] Consider player inventory capacity override (probably not)
  • [ ] Fix transfer times for heavy items in world context (borked right now)



Side note: The World Object Context Menu can eat me.



Performance Boost
Includes Nepenthe's speed fix from Remove Bag Slowdown (used with permission).

Drop some likes and awards on Nepenthe’s workshop:
https://psteamcommunity.yuanyoumao.com/id/drstalker/myworkshopfiles/

This fix does NOT bypass the “Heavy Load” moodle slowdown.



Argument Structure (for addContainer)
("type", capacity, preventNesting, _equippedWeight, _transferTimeSpeed)

type | string | Container type (use getType() to find it)
capacity | number | Max weight container can hold
preventNesting | boolean | Prevents nesting same type containers
_equippedWeight | number | (optional) Weight of equipped container
_transferTimeSpeed | number | (optional) Transfer time override

Error checking included for capacity and preventNesting.
Equipped weight and transfer speed are optional — defaults to nil.

How To Use
[ ] Create a new Lua file
[ ] Add and customize the following code:

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")

JB_MaxCapacityOverride.addContainer("Bag_ShotgunDblSawnoffBag", 125, true, nil, 30)
JB_MaxCapacityOverride.addContainer("militarycrate", 180, true)
JB_MaxCapacityOverride.addContainer("TruckBedOpen", 500, false)

[ ] Add to your mod.info: require=\JB_MaxCapacityOverride

[ ] Upload to the workshop



Found a bug? No you didn't. Really? Aight, report it here please:
https://github.com/mikej1977/JB_MaxCapacityOverride




Workshop ID: 3452113500
Mod ID: JB_MaxCapacityOverride
热门讨论 查看全部(1)
15
9 月 9 日 上午 9:49
Players Inventory
Flexible Games
101 条留言
jbdiablo  [作者] 2 小时以前 
I just looked. They are calling functions that do not exist.

line 186 in their mod:
weapon:setCritDmgMultiplier(weapon:getCritDmgMultiplier() * 2)

it should be:
weapon:setCriticalDamageMultiplier(weapon:getCriticalDamageMultiplier() * 2)
jbdiablo  [作者] 2 小时以前 
@魔法 - my code is working fine. their code is not working fine.
魔法 19 小时以前 
function: PZFateMagicExtraShooter -- file: PZFateMagic.lua line # 186 | MOD: PZFateMagicTraits 圣杯魔术
Callframe at: setPrimaryHandItem
function: complete -- file: ISEquipWeaponAction.lua line # 211 | Vanilla
function: complete -- file: JB_MaxCapacityOverride.lua line # 298 | MOD: JB Max Capacity Override

LOG : Lua f:240, t:1759558775127> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
jbdiablo  [作者] 10 月 2 日 下午 4:36 
CC overrides the same functions I do. I'll look in to getting some compatibility in there or maybe shoot him a message and see if he's thought about it since CC has hella more subs than mine
jbdiablo  [作者] 10 月 2 日 下午 4:31 
@Scadrian Street Rat no idea since I've never looked at his code. I'll poke my head in there and have a looksee, tho
Scadrian Street Rat 10 月 2 日 下午 3:29 
Quick question, because you said CC uses a custom implementation of your mod. Do the two mods interfere with each other? Ocassionally on load with both active, certain containers will default to 49 max capacity, and be fully unable to be upgraded, and I'm uncertain if the conflict comes from the similarities between this mod and what is implemented in CC, or if it's a problem related to the bag upgrades?
galkinzhenia 9 月 27 日 下午 7:15 
Спасибо большое
jbdiablo  [作者] 9 月 27 日 上午 11:49 
@galkinzhenia it still works on my end
galkinzhenia 9 月 25 日 下午 9:45 
Проверте на совместимость 42.12
jbdiablo  [作者] 9 月 21 日 下午 12:21 
I'm testing with:

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")
JB_MaxCapacityOverride.addContainer("ChuwuRing", 1000, true, nil, 1)

It's working as expected. Ring has 1000 capacity, I can't put another ring in the ring container and transfer speed in instant.

Also, I'm not sure what StoreageBag01, 02 etc is. That's not part of either mod or vanilla.

You can hit me up on discord, jimbeamdiablo if you want to go over your code