Cryogenic plant built-in productivity


Simple mod adding 50% built-in productivity to cryogenic plant. Also reduces module slots to 4 (toggleable in settings)

Tweaks
3 months ago
2.0
535
Factorio: Space Age Icon Space Age Mod
Manufacturing

g er

9 months ago

it didn't have productivity because of the cooling loop of flouroketane , this will create it out of nothing and you wouldn't be able to cool your fusion plants as it would fill up with more cold flouroketane until it jams.

9 months ago

oh man that makes sense, maybe i'll try to tweak it so fluoroketane doesn't recieve it. thanks

9 months ago

Additionally they did give it 8 module slots to make up for the lack on built-in productivity

9 months ago

I found it odd, but as mentioned, it does have friggin 8 module slots which is ridiculous. It may lack productivity but the extra module slots give it incredible versatility.

9 months ago

Thanks for insight, i fixed the fusion plant problem and made it have only 4 module slots. So it's just like a rebalance i guess

9 months ago

Is it possible to make it an option to keep the 8 module slots with this mod?

9 months ago
(updated 9 months ago)

just pushed the new version with the toggleable setting

9 months ago

Awesome thank you!

9 months ago

so looking at the Cryo plant in action, i noticed it was 50% faster than before (due to how the productivity change was implemented). I was thinking of how to make it back to the same speed, so that the same module setup still works for this recipe.

So i thought about it a bit, then hopped my NEWBIE self over to the Modding tutorial to see if i could find the one command to change the crafting time. That took a minute lol. But i did find it, and i didn't know if the game handled decimal amounts, so some short math and i came up with 18 hot in, 12 cold out, and 9 second crafting time. So after figuring out where to put all of that in, i extracted this mod to a folder, changed the version of course, and edited the main file with this:

if recipe1 then
recipe1.allowed_effects={
"speed","consumption","polution"
}
recipe1.ingredients = {
{type="fluid",name = "fluoroketone-hot", amount=18}
}
recipe1.results = {
{type="fluid", name= "fluoroketone-cold", amount = 12}
}
recipe1.energy_required = 9
end

This caused it to be back to the original 2/s recipe! I don't know if you want this info, but i was pretty proud that i went and figured it out lol

9 months ago

As stupid as it sounds, I completely forgot I could change the time it took to craft the item. I relased the new version with it completely fixed. I'm also a beginner modder myself. Thanks for your help! also I assume you meant 4/s ;)

9 months ago

Awesome! thank you! 4/s is due to the machine's craft speed not being a flat 1. If you look at the original recipe, it was 10 fluid with a craft time of 5 seconds, so just a plain 2/s. It gets increased in the Cryo Plant simply because it has a high crafting speed :)

6 months ago

For the record, instead of nerfing the base output of the recipe, a much better solution is to add the ignored_by_productivity= field to the product. Example:

{type="fluid", name= "fluoroketone-cold", amount = 18, ignored_by_productivity=18}

This just hard prevents that result from scaling with productivity, innate or moduled. Honestly, I have no idea why that flag wasn't set in the recipe in the first place. It's set in all of the recipes that consume cold fluoroketone and product hot fluoroketone, to avoid those generating a bunch of free fluoroketone.

5 months ago

I was looking into how to solve the fluoroketone issue without modifying the ratios, too. I couldn't get it to work with the ignored_by_productivity attribute, but I found another simple way that effectively disables the productivity bonus for the recipe:

data.raw.recipe["fluoroketone-cooling"].maximum_productivity = 0
4 months ago

I just was playing around with the files, and as far as I can tell the default recipe works just fine due to the ignored_by_stats = 10 attribute. Tested in sandbox mode with the mod's custom recipe deleted and got 10 barrels of cold ketones from 10 barrels of hot. The productivity bar still advances but you don't get any more ketone.

4 months ago
(updated 4 months ago)

Honestly, I'm not sure why that works that way. ignored_by_stats isn't supposed to affect productivity, it's only supposed to impact the statistics recording for the produced and consumed. It's used to flag catalysts as ignored so you don't see, say, the entire volume of fluoroketone that cycles through your factory as being simultaneously "produced" and "consumed". However, testing it locally, ignored_by_stats and ignored_by_productivity both seem to suppress the productivity effect. It's also worth noting that the original vanilla game recipe has the output already flagged for ignored_by_stats (and also the recipe set to not permit productivity in the first place, but that can be overridden by other mods).

In fact, I tested commenting out most of the code in this mod, and it still works exactly as expected with the ONLY code in the mod being this in data_final_fixes.lua:

local machine = data.raw["assembling-machine"]["cryogenic-plant"]
if machine then
    machine.effect_receiver = {
        base_effect = {productivity = 0.5},
    }
    if settings.startup["cryo-plant-module-nerf"].value then
        machine.module_slots=4
    end
end

The cooling recipe still has the same no-productivity behavior even without the adjustment to the recipe. Incidentally, the whole thing the mod does in adding the recipes to a separate recipe category does nothing in regards to productivity. That code might as well be completely removed, it serves no purpose except causing incompatibilities with mods that add modified versions of the cryoplant.

4 months ago
(updated 4 months ago)

<deleted>

4 months ago
(updated 4 months ago)

whoops, double post. Why are the quote and edit buttons right next to each other? >.<

4 months ago

I was thinking it's probably due to the fact that the value of ignored_by_productivity defaults to the value of ignored_by_stats: https://lua-api.factorio.com/latest/types/ItemProductPrototype.html.

4 months ago

Ah, interesting, yep that'd do it, good eye

3 months ago

Hey, thanks for all the insight. I ended up removing a lot of redundant code. What's interesting is that it was needed at first, without adding this new recipe fluoroketone would still be affected by productivity. So maybe i overlooked sth or something was fixed in the patchnotes. thanks again!

3 months ago

I wouldn't be surprised if they went back and added the ignored_by_stats tag to that recipe in one of the patches, actually.

New response