Event for on_pre_recipe_changed / on_recipe_changed

Things that we aren't going to implement
Post Reply
JoeyDP
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 10, 2019 4:19 pm
Contact:

Event for on_pre_recipe_changed / on_recipe_changed

Post by JoeyDP »

For my mod https://mods.factorio.com/mod/better-air-filtering I could use a callback for when the recipe of a crafting machine changes. Specifically for detecting when fluid that is in the machine will be destroyed. The added machines contain a representation of pollution in liquid form, and need to release it back into the atmosphere to prevent loopholes. The only scenario I know of where liquid can still be destroyed without a callback, is when the recipe is changed from the GUI.

Currently I use one fixed recipe per machine to prevent this, which is rather limiting toward my future plans.

Let me know if I maybe missed this feature. Or if you like this idea, give it a bump :).

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 452
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Event for on_pre_recipe_changed / on_recipe_changed

Post by raiguard »

I would also love this. I wish to add snapping logic to infinity pipes so that if they're placed next to an assembler, they can automatically be set to provide the correct fluid. I can do this when the pipe is placed, but not when the recipe is changed.

Image

Without a recipe changed event, the only way I can think of to do this would be to check every assembling machine on every tick of the game. That would get bad very quickly!

Recipe changes usually only ever happen manually, so adding an event for it wouldn't cause any performance overhead on large save files, I think.
Don't forget, you're here forever.


Post Reply

Return to “Won't implement”