Project Zomboid

Project Zomboid

Sensible Balance: Food and Drink, Nutrition, and Water Weight
22 Comments
Scroobles McDoodle 5 Jul @ 5:55am 
Using this mod in conjunction with Eris Food Expiry.

Because of the tweaks to Lard that you've done, namely giving it an expiration, causes the calculations done by Eris' mod to bug the fuck out and display a "Rots in" value of like...27 billion years or something ridiculous like that. Straight up crashed my game a few times.

I know it's a mod incompatibility and all, but I wanted to at least bring it to your attention.
EtherealAvian 14 Aug, 2024 @ 11:27am 
I can say the mod works correctly now. Thank You so much for trying to fix this issue. :steamthumbsup:
unlockk  [author] 7 Aug, 2024 @ 9:31am 
1.3

Fix for the failure to find ItemTweaker_Core.

The game has code in three folders: client, shared, and server. Shared folder executes code both for client and server. It seems that once I restructured the mod to use the shared folder, the game could not find the Item Tweaker API as it was within the "client" folder, even if it was its own mod.

Installing Better Sorting fixed the issue and allowed the game and mod to function as it contained a copy of ItemTweaker_Core in its own shared lua folder. I have now done the same, the mod now includes ItemTweaker functionality on its own.
unlockk  [author] 4 Aug, 2024 @ 1:11am 
Hmm, that is a bit bizarre. Since you say it happens with all of the sensible tweak mods, and I checked line #16 in your error is thrown at "TweakItem(" " part of the code, it leads me to believe the ItemTweaker is somehow not recognised properly.

My suggestions are:

1. Use Mod Loader mod and Mod Loader Load Order plugin mod, sort your mods to make sure the item tweaker is somewhere near the top of your mod load order and all of my mods below.

2. Make sure that not only the item tweaker was enabled in the main menu/mods, but for your savegame as well.

3. Unsubscribe from ItemTweaker, then open the game, this will delete the mod, then quit and resubscribe to ItemTweaker.

