Project Zomboid

Project Zomboid

96 oy
JB Max Capacity Override
2
   
Ödül
Favorilere Ekle
Favorilere Eklendi
Favorilerden Çıkar
Dosya Boyutu
Gönderilme
Güncellenme
570.611 KB
25 Mar @ 16:36
5 Eyl @ 19:24
13 Değişiklik Notu ( görüntüle )

İndirmek için abone ol
JB Max Capacity Override

Açıklama
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
Popüler Tartışmalar Tümünü Görüntüle (1)
15
9 Eyl @ 9:49
Players Inventory
Flexible Games
103 Yorum
jbdiablo  [yaratıcı] 5 saat önce 
@魔法 - that's not my mod, how am I supposed to change it?
魔法 18 saat önce 
G:\steam\steamapps\workshop\content\108600\3369211813\mods\PZFateMagicTraits 圣杯魔术\42\media\lua\client,大佬是不是改这个里面的第186行代码为您发的就可以了吗
jbdiablo  [yaratıcı] 22 saat önce 
I just looked. They are calling functions that do not exist.

line 186 in their mod:
weapon:setCritDmgMultiplier(weapon:getCritDmgMultiplier() * 2)

it should be:
weapon:setCriticalDamageMultiplier(weapon:getCriticalDamageMultiplier() * 2)
jbdiablo  [yaratıcı] 22 saat önce 
@魔法 - my code is working fine. their code is not working fine.
魔法 3 Eki @ 23:22 
function: PZFateMagicExtraShooter -- file: PZFateMagic.lua line # 186 | MOD: PZFateMagicTraits 圣杯魔术
Callframe at: setPrimaryHandItem
function: complete -- file: ISEquipWeaponAction.lua line # 211 | Vanilla
function: complete -- file: JB_MaxCapacityOverride.lua line # 298 | MOD: JB Max Capacity Override

LOG : Lua f:240, t:1759558775127> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
LOG : Lua f:240, t:1759558775128> 100
jbdiablo  [yaratıcı] 2 Eki @ 16:36 
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  [yaratıcı] 2 Eki @ 16:31 
@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 2 Eki @ 15:29 
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 27 Eyl @ 19:15 
Спасибо большое
jbdiablo  [yaratıcı] 27 Eyl @ 11:49 
@galkinzhenia it still works on my end