Fluid Nutrients

by brad321

Nutrients are replaced with nutrient solution

Tweaks
6 months ago
2.0
484
Logistics Fluids Manufacturing

g Bug: recycling recipes that used nutrients

6 months ago

As far as I'm aware, the only recipes this affects in the base game are Artificial Yumako Soil and Artificial Jellynut Soil, since all other recipes that take nutrients are flagged as "organic" and thus innately blocked from being recycled, but this also affects modded recipes that take nutrients as input.

With this mod, the auto-generated recycling recipes for recipe that takes nutrients as input do not function, because they requires water as input (assuming that setting is ticked) and output fluid nutrients, and the recycler has no fluidboxes. Recyclers are supposed to just vanish any fluids that would otherwise be output instead (or simply refuse to recycle anything with fluid inputs, like batteries).

As an adaptation to this, I locally adjusted the results loop section in data-updates.lua to the following:

  if recipe.results then
    for i, result in pairs(recipe.results) do
      if result.name == "nutrients" then
        if string.find(recipe.name, "-recycling") then
          table.remove(recipe.results, i) -- Fluid ingredients aren't returned by recycling
        else
          result.name = "nutrient-solution"
          recipe.main_product = "nutrient-solution"
          result.type = "fluid"
          [...]

For anything that's a recycling recipe, it just removes the nutrients entirely, rather than replacing it with nutrient solution, and also avoids inserting water as an ingredient as well.

Alternatively, it could instead insert Spoilage as a solid product output for the recycling recipes (or increment it if already present, like it does for water inputs). I think this would actually be a reasonable outcome, that if you recycle something that required nutrients as input, you get some percentage as spoilage output instead.

6 months ago

I fully overlooked recycling!
I made this mod mainly to avoid nutrients becoming spoilage and recyclers normally destroy fluids like you say, so I've decided to add your original adjustment of simply removing nutrient results for recycling recipes to fix this bug.

New response