Page 1 of 1

Events for LuaRecipe object modificatons

Posted: Thu Oct 31, 2024 2:23 pm
by azaghal
Hello,

Would it be possible to introduce some additional events related to changes being made to the LuaRecipe objects?

While most of the usual recipe-related changes (like technology unlocks) are already covered by research-related events, mods can still change a couple of properties that do not seem to have any kind of associated event with them.

The particular use-case for me would be for the [Construction Planner Continuted](https://mods.factorio.com/mod/Construct ... rContinued) mod where I utilise a dedicated "ghost" force for player in order to prevent the player's construction bots from building the ghosts. Since version 2.0 makes it possible to select machine recipes directly on ghost entities, I had to add some code that would sync up the researched technologies between the paired forces to ensure the player has same selection on both his/her own and ghost force's ghost entities. While this does handle the technology-based recipe unlocks well, currently I have no way of detecting changes (beyond polling via on_tick, which I would rather avoid) to recipe availability via event system.

From what I can tell, there are only three properties that are writable on LuaRecipe objects, and they seem fairly straightforward - so perhaps just having a on_recipe_changed event would be sufficient?

Best regards,
Branko