Project Zomboid

Project Zomboid

95 ratings
JB Max Capacity Override
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
570.611 KB
Mar 25 @ 4:36pm
Sep 5 @ 7:24pm
13 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
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
Popular Discussions View All (1)
15
Sep 9 @ 9:49am
Players Inventory
Flexible Games
98 Comments
jbdiablo  [author] 15 hours ago 
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  [author] 15 hours ago 
@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 16 hours ago 
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 Sep 27 @ 7:15pm 
Спасибо большое
jbdiablo  [author] Sep 27 @ 11:49am 
@galkinzhenia it still works on my end
galkinzhenia Sep 25 @ 9:45pm 
Проверте на совместимость 42.12
jbdiablo  [author] Sep 21 @ 12:21pm 
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
UnDeadPuff Sep 21 @ 12:05pm 
local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")

JB_MaxCapacityOverride.addContainer("StorageBag01", 1000, true, nil, 1)
JB_MaxCapacityOverride.addContainer("StorageBag02", 500, true, nil, 1)
JB_MaxCapacityOverride.addContainer("StorageBag03", 250, true, nil, 1)
JB_MaxCapacityOverride.addContainer("StorageBag04", 250, true, nil, 1)


The only modifications I made to the other mod was to add one more bag and change the names around.
jbdiablo  [author] Sep 21 @ 11:57am 
@UnDeadPuff can you show me your modified code? I don't see anything that should cause an array out of bounds
UnDeadPuff Sep 21 @ 11:11am 
Hello. I'm getting these errors [pastebin.com] when loading only your mod and a personalized version of this mod to which I added your mod's utility.Sometimes the errors make it so one or more of the bags disappear, which is obv not ideal. Any suggestions or are they just not compatible?