Project Zomboid
82 คะแนน
JB Max Capacity Override
2
   
รางวัล
ชื่นชอบ
ชื่นชอบแล้ว
เลิกชื่นชอบ
ขนาดไฟล์
โพสต์
อัปเดต
572.128 KB
25 มี.ค. @ 4: 36pm
31 ก.ค. @ 6: 14pm
12 หมายเหตุการเปลี่ยนแปลง ( ดู )
คำอธิบาย
Pure Lua Max Capacity Override (v1.1)
🚀 Now with 98.355% less jank!

Compatible ONLY with Build 42 — does NOT work with Build 41.



📝 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)



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.



Requires Starlit Library by albion for correct tooltip capacity display.



🆕 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 likes and awards on Nepenthe’s workshop:
https://gtm.steamproxy.vip/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



Mod Name: JB_MaxCapacityOverride
Mod ID: 3452113500
กระดานสนทนายอดนิยม ดูทั้งหมด (1)
12
8 เม.ย. @ 12: 05pm
Players Inventory
Flexible Games
80 ความเห็น
neobenmike 15 ส.ค. @ 10: 56pm 
No worries, already got it working, thanks
jbdiablo  [ผู้สร้าง] 15 ส.ค. @ 8: 33pm 
@neobenmike - which version of 42 are you running?
neobenmike 15 ส.ค. @ 6: 11pm 
Can't enable mod due to requirement typo: \StarlitLibrary instead of just StarlitLibrary
jbdiablo  [ผู้สร้าง] 31 ก.ค. @ 10: 58am 
Re-uploaded the mod data enhancement. See description on how to use it and the limitations.

Thank you Eizen for the inspiration and testing!
jbdiablo  [ผู้สร้าง] 30 ก.ค. @ 7: 57am 
no worries, go ahead and hit me up on discord @jimbeamdiablo
Eizen 30 ก.ค. @ 4: 16am 
@jbdiablo thank you for all the help. I managed to solve my issue except when equipping the backpack the capacity reverts back. Can I message you in discord? Btw I saw the thread in the discord link that you gave me. I'm really sorry for the clutter that I made in your comment section
jbdiablo  [ผู้สร้าง] 29 ก.ค. @ 5: 05pm 
I broke it. Reverting until I can figure it out
jbdiablo  [ผู้สร้าง] 29 ก.ค. @ 2: 56pm 
Added a mod data capacity override for single containers. To use:

yourContainer:getModData()["JB_MaxCapacityOverride"] = { capacity = 75 }

It still checks if your container type is in the lookup table first. Let me know if there are any issues with it. Cheers!
jbdiablo  [ผู้สร้าง] 29 ก.ค. @ 12: 13pm 
@Eizen - I don't know what you're cooking but I tested and mod data was persistent on the item. I'll mess around with my code in a bit to check for mod data when patching capacities.
jbdiablo  [ผู้สร้าง] 29 ก.ค. @ 11: 34am 
I was trying to find a work around to preserve mod data, because that's messed up.