Project Zomboid

Project Zomboid

Ocen: 119
JB Max Capacity Override
2
2
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
Rozmiar pliku
Zamieszczono
Zaktualizowano
577.203 KB
25 marca o 16:36
20 listopada o 14:43
Listy zmian: 18 ( zobacz )

Zasubskrybuj, aby pobrać
JB Max Capacity Override

Opis
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
Popularne dyskusje Zobacz wszystkie (2)
4
12 listopada o 1:33
Can't use place item with +50 encumbrance bag
DarkzKnight
15
9 września o 9:49
Players Inventory
Flexible Games
Komentarzy: 130
jbdiablo  [autor] 23 listopada o 11:38 
@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 23 listopada o 2:55 
não tem um video tutorial pra um burrinho como eu conseguir usar esse mod? :)
jbdiablo  [autor] 20 listopada o 14:45 
Added a check for CleanUI so I don't break it again. If y'all come across anything else, let me know. Cheers!
Blue 20 listopada o 14:01 
cool thanks for the quick response you're the real mvp
jbdiablo  [autor] 20 listopada o 13:58 
@Blue - I appreciate the report! I'll rip it out until we can figure out what that issue is.
Blue 20 listopada o 13:44 
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  [autor] 20 listopada o 10:09 
Updated: Add per vehicle trunk/truck bed capacity. Prettier weight display on the inventory pane c/o Black Moons (thanks!)
jbdiablo  [autor] 19 listopada o 8:17 
@Black_moons I'll look later today. I forgot all about it. LOOK! A SQUIRREL
Black_moons 18 listopada o 23:52 
Looking forward to support for overriding individual vehicle types trunk size. (Via modData on the individual trunks perhaps?)
jbdiablo  [autor] 7 listopada o 8:51 
@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.