4. Download Better Sorting: it uses its own ItemTweaker except it is copied into the mod so you don't have to download it. My mod won't recognise it, but the point is, see if the error gets thrown at Better Sorting and your java is glitching out somehow or whatnot...
EtherealAvian 3 Aug, 2024 @ 5:18pm 
And yes, I do have the Item Tweaker API installed. Even played with no mods other than "Sensibles" and those mods nessesary to run it. Still getting errors. No idea what's causing it.
EtherealAvian 3 Aug, 2024 @ 5:13pm 
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:391)
at zombie.GameWindow.init(GameWindow.java:1206)
at zombie.GameWindow.mainThreadInit(GameWindow.java:576)
at zombie.GameWindow.mainThread(GameWindow.java:489)
at java.base/java.lang.Thread.run(Unknown Source)
EtherealAvian 3 Aug, 2024 @ 5:13pm 
`function: sensiblebalancefoodmodcomphl.lua -- file: sensiblebalancefoodmodcomphl.lua line # 16 | MOD: Sensible Balance: Food and Nutrition
java.lang.RuntimeException: Object tried to call nil in sensiblebalancefoodmodcomphl.lua
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
EtherealAvian 3 Aug, 2024 @ 5:12pm 
There's a bug I seem to be the only one to encounter,with the mod not working at all.

Same happens with other "Sensible" mods.
Gebirgsjäger 3 Aug, 2024 @ 12:23pm 
Mod works great btw! I appreciate your work!
Gebirgsjäger 3 Aug, 2024 @ 12:23pm 
Yeah as a matter of fact I already subbed that mod too. I used to host DayZ and while it took an overwhelming amount of time to redo it all from scratch (which I did) it was so easy to have a file that you could directly change each individual items loot chance (thousands of lines) or add new modded items accordingly finding the classnames in the mod menus. I wish the same could be said about PZ.

Especially when you want items to be special or rare because the loot is the heart and core feature of the game.
unlockk  [author] 3 Aug, 2024 @ 1:41am 
If I add a 10 chance to "Base.Salt" for the typical house kitchen, it does not mean 10% extra chance of spawning. Each loot table rolls 4 times typically, on common settings that might mean actual 10% * 4 = 40%, but on insanely low loot it may mean 1.5% * 4 or something, and then it depends on area. Mods add their own chances if they want their items to spawn, so its like an additional chance to spawn rather than something that will spawn in place of another object, vanilla or otherwise, though adding an object into the list will probably shift the weighing slightly.

There are ways to completely replace a loot table with another, which will definitely conflict with things, but my mods simply insert extra lines which does not overwrite anything. An example that I can think of is Loot Table Fixes https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3033301901 , it evidently replaces existing attributes as it corrects the spelling of existing loot tables, and so on.
unlockk  [author] 3 Aug, 2024 @ 1:40am 
The loot tables do take a very long time, and the spawn chances are influenced by the weighing of the entire table + the population density of zombies. I have tried to rework the entire loot table for other things as I was doing the food spawns in my Item Weights and Miscellaneous Spawns mod if you wanna have a look.

In debug cheats menu there's "LootZed", you can right click on any nearby container icon in the drop down menu and click see loot table or reroll, so one can balance mods during testing. From my experience items saved as "Base." (which a lot of mods do, but some of the big ones do not) seem to be more influenced by the custom settings than those that aren't - idk why. I may be wrong though.
Gebirgsjäger 2 Aug, 2024 @ 10:36am 
These seem like things I would do if I knew how to mod. In this realistic rework, is it possible to rework an entire loot table to be more realistic as well, and do so with consideration of mods like britas and such?

Nice work btw. I'll try this out and see how she goes.
unlockk  [author] 1 Aug, 2024 @ 2:19pm 
Oh I see. In the recent update (28th Jul) I moved the scripts from "client" to the "shared" folder so that they also get executed server-side, I think this will have fixed those issues. Also the cookies have had their values rebalanced in the recent update, too. I hope you'll have it consistent from now on.
Scroobles McDoodle 1 Aug, 2024 @ 8:43am 
No, not foraging. Just been finding peanuts on corpses due to the "Mads Zombie Loot" mod, and noticed that the amount of thirst is different. Also seems to apply to not only peanuts, but also beef jerky as well. Also noticed that sometimes I find cookies that deduct thirst (as they now should) and sometimes find cookies that don't deduct thirst.

Also, wasn't an existing save. Fresh save on a MP server.
unlockk  [author] 1 Aug, 2024 @ 6:24am 
Are you foraging for peanuts? The foraged items vary in weight/size and so their nutrition values/hunger reduction. The +4 thirst is in the code for a -12 hunger, 0.2 weight portion. If you find the peanuts in e.g. people's houses they will always spawn as -12, 0.2 weight.

If you have installed the mod upon an existing save, then items may have generated in nearby areas out of sight before you looted them (maybe 250 tiles/500 tile radius or so?). I cannot edit items that have already been generated by the game.
Scroobles McDoodle 1 Aug, 2024 @ 4:23am 
Hey unlockk, I love the concept of this mod and I greatly appreciate you filling in some blanks as far as vanilla item stats go! I gotta let you know though, sometimes it's a bit...inconsistent. So like, peanuts for example. They add thirst. Cool, makes sense. However not every peanut adds thirst, and they all add a varied amount, sometimes it's +1, sometimes it's +4. Just a little thing that I thought I'd bring to your attention. Otherwise, fantastic mod! Keep up the brilliant work!
unlockk  [author] 26 Jul, 2024 @ 4:35am 
Thank you for your comments. In version 1.1 I have now covered every single item in the vanilla game.
UtterlyFlabbergasted 20 Jul, 2024 @ 12:39am 
Water weight
⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻
⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢺
⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠆⠜
⣿⣿⣿⣿⠿⠿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻
⣿⣿⡏⠁⠀⠀⠀⠀⠀⣀⣠⣤⣤⣶⣶⣶⣶⣶⣦⣤⡄⠀⠀⠀⠀⢀⣴
⣿⣿⣷⣄⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⡧⠇⢀⣤⣶
⣿⣿⣿⣿⣿⣿⣾⣮⣭⣿⡻⣽⣒⠀⣤⣜⣭⠐⢐⣒⠢⢰
⣿⣿⣿⣿⣿⣿⣿⣏⣿⣿⣿⣿⣿⣿⡟⣾⣿⠂⢈⢿⣷⣞
⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣷⣶⣾⡿⠿⣿⠗⠈⢻⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠻⠋⠉⠑⠀⠀⢘⢻
⣿⣿⣿⣿⣿⣿⣿⡿⠟⢹⣿⣿⡇⢀⣶⣶⠴⠶⠀⠀⢽
⣿⣿⣿⣿⣿⣿⡿⠀⠀⢸⣿⣿⠀⠀⠣⠀⠀⠀⠀⠀⡟⢿
⣿⣿⣿⡿⠟⠋⠀⠀⠀⠀⠹⣿⣧⣀⠀⠀⠀⠀⡀⣴⠁⢘⡙
⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⠗⠂⠄⠀⣴⡟⠀⠀⡃
rawgu 15 Jul, 2024 @ 8:07am 
now this is S tier mod
Harkness 15 Jul, 2024 @ 5:25am 
Great mods man thanks for doing these
al 13 Jul, 2024 @ 1:32am 
Great mod, really brings the nutritional value to the table.