Project Zomboid

Project Zomboid

119 ratings
JB Max Capacity Override
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
577.203 KB
Mar 25 @ 4:36pm
Nov 20 @ 2:43pm
18 Change Notes ( view )

Subscribe to download
JB Max Capacity Override

Description
Pure Lua Max Capacity Override (v2.3)
Now with 99.69% less jank!
Compatible ONLY with Build 42 — does NOT work with Build 41.



If you're here from Customizable Containers
That mod uses a custom implementation of JB Max Capacity Override.
On it's own, JB Max Capacity Override works fine on 42.12



Dear Players, I've added some patches for CC, SOTO and True Smoking but in the end, we're all trying to muck with the same core functions. This means that this mod may not work as expected when any of those mods are active.

Dear Modders, I've added a late load to my functions that defers to the mods above if they're active. If I'm stepping on your toes, let me know and I'll get a patch in here to play nice.



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
  • [ ] 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://steamcommunity.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
Popular Discussions View All (2)
4
Nov 12 @ 1:33am
Can't use place item with +50 encumbrance bag
DarkzKnight
15
Sep 9 @ 9:49am
Players Inventory
Flexible Games
130 Comments
jbdiablo  [author] Nov 23 @ 11:38am 
@reguero01 - Nothing particular to this mod, but SimKDT has some good videos to get started with PZ modding:
https://www.youtube.com/watch?v=FGbyLGLmxes&list=PL91PT-Vd7Vhp_eBA8pE4hCXPcrxHWgr_E&pp=0gcJCbAEOCosWNin

I also have a template for this mod that's very basic: https://steamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3595466063
reguero01 Nov 23 @ 2:55am 
não tem um video tutorial pra um burrinho como eu conseguir usar esse mod? :)
jbdiablo  [author] Nov 20 @ 2:45pm 
Added a check for CleanUI so I don't break it again. If y'all come across anything else, let me know. Cheers!
Blue Nov 20 @ 2:01pm 
cool thanks for the quick response you're the real mvp
jbdiablo  [author] Nov 20 @ 1:58pm 
@Blue - I appreciate the report! I'll rip it out until we can figure out what that issue is.
Blue Nov 20 @ 1:44pm 
the new weight display has caused both the player and container panes all white bars, and capacity appears floating off to the left of where it should be. Compatibility issue with CleanUI?
jbdiablo  [author] Nov 20 @ 10:09am 
Updated: Add per vehicle trunk/truck bed capacity. Prettier weight display on the inventory pane c/o Black Moons (thanks!)
jbdiablo  [author] Nov 19 @ 8:17am 
@Black_moons I'll look later today. I forgot all about it. LOOK! A SQUIRREL
Black_moons Nov 18 @ 11:52pm 
Looking forward to support for overriding individual vehicle types trunk size. (Via modData on the individual trunks perhaps?)
jbdiablo  [author] Nov 7 @ 8:51am 
@PANZER - with mod data you can. I haven't rewritten for it yet so it's a little convoluted.

1st add it to the container list as normal and set the capacity to something reasonable or vanilla.
You'll then need to hook in to something to "get" your container and then you can:
yourContainer:getModData()["JB_MaxCapacityOverride"] = { capacity = 20 }

That sets capacity individually, so you need to do it for every container you want to target. It's mainly there for "upgrading" like bags and such but no reason you can't use it to set capacity ona small freezer.