Project Zomboid

Project Zomboid

JB Max Capacity Override
131 Comments
jbdiablo  [author] 13 hours ago 
so everyone here knows - this mod depends on overriding core java functions to work as intended, I doubt it will ever work properly in MP. Sorry for the bad news y'all. Cheers!
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.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.
PANZER Nov 7 @ 1:27am 
Is there a way to target specific containers like the different types of freezers? My mini fridge now has a 80 capacity storage for its freezer lol. Was just trying to adjust the chest freezers
PANZER Oct 28 @ 5:01pm 
Thank you buddy!
jbdiablo  [author] Oct 28 @ 4:50pm 
@PANZER - I uploaded a template for this mod. Hope it helps ya!

https://steamcommunity.com/sharedfiles/filedetails/?id=3595466063
jbdiablo  [author] Oct 28 @ 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 Oct 28 @ 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] Oct 28 @ 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 Oct 28 @ 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] Oct 15 @ 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] Oct 15 @ 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 Oct 15 @ 6:02am 
im assuming from what im reading this mod doesnt do anything on its own correct?
明明灭灭 Oct 15 @ 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.
明明灭灭 Oct 15 @ 4:39am 
`Callframe at: isExclusive
function: SetClothingInfo -- file: ItemInfo.lua line # 459 | MOD: More Item Information
function: SetItemInfo -- file: ItemInfo.lua line # 130 | MOD: More Item Information
function: render -- file: ItemInfo.lua line # 733 | MOD: More Item Information
function: render -- file: AAA_show_material.lua line # 75 | MOD: 界面:展示布料信息 Show Clothes Material
function: render -- file: KATTAJ1_TooltipFixer.lua line # 13 | MOD: KATTAJ1 Clothes Core
function: render -- file: Skill Recovery Journal Tooltip.lua line # 296 | MOD: Skill Recovery Journal

`
明明灭灭 Oct 15 @ 4:39am 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
明明灭灭 Oct 15 @ 4:38am 
`function: getOverrideType -- file: JB_MaxCapacityOverride.lua line # 312 | MOD: JB Max Capacity Override
function: new -- file: JB_MaxCapacityOverride.lua line # 315 | MOD: JB Max Capacity Override
function: ReturnItemToContainer -- file: ISCraftingUI.lua line # 2016 | Vanilla
function: eatItem -- file: ISInventoryPaneContextMenu.lua line # 4122 | MOD: Give Me Some Time
function: eatItem -- file: TrueSmoking.lua line # 301 | MOD: True Smoking
function: findSmokable -- file: TrueSmoking.lua line # 291 | MOD: True Smoking
function: onKeyStartPressed -- file: TrueSmoking.lua line # 339 | MOD: True Smoking
function: keyWrapper -- file: TrueSmoking.lua line # 397 | MOD: True Smoking
java.lang.RuntimeException: attempted index: getType of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1530)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:502)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:174)
jbdiablo  [author] Oct 14 @ 6:42pm 
@Gentoo - Yo, thanks for the heads up! I'll get a fix in here in a day or two.
Gentoo Oct 14 @ 3:37pm 
The Dexterous trait conflicts with the SOTO mod.

Just a warning.
魔法 Oct 5 @ 6:50pm 
大佬我改好了,我本地吧代码改了,谢谢大佬给代码,不报错了
jbdiablo  [author] Oct 5 @ 9:29am 
@魔法 - that's not my mod, how am I supposed to change it?
魔法 Oct 4 @ 7:58pm 
G:\steam\steamapps\workshop\content\108600\3369211813\mods\PZFateMagicTraits 圣杯魔术\42\media\lua\client,大佬是不是改这个里面的第186行代码为您发的就可以了吗
jbdiablo  [author] Oct 4 @ 4:18pm 
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  [author] Oct 4 @ 4:16pm 
@魔法 - my code is working fine. their code is not working fine.
魔法 Oct 3 @ 11:22pm 
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  [author] Oct 2 @ 4:36pm 
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] Oct 2 @ 4:31pm 
@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 Oct 2 @ 3:29pm 
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?
jbdiablo  [author] Sep 14 @ 1:11pm 
@Dartagne you can set individual container capacity with mod data. It does checks in getCapacity and getEffectiveCapacity. So if your item is in the container, you can set the container moddata.capacity. The container type does need to be in the override table though, otherwise it will ignore it.

local modData = item and item:getModData()["JB_MaxCapacityOverride"]
return (modData and modData.capacity) or overrideData.capacity

If I ever figure out how to animate so I can finish this other mod I'm working on, I might pivot back and change these checks to "if overridedata or modData"
Dartagne Sep 14 @ 11:10am 
Very nice! Is it possible to make it so if a specific item is in the container, then that container gets increased carry weight?
Flexible Games Sep 6 @ 10:55pm 
Love that your keeping this updated! I phase in and out of my play with PZ and hate when I return and stuff is out of date. So major kudos! One of my mods just straight up disappeared and I don't know which as the ID no longer exists.
jbdiablo  [author] Sep 5 @ 7:26pm 
Added logic so y'all can 'place' your giant bags almost anywhere, Cheers!
Achille12345 Sep 1 @ 5:24am 
I'm using steam version yeah.
jbdiablo  [author] Aug 31 @ 10:58am 
actually, the creator of Starlit had the idea, I'm just asking it.
jbdiablo  [author] Aug 31 @ 10:58am 
@Achille12345 I just had a thought - are you using this mod without steam or with the -nosteam option?