Event for machine crafting complete
Posted: Mon Nov 04, 2024 10:54 am
In my mod, I would like to react to a (custom) assembling-machine finishing a craft. As far as I can tell, there is no way to do this short of reading LuaEntity.crafting_progress or LuaEntity.products_finished on every tick. I was hoping for something better or more efficient.
This was requested a long time ago but it never got a definitive answer (viewtopic.php?t=44269).
In 2.0 assembly machines actually have this feature for logistic networks, where they send a 1-tick signal on craft complete. So it kind of feels like mods/scripts are less powerful in this regard than the logistic network, which seems the wrong way around . So what do you think?
For more on my use case: I'm (ab)using assembly-machines as pay gates of sorts with fixed, one-time "unlock" recipes with no results. Basically, pay this cost for an effect (that is often not revealed in advance). An assembling-machine gives me a nice UI for free which documents the cost as you hover the recipe name, provides slots to put the items in (even partially) and the player inventory to grab them from and can be automated nicely if you want to deliver the goods via belts and inserters. It's a much nicer experience than, say, a container that you're supposed to put the price in. I just need to know when they finish a craft.
Thank you for your consideration!
This was requested a long time ago but it never got a definitive answer (viewtopic.php?t=44269).
In 2.0 assembly machines actually have this feature for logistic networks, where they send a 1-tick signal on craft complete. So it kind of feels like mods/scripts are less powerful in this regard than the logistic network, which seems the wrong way around . So what do you think?
For more on my use case: I'm (ab)using assembly-machines as pay gates of sorts with fixed, one-time "unlock" recipes with no results. Basically, pay this cost for an effect (that is often not revealed in advance). An assembling-machine gives me a nice UI for free which documents the cost as you hover the recipe name, provides slots to put the items in (even partially) and the player inventory to grab them from and can be automated nicely if you want to deliver the goods via belts and inserters. It's a much nicer experience than, say, a container that you're supposed to put the price in. I just need to know when they finish a craft.
Thank you for your consideration!