Project Zomboid

Project Zomboid

JB Max Capacity Override
104 kommentarer
魔法 5. okt. kl. 18:50 
大佬我改好了,我本地吧代码改了,谢谢大佬给代码,不报错了
jbdiablo  [ophavsmand] 5. okt. kl. 9:29 
@魔法 - that's not my mod, how am I supposed to change it?
魔法 4. okt. kl. 19:58 
G:\steam\steamapps\workshop\content\108600\3369211813\mods\PZFateMagicTraits 圣杯魔术\42\media\lua\client,大佬是不是改这个里面的第186行代码为您发的就可以了吗
jbdiablo  [ophavsmand] 4. okt. kl. 16:18 
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  [ophavsmand] 4. okt. kl. 16:16 
@魔法 - my code is working fine. their code is not working fine.
魔法 3. okt. kl. 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  [ophavsmand] 2. okt. kl. 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  [ophavsmand] 2. okt. kl. 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. okt. kl. 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. sep. kl. 19:15 
Спасибо большое
jbdiablo  [ophavsmand] 27. sep. kl. 11:49 
@galkinzhenia it still works on my end
galkinzhenia 25. sep. kl. 21:45 
Проверте на совместимость 42.12
jbdiablo  [ophavsmand] 21. sep. kl. 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 21. sep. kl. 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  [ophavsmand] 21. sep. kl. 11:57 
@UnDeadPuff can you show me your modified code? I don't see anything that should cause an array out of bounds
UnDeadPuff 21. sep. kl. 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  [ophavsmand] 14. sep. kl. 13: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 14. sep. kl. 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 6. sep. kl. 22: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  [ophavsmand] 5. sep. kl. 19:26 
Added logic so y'all can 'place' your giant bags almost anywhere, Cheers!
Achille12345 1. sep. kl. 5:24 
I'm using steam version yeah.
jbdiablo  [ophavsmand] 31. aug. kl. 10:58 
actually, the creator of Starlit had the idea, I'm just asking it.
jbdiablo  [ophavsmand] 31. aug. kl. 10:58 
@Achille12345 I just had a thought - are you using this mod without steam or with the -nosteam option?
Achille12345 31. aug. kl. 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 15. aug. kl. 22:56 
No worries, already got it working, thanks
jbdiablo  [ophavsmand] 15. aug. kl. 20:33 
@neobenmike - which version of 42 are you running?
neobenmike 15. aug. kl. 18:11 
Can't enable mod due to requirement typo: \StarlitLibrary instead of just StarlitLibrary
jbdiablo  [ophavsmand] 31. juli kl. 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  [ophavsmand] 30. juli kl. 7:57 
no worries, go ahead and hit me up on discord @jimbeamdiablo
Eizen 30. juli kl. 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  [ophavsmand] 29. juli kl. 17:05 
I broke it. Reverting until I can figure it out
jbdiablo  [ophavsmand] 29. juli kl. 14: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  [ophavsmand] 29. juli kl. 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  [ophavsmand] 29. juli kl. 11:34 
I was trying to find a work around to preserve mod data, because that's messed up.
Eizen 29. juli kl. 11:23 
Damn, alright. I'm currently working on a solution that I theorized
jbdiablo  [ophavsmand] 29. juli kl. 10:46 
or not - "if your backpack has context menu wear options, it will nuke all the mod data on switch"
jbdiablo  [ophavsmand] 29. juli kl. 9:58 
@Eizen - I think the consensus is that mod data would be the way to go
jbdiablo  [ophavsmand] 29. juli kl. 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 29. juli kl. 9:22 
Yes, I've tried that but the type reverts back to original when you relog :(
jbdiablo  [ophavsmand] 29. juli kl. 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 29. juli kl. 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  [ophavsmand] 29. juli kl. 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 29. juli kl. 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  [ophavsmand] 26. juni kl. 8:09 
@Briar Feet require=\StarlitLibrary is correct for B42
Matikanetannhauser 25. juni kl. 18: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  [ophavsmand] 16. juni kl. 16: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 16. juni kl. 15:30 
im using it on b41
Vengent 16. juni kl. 15: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  [ophavsmand] 16. juni kl. 14: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 ~ 14. juni kl. 19:51 
same problem as person below