Project Zomboid

Project Zomboid

JB Max Capacity Override
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.
明明灭灭 15 Oct @ 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

`
明明灭灭 15 Oct @ 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).
明明灭灭 15 Oct @ 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] 14 Oct @ 6:42pm 
@Gentoo - Yo, thanks for the heads up! I'll get a fix in here in a day or two.
Gentoo 14 Oct @ 3:37pm 
The Dexterous trait conflicts with the SOTO mod.

Just a warning.
魔法 5 Oct @ 6:50pm 
大佬我改好了,我本地吧代码改了,谢谢大佬给代码,不报错了
jbdiablo  [author] 5 Oct @ 9:29am 
@魔法 - that's not my mod, how am I supposed to change it?
魔法 4 Oct @ 7:58pm 
G:\steam\steamapps\workshop\content\108600\3369211813\mods\PZFateMagicTraits 圣杯魔术\42\media\lua\client,大佬是不是改这个里面的第186行代码为您发的就可以了吗
jbdiablo  [author] 4 Oct @ 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] 4 Oct @ 4:16pm 
@魔法 - my code is working fine. their code is not working fine.
魔法 3 Oct @ 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] 2 Oct @ 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] 2 Oct @ 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 2 Oct @ 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 27 Sep @ 7:15pm 
Спасибо большое
jbdiablo  [author] 27 Sep @ 11:49am 
@galkinzhenia it still works on my end
galkinzhenia 25 Sep @ 9:45pm 
Проверте на совместимость 42.12
jbdiablo  [author] 21 Sep @ 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 21 Sep @ 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] 21 Sep @ 11:57am 
@UnDeadPuff can you show me your modified code? I don't see anything that should cause an array out of bounds
UnDeadPuff 21 Sep @ 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] 14 Sep @ 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 14 Sep @ 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 6 Sep @ 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] 5 Sep @ 7:26pm 
Added logic so y'all can 'place' your giant bags almost anywhere, Cheers!
Achille12345 1 Sep @ 5:24am 
I'm using steam version yeah.
jbdiablo  [author] 31 Aug @ 10:58am 
actually, the creator of Starlit had the idea, I'm just asking it.
jbdiablo  [author] 31 Aug @ 10:58am 
@Achille12345 I just had a thought - are you using this mod without steam or with the -nosteam option?
Achille12345 31 Aug @ 3:38am 
Yeah there was an typo or something in the mod.info file requirement \StarlitLibrary I changed it to StarlitLibrary and now I can activate the mod.
neobenmike 15 Aug @ 10:56pm 
No worries, already got it working, thanks
jbdiablo  [author] 15 Aug @ 8:33pm 
@neobenmike - which version of 42 are you running?
neobenmike 15 Aug @ 6:11pm 
Can't enable mod due to requirement typo: \StarlitLibrary instead of just StarlitLibrary
jbdiablo  [author] 31 Jul @ 10:58am 
Re-uploaded the mod data enhancement. See description on how to use it and the limitations.

Thank you Eizen for the inspiration and testing!
jbdiablo  [author] 30 Jul @ 7:57am 
no worries, go ahead and hit me up on discord @jimbeamdiablo
Eizen 30 Jul @ 4:16am 
@jbdiablo thank you for all the help. I managed to solve my issue except when equipping the backpack the capacity reverts back. Can I message you in discord? Btw I saw the thread in the discord link that you gave me. I'm really sorry for the clutter that I made in your comment section
jbdiablo  [author] 29 Jul @ 5:05pm 
I broke it. Reverting until I can figure it out
jbdiablo  [author] 29 Jul @ 2:56pm 
Added a mod data capacity override for single containers. To use:

yourContainer:getModData()["JB_MaxCapacityOverride"] = { capacity = 75 }

It still checks if your container type is in the lookup table first. Let me know if there are any issues with it. Cheers!
jbdiablo  [author] 29 Jul @ 12:13pm 
@Eizen - I don't know what you're cooking but I tested and mod data was persistent on the item. I'll mess around with my code in a bit to check for mod data when patching capacities.
jbdiablo  [author] 29 Jul @ 11:34am 
I was trying to find a work around to preserve mod data, because that's messed up.
Eizen 29 Jul @ 11:23am 
Damn, alright. I'm currently working on a solution that I theorized