Project Zomboid

Project Zomboid

104 ratings
JB Max Capacity Override
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
571.026 KB
25 Mar @ 4:36pm
15 Oct @ 9:36am
14 Change Notes ( view )

Subscribe to download
JB Max Capacity Override

Description
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
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
  • [ ] 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://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




Workshop ID: 3452113500
Mod ID: JB_MaxCapacityOverride
Popular Discussions View All (1)
15
9 Sep @ 9:49am
Players Inventory
Flexible Games
119 Comments
PANZER 28 Oct @ 5:01pm 
Thank you buddy!
jbdiablo  [author] 28 Oct @ 4:50pm 
@PANZER - I uploaded a template for this mod. Hope it helps ya!

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3595466063
jbdiablo  [author] 28 Oct @ 4:26pm 
that's just the name of my lua file. if you have discord, hit me up there @jimbeamdiablo and we can see what we have going on
PANZER 28 Oct @ 4:22pm 
I don't have the " overrides.lua: " at the beginning no. I just copied what was in the description. Required mod from mod.info is green when I go to enable mod in game.

Will try add the line in a bit.
jbdiablo  [author] 28 Oct @ 8:39am 
@PANZER - you're sure that the JB_MaxCapacityOverride mod is active? I have that exact line in my capacity test mod and it's working.

overrides.lua:

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")
-- containerType, capacity, preventNesting, _equippedWeight, _transferTimeSpeed

JB_MaxCapacityOverride.addContainer("Bag_BreakdownBag", 125, true, 10)
JB_MaxCapacityOverride.addContainer("Bag_TrashBag", 40, false, nil, 10)
JB_MaxCapacityOverride.addContainer("militarycrate", 180, true)
JB_MaxCapacityOverride.addContainer("TruckBedOpen", 500, false)
PANZER 28 Oct @ 12:44am 
`attempted index: addContainer of non-table: null
function: Crates.lua -- file: Crates.lua line # 3 | MOD: Crates
java.lang.RuntimeException: attempted index: addContainer of non-table: null

`
Can you help me out man? just want to Increase military crates to 100 lol...only thing I have is this lua file

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")

JB_MaxCapacityOverride.addContainer("militarycrate", 100, false)
jbdiablo  [author] 15 Oct @ 9:50am 
added patches for CC, SOTO and True Smoking to defer to whichever function won the loading war

and a side note that if you have any combination of the above enabled, you will probably get some errors and/or unexpected behavior
jbdiablo  [author] 15 Oct @ 9:11am 
@明明灭灭 - there may be more going on but I'll add a patch for TrueSmoking since it's nuking the same functions as I am. The 42.12 update mucked a lot of stuff up.

@gravelle164 - correct, it just changes a whole bunch of lua functions. You'll need to add a container to the lookup table for it to do anything useful.
gravelle164 15 Oct @ 6:02am 
im assuming from what im reading this mod doesnt do anything on its own correct?
明明灭灭 15 Oct @ 4:41am 
Perhaps it's caused by a series of mod conflicts. I've been using this mod recently, and it causes errors when used together with previously added mods.