Fluid Permutations

by spiwn

Rotate fluid inputs and outputs of buildings

Utilities
3 years ago
0.16 - 1.1
15.7K

b [Resolved]Incompatibility with Amator Phasma's Library

3 years ago

Currently not really compatible with Amator Phasma's Library. Not sure if it's this mods fault though...

Let me explain: Their library has a function "check_recipes" in (/lib/script/init.lua), which removes all disabled recipes from machines when mods where changed. This affects fluid permutation recipes.
Is there a reason Fluid Permutations sets the recipes as disabled, or is this something you could change without issues? If not, I need to take this to Amator Phasma's.

3 years ago

Short explanation: Fluid Permutations disables the recipes it generates in order to hide them from the technology screen, so that there is less visual clutter and you do not see too much new recipes in a single technology (this is why, not how).
But it enables them when the appropriate technology is researched. So you should not have machines that have a Fluid Permutations recipe that is disabled.
I will take a look in the next few days.
Do you know if the only the "Amator Phasma's Library" is enough to reproduce it or do I need other mods?

3 years ago

Not 100% sure if other mods play into the game - I only managed to reproduce it with angels mods, especially Angel's Bio Processing.
Btw, you need to trigger "script.on_configuration_changed" for that code of the library to run - not 100% sure when that is called.

Using a non-current version of Angel's Bio Processing, creating a recipe in a chemical plant, setting fluid permutation, saving, updating the mods, loading - that should reproduce the issue.

Also, here's a save, just load with up to date mods: https://www.mediafire.com/file/d5zpcqjrxctkasn/tmp2.zip/file

Thanks in advance, if I should investigate further, just tell me.

3 years ago

"script.on_configuration_changed" is called whenever the configuration changes - that includes adding or removing mods, updating mod version, changing startup configuration and probably updating the game itself (not sure about this one).

I think I have enough information for now. Thank you.

3 years ago
(updated 3 years ago)

I've looked into it.
The problem is that Amator Phasma's Library resets the recipes and technologies to the state they were in the data stage, which disables all Fluid Permutations' recipes. Then "activates all conditional recipes and technologies" from their (other) mods, but does not notify other mods of the reset. If the other mods are notified, everything works as expected. If I use the same terms, Fluid Permutation's recipes are conditional.
In fact, the code to notify the mods:
https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.reset_technology_effects
is in the library but it is commented out:
https://gitlab.com/AmatorPhasma/apm_factorio/-/blob/master/apm_lib/lib/script/init.lua#L201
There is nothing that I can do on my side. The change must be made in Amotor Phasma's Library. I tested with just uncommenting the line and it worked. I do not know why it was commented out in the first place, but without it other mods will break too.

P.s. The provided save was helpful. Thank you.

P.p.s. I made a post on the library's discussion board.

3 years ago

Thanks for your work!

New response