Project Zomboid

Project Zomboid

[B42] Immersive Preservation: Canning and Jarring (of evolved recipes)
51 Comments
unlockk  [author] 19 hours ago 
1.1.2
-Added the 'seasonings' tooltip to finally show what spices have been added to the food.

-Sandbox settings for days to become stale, and to spoil (default 300 and 400). Setting these values will also automatically update the vanilla in-game spawned 'Jar of (Vegetable)' since the latest patch seems to have messed up their expiry. Any modded item that uses this vanilla OnCooked canning script will also benefit from these custom sandbox settings.

-Fixed a rare instance of a pasta pot not being able to be jarred.
unlockk  [author] 13 Oct @ 7:38am 
1.1.1
-Added translations: DE, ES, FR, IT, PL, RU.
Please let me know if there are any errors, I used Google Translate, but compared with vanilla text to make sure the grammar is correct.
unlockk  [author] 10 Oct @ 7:33am 
1.1

-Verified all features to work on latest version of game (B42.12.1).
-Added compatibility to allow use of glassmaking player-created jar, Base.JarCrafted, introduced by B42.12.
-Added an optional easy version of mod, which does not require salt and vinegar to preserve food.
unlockk  [author] 9 Oct @ 12:54pm 
The features of this mod were adapted into a pressure canning version by Hiemas, which you can check out here:
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3582404497
unlockk  [author] 30 Sep @ 4:58am 
Are you on Build 41?
KitsuneBlaze 29 Sep @ 4:55pm 
I've subscribed to this mod but it is not showing up in my mods list in-game.
galkinzhenia 26 Sep @ 6:06am 
Спасибо жду обновление от Вас
unlockk  [author] 26 Sep @ 4:31am 
@galkinzhenia
Also, \media\lua\server\recipecode.lua doesn't contain any of the functions anymore, so I will see if I can track them down, however I defined my own functions for the jars so they should still work. The only thing that might be affected is the 60-90 days extended shelf life to 300-400, functions were changed from "CannedFood_OnCooked" to "RecipeCodeOnCooked.cannedFood".

Funnily enough, I don't see a recipe in-game to allow you to use the forged/crafted jar (Base.JarCrafted) to make the vanilla jar of produce (\media\scripts\generated\recipes\recipes_jarring.txt) so it seems that preservation has accidentally been made even less sustainable as you are fully reliant on finding normal jars. I am sure this will be patched when possible.
unlockk  [author] 26 Sep @ 4:30am 
@galkinzhenia
For other mods probably, I checked what I could and put a note on the other mod pages, but my game isn't even launching and I don't have time to check more today.

I will say this though - this mod may be more broken by the update than what I said on the note - the developers changed calling scripts from "OnCreate = Recipe.OnCreate." to "OnCreate = RecipeCodeOnCreate." but I think the game would recognise both commands, if it doesn't, then literally every mod that exists that adds or changes recipes would have to update, so I think they have accounted for that.
galkinzhenia 26 Sep @ 3:34am 
Другие ваши моды в порядке?
galkinzhenia 26 Sep @ 3:33am 
Жду обновление. Спасибо
unlockk  [author] 26 Sep @ 3:30am 
@galkinzhenia
Thanks, yeah I have checked the changelog and I will probably have to update the recipes to allow the crafted jar if it is now a separate item. Otherwise, everything should be fine.
galkinzhenia 25 Sep @ 9:13pm 
Проверте на совместимость 42.12
Harkness 22 Sep @ 5:15pm 
I like the idea of preserving food etc but one thing that holds the game back is the inability to make some of the things that are required in a lot of recipes (vinegar, yeast, sugar) especially on low loot runs. Great mod nonetheless and I hope you accomplish a realistic version of it. Thanks!
unlockk  [author] 21 Sep @ 4:09am 
@WRex
Very nice, thanks for checking and reporting on it all.
WRex 15 Sep @ 3:03am 
Ok, all good so far :) It hasn't happened again:steamthumbsup:
WRex 13 Sep @ 4:44am 
Thanks for checking it. It could be an edge case. I’ll keep watching how it behaves to provide a clearer way to reproduce it. It started happening after I left my base for 2–3 days
unlockk  [author] 13 Sep @ 3:40am 
@WRex

Just tried everything again, spawned a ton of pots and ingredients, make a bunch of soups and jars, left a couple uncooked, left a couple open, left a copy of each in my inventory and copies of each on the floor, teleported to a different location and fast forwarded by a whole month. When I got back everything seemed to expire as it should. I'm not convinced anything is going wrong in this mod to be fair, do you have any other food preservation mods or anything? Load this at the end of the load order, by the way.
unlockk  [author] 13 Sep @ 3:02am 
@WRex
I am using the vanilla script to extend the shelf life of jars so I am not entirely sure what could be causing this or how to fix it if the script can glitch out, at the very least I've never heard of anyone mention that jars of vegetables in vanilla glitch out. Could you please let me know if they tend to be stale after an exact amount of time, e.g. X days after making them? I have ran this mod in debug which lets you speed up time beyond what the game allows, to skip multiple days, and I've never noticed this happening. I'll double check but yeah, never seen this before.
WRex 12 Sep @ 6:26pm 
Hi, I have something for you to check :) I prepared a lot of jars of food (9 soups and 19 stews). The 'days until stale' was 273, but I noticed that after I slept, one jar became stale and its 'days until rotten' is now 100. I reproduced it a few times. The jar becomes stale randomly for no reason. Could you please take a look?
unlockk  [author] 10 Sep @ 3:16pm 
@WRex
Glad you checked and thanks for reporting this initially, and yeah opening the jar would work for others, good advice.

With regards to the jar being "raw": in vanilla, the game applies canning/shelf life extension through an OnCooked call, so yes the jar had to be set to raw and for that brief moment the hunger reduction is lower. However, if you attempt to open the jar without cooking it to preserve it (as that is the only way to use the jar e.g. to eat, to divide into bowls, to pour it out), the food returned will be the cooked contents with the right value without having to recook the jar. Hope this helps.
WRex 10 Sep @ 3:04pm 
I’ve checked it, everything works fine now - the weight of new jars is stable. If someone has already prepared a lot of jars and can’t move them because of their weight, this can be fixed by opening the crafting menu and selecting 'Open Jar', the weight will return to normal.

I also noticed something else. It’s not critical, but it could be improved. When we create a Jar of Food from a stew (or any), the jar shows all ingredients as raw, and the food value also reverts to the pre-cooked state. For example, a raw pot of stew has a food value of 139, after cooking it becomes 180. But when we create a Jar of Food, the resulting jar’s food value is 139, even though it should be 180 - because all ingredients are marked as raw again
WRex 10 Sep @ 2:26pm 
Hi, great job! Thanks for the fix and the explanation - now I can carry jars in my inventory :) well done!
unlockk  [author] 10 Sep @ 7:14am 
Note that the jars you have already created might still do this even if the mod is updated (as they were spawned with the old code), but fresh jars are going to be fine, I had to re-test everything in debug.
unlockk  [author] 10 Sep @ 6:56am 
I think all the possible issues have now been patched for, in case anyone is hesitant to use this because of the comments lmao.
unlockk  [author] 10 Sep @ 6:54am 
@WRex
Fixed the "runaway weight" bug increasing the weight of jars every time you reload the game.

Basically what was happening is - when you have an object that uses the "nutrition of evolved recipe" system (icons showing what food is contained within), you have to include lines of code for it to inherit nutrition (hunger reduction, calories, etc.), however the weight is, for some reason, recalculated every time (i.e every time that you load the game), and so when I included lines of code for it to inherit weight it would balloon out of proportion by adding the nutrition-inherited weight on top.

The only line of code I had to implement for weight is telling it to set weight to a specific number (base weight of Jar of X) so that creating the item would do "Jar of X weight + (nutrition weight)". Otherwise the item would be created with (nutrition weight) and only upon reloading the game it would begin doing "base weight + (nutrition weight)". A bit bizarre, but there you go.
unlockk  [author] 10 Sep @ 5:10am 
@WRex
Hey, thanks. Yeah you are right, I am not sure why this actually happens with the weight but I think I can fix it (the game has several lines of codes to set item weights, I think I also included the one that sets the Base.Item weight rather than the item of that particular instance), gonna try and make a patch now.
Cyanide MG 9 Sep @ 10:36am 
@The high school bum, that UI is from the NeatUI, crafting and building collection. It really makes the game's UI a lot better and neater.
The high school bum 9 Sep @ 4:07am 
What mod is used in screenshot two? UI looks nice.
WRex 9 Sep @ 3:59am 
Hi. Regarding the weight issue, I've tested it again and the problem still persists.
Steps to reproduce:

- Cook a stew or soup (ingredients don’t matter, in my case it was spaghetti soup with a weight of 10).
- Prepare a Jar of Food and cook it — the actual weight of the jar is 8.6.
- Leave the jar in your inventory, exit to the main menu.
- Enter the game again and check the jar weight. Expected weight: 8.6, actual weight: 15.8.
- Exit to the main menu once more.
- Enter the game and check the jar weight again. Expected weight: 8.6, actual weight: 23.

So each time you restart the game, the jar’s weight increases significantly.

It might be a conflict with other mods like Project Cook, but I'm not sure
unlockk  [author] 9 Sep @ 1:30am 
For your second comment, I guess you want an option to have cooking pot -> 2 jars, each jar = 1 bowl? I was going to implement an option that lets people do this, however I thought nobody would ever use it as it would require more jars and lids and everyone already knows these are barely existent in vanilla lol but yeah that option was on my mind. Will look at this much later though.
unlockk  [author] 9 Sep @ 1:29am 
I am not sure why the jars' weight changed, it is only set by the script that runs during crafting. I will have to check this in my game to confirm and then in the code but I won't have time today. Could you let me know when you relaunch the game again, this keeps happening every time? Anyone else reading this can confirm this happening to them?
WRex 8 Sep @ 7:24pm 
Also, I think we should add the same logic where we can prepare 2 bowls from 1 soup or stew. For example, if the food value of a stew is 112, we could create two bowls with a food value of 56 each. So if we want to prepare jars from 1 stew with a food value of 112, it should require 2 jars.
WRex 8 Sep @ 7:17pm 
I've found a bug related to the weight of jars. For example, I cooked a ragu with a total weight of 4. After cooking, the jars of food weighed 2.8 each (I cooked 4 jars). Then I relaunched the game and noticed that the jars' weights had changed: Jar 1 – 12.44 (already extremely heavy), Jar 2 – 13.4, Jar 3 – 7.64, Jar 4 – 4.4. After relaunching the game again and double-checking, the weights changed once more: Jar 1 – 13.82, Jar 2 – 14.9, Jar 3 – 10.76, Jar 4 – 5.9. While the vanilla jar weight is only 0.8. Could you please check it?
unlockk  [author] 8 Sep @ 4:31pm 
@WRex
No problem. yeah it was just one line of code that sets the model.
WRex 8 Sep @ 3:16pm 
I've just checked it — all good, looks much better. Thanks for the quick response and update!:steamthumbsup:
WRex 8 Sep @ 2:16pm 
Thanks! Will I lose my current food jars if I resubscribe ?
unlockk  [author] 8 Sep @ 10:27am 
@WRex
Thanks for letting me know, and done, you may have to resubscribe to update mod as Steam takes a few days normally.
unlockk  [author] 8 Sep @ 9:23am 
@WRex
Maybe this is what you are referring to - all the other jars in the game look smoother and smaller? I believe what is happening is: the unopened jars in this mod are using the B41 model and the developers have updated everything to use a different model. I am going to release a quick patch just so it is consistent with the vanilla models that the game has started using now.
WRex 8 Sep @ 7:27am 
Thanks for your reply! A bit more details: when a jar is inside a container the assets look fine (we see the vanilla ones), but when you pick up a jar and place it, for example, on the table or ground, the assets look broken.
unlockk  [author] 8 Sep @ 5:05am 
Thanks!

@WRex
Possibly, I just used the vanilla assets for the items, and yeah they're fine but not the best. So maybe if I have the time.
WRex 7 Sep @ 6:37pm 
Great mod!:steamthumbsup: Could you please improve the texture of the food jars when they are placed?
bubby_pz33 4 Sep @ 11:34am 
Very nice. Thanks for making
yuuno777 3 Sep @ 8:08pm 
I was able to use the soup from the casting pot. Thank you for your quick response.
Bioskeptical 3 Sep @ 12:30pm 
i've waited for such a mod for a long TIME
unlockk  [author] 3 Sep @ 4:08am 
@yuuno777
Fixed, thanks for letting me know. You might have to resubscribe as Steam takes its time to auto-update your modlist.
unlockk  [author] 3 Sep @ 3:33am 
@yuuno777 I see what you mean, if you make a soup in a forged cooking pot and try to transfer it it wouldn't work - yeah I will fix this now. I copied the item mapper from the vanilla jarring/bowl scripts and the developers missed out the Base.PotForgedSoupRecipe entry. I will fix it for the jars.
yuuno777 3 Sep @ 2:11am 
It recognizes both stew and cooking pots (existing and homemade), but it only recognizes soup in existing pots. I'd like this fixed.
unlockk  [author] 2 Sep @ 10:06am 
@Rachel L
This will not conflict with any other preservation mods. Every canning mod I've seen so far only adds recipes to new modded objects to the game, this mod pulls nutrition from your evolved recipe same as how pouring soup into a bowl does.
Rachel L 2 Sep @ 9:14am 
Hows the compatibility with these mods?
[B42] Fruits in jars - https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3432006285
[B42] Jarred and dried mushroom - https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3416833689