Project Zomboid

Project Zomboid

JB Max Capacity Override
98 条留言
jbdiablo  [作者] 20 小时以前 
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  [作者] 20 小时以前 
@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 21 小时以前 
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 9 月 27 日 下午 7:15 
Спасибо большое
jbdiablo  [作者] 9 月 27 日 上午 11:49 
@galkinzhenia it still works on my end
galkinzhenia 9 月 25 日 下午 9:45 
Проверте на совместимость 42.12
jbdiablo  [作者] 9 月 21 日 下午 12:21 
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 9 月 21 日 下午 12:05 
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  [作者] 9 月 21 日 上午 11:57 
@UnDeadPuff can you show me your modified code? I don't see anything that should cause an array out of bounds
UnDeadPuff 9 月 21 日 上午 11:11 
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  [作者] 9 月 14 日 下午 1:11 
@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 9 月 14 日 上午 11:10 
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 9 月 6 日 下午 10:55 
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  [作者] 9 月 5 日 下午 7:26 
Added logic so y'all can 'place' your giant bags almost anywhere, Cheers!
Achille12345 9 月 1 日 上午 5:24 
I'm using steam version yeah.
jbdiablo  [作者] 8 月 31 日 上午 10:58 
actually, the creator of Starlit had the idea, I'm just asking it.
jbdiablo  [作者] 8 月 31 日 上午 10:58 
@Achille12345 I just had a thought - are you using this mod without steam or with the -nosteam option?
Achille12345 8 月 31 日 上午 3:38 
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 8 月 15 日 下午 10:56 
No worries, already got it working, thanks
jbdiablo  [作者] 8 月 15 日 下午 8:33 
@neobenmike - which version of 42 are you running?
neobenmike 8 月 15 日 下午 6:11 
Can't enable mod due to requirement typo: \StarlitLibrary instead of just StarlitLibrary
jbdiablo  [作者] 7 月 31 日 上午 10:58 
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  [作者] 7 月 30 日 上午 7:57 
no worries, go ahead and hit me up on discord @jimbeamdiablo
Eizen 7 月 30 日 上午 4:16 
@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  [作者] 7 月 29 日 下午 5:05 
I broke it. Reverting until I can figure it out
jbdiablo  [作者] 7 月 29 日 下午 2:56 
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  [作者] 7 月 29 日 下午 12:13 
@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  [作者] 7 月 29 日 上午 11:34 
I was trying to find a work around to preserve mod data, because that's messed up.
Eizen 7 月 29 日 上午 11:23 
Damn, alright. I'm currently working on a solution that I theorized
jbdiablo  [作者] 7 月 29 日 上午 10:46 
or not - "if your backpack has context menu wear options, it will nuke all the mod data on switch"
jbdiablo  [作者] 7 月 29 日 上午 9:58 
@Eizen - I think the consensus is that mod data would be the way to go
jbdiablo  [作者] 7 月 29 日 上午 9:52 
@Eizen - I asked about this in the PZ mod_development discord and the answer was "Tell them to come here and ask about it" :)

https://discord.gg/theindiestone
Eizen 7 月 29 日 上午 9:22 
Yes, I've tried that but the type reverts back to original when you relog :(
jbdiablo  [作者] 7 月 29 日 上午 9:20 
@Eizen - oh yea, that's a wrench in the cog for sure. Can you setType to something unique when it's upgraded?
Eizen 7 月 29 日 上午 9:15 
Hmmm this is tricky, I have a mod that adds a functionality to upgrade a bag and increase its capacity, using JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE causes all bags to increase capacity. Maybe it's impossible for now. Anyways, thank you
jbdiablo  [作者] 7 月 29 日 上午 9:00 
@Eizen - you should be able to change the value for the container in the lookup table, like:

JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE["Bag_ShotgunDblSawnoffBag"].capacity = 100

it works in my head anyway, I haven't tried it.
Eizen 7 月 29 日 上午 2:55 
After I called this JB_MaxCapacityOverride.addContainer("Bag_ShotgunDblSawnoffBag", 125, true) , is it not possible to programmatically change the capacity to 100? like this container:setCapacity(100)
jbdiablo  [作者] 6 月 26 日 上午 8:09 
@Briar Feet require=\StarlitLibrary is correct for B42
Matikanetannhauser 6 月 25 日 下午 6:41 
@jbdiablo the issue is about the mod requirements. On the mod.info it was written like this: require=\StarlitLibrary and the correct one should be like this: require=StarlitLibrary because that is the mod id of Starlit Library. Ty!
jbdiablo  [作者] 6 月 16 日 下午 4:18 
@Vengent thanks for the info!

@Promises this is for 42. changing capacities in 41 was so easy and didn't need any of *waves hands* this
Subway Shark 6 月 16 日 下午 3:30 
im using it on b41
Vengent 6 月 16 日 下午 3:15 
I've got it working in 42.9 with crates and some other movable containers. I'm not seeing any error about starlit currently.
jbdiablo  [作者] 6 月 16 日 下午 2:37 
@Promises @Luna - I'll do some digging tomorrow. I haven't even fired up PZ since 42.9 so something may have changed.
Luna ~ 6 月 14 日 下午 7:51 
same problem as person below
Subway Shark 6 月 14 日 下午 7:25 
i have starlit library but in the mod menu it wont let me enable this because it says i dont have the library
jbdiablo  [作者] 6 月 9 日 上午 10:36 
@Vengent I believe "crate" is the type you need"

-- Only using (containerType, capacity, preventNesting)
local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")
JB_MaxCapacityOverride.addContainer("crate", 500, false)
Vengent 6 月 6 日 下午 6:06 
Hey JB, any chance of adding some samples for using this with containers like crates? Found a good one for character bags, but nothing for container existing in the world.
Flexible Games 5 月 27 日 下午 7:32 
I was hoping for some built-in flag or something that skips inventory as mass, but I should have known better with this game.
jbdiablo  [作者] 5 月 27 日 下午 3:54 
If you want to dig around in the CarController java, there might be a work-around without too much fuss. Like changing the vehicle mass in the vehicle script, maybe.
Flexible Games 5 月 27 日 下午 1:29 
I can confirm that a trailer with over ~1800 weight does not move. Got it set to 20k, put about 2400 in planks and logs into it, would not budge. I could back it up, funny enough, but going forward it was like it was anchored to the ground. Had to empty it down to about 1800 for it to work.