Spoilage solution

by ALDK

Spoilage solution - Mod that adds ways to avoid spoil! 1 - Canning! 2 - Cryogenic freezing! They will allow you to keep freshness for a long time!

Tweaks
5 months ago
2.0
1.32K
Logistics Fluids Manufacturing

i Configuration

2 months ago
(updated 2 months ago)

Hey, thanks for making this Mod! I love the ability to store perishables for longer and not having to worry so much about spoilage. However, I feel having frozen products with such a long spoil time is a tad unbalanced. Don't get me wrong, if nothing changes, I'll still use and enjoy the mod, but would it be possible to make the spoil times for the items this mod generates configurable, and to make the huge spoil time for frozen products the default? Perhaps you could use a multiplier to reflect how some products spoil more easily than others.

Thanks again for making this, and I hope you have a great day!

Edit; a sentence I forgot

2 months ago

Agreed, config options for the mod would be amazing, i would like it otherway around really, if its frozen it stops spoiling fully.

2 months ago

Agreed, config options for the mod would be amazing, i would like it otherway around really, if its frozen it stops spoiling fully.
Thank you very much for using the mod! Yes, we plan to add sliders in the future, but I can't say exactly when that will happen.

Regarding the complete stop of spoilage, this was done because if you convert an item to a non-perishable state and back, the timer resets. This would allow players to refresh the spoilage timer indefinitely.

2 months ago

Hey, thanks for making this Mod! I love the ability to store perishables for longer and not having to worry so much about spoilage. However, I feel having frozen products with such a long spoil time is a tad unbalanced. Don't get me wrong, if nothing changes, I'll still use and enjoy the mod, but would it be possible to make the spoil times for the items this mod generates configurable, and to make the huge spoil time for frozen products the default? Perhaps you could use a multiplier to reflect how some products spoil more easily than others.

Thanks again for making this, and I hope you have a great day!

Edit; a sentence I forgot

Thanks for the suggestion! 🙂

15 days ago

I'll second this suggestion, and go one further:

Rather than hardcoding spoilage times for your canned and frozen items, I'd recommend implementing a spoilage time multiplier. Pull each underlying item's spoil_ticks from data.raw, multiply by some number (seems to be roughly 2 for canning, 10000 for freezing) and use that in the recipe. You can then pull that multiplier out into settings.lua.

You can probably get away with minimal Lua code. Pull your settings values for "canned multiplier" and "frozen multiplier", pull the values for spoil tics for yumako, jellynut, bioflux, science and whatever else, then use those in your data:raw block. Should give people a bit more control over the experience.

15 days ago
(updated 15 days ago)

Eh, to hell with it. I did it myself. Here's a mock-up 0.0.2 of the mod:

https://www.dropbox.com/scl/fi/1x17kqwjk0zim9mgqu6lq/spoilage-solution_0.0.2.zip?rlkey=jxnrp9eacazltnb9z9gl9gxza&st=n0oi9aum&dl=0

I added a settings.lua with two Double settings. In item.lua, I pulled both settings and the spoil_ticks for everything you're modifying. In the data.append table, I simply swapped all of the spoil-ticks assignments with variants of:

spoil_ticks = math.min(yumako_spolage * canned_modifier, 4104000000),

The math.min is there because large freeze multipliers can overflow 32bit int limit of 4 294 967 295. I set it to 4 104 000 000 instead, since that's the nearest "neat" number. Shows up as 19 000 hours in the UI and looks neater than XXXXXhoursXXminutesXXseconds and the difference is immaterial at that scale. Added English localisation for both files. Haven't bothered with Russian localisation as I don't speak the language well enough and this is an example mod anyway. edit Also, put in a chanelog.txt, because it's just good practice to have that.

Also got rid of your control.lua, data-updates.lua and data-final-fixes.lua. You aren't using them, they were empty, so it didn't make sense to keep them. You can put them back in if you really want to.

Make of this what you will.

New response