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!
Event for machine crafting complete
Re: Event for machine crafting complete
Factorio 2.0 now supports multiple crafts per tick. I think you're also implicitly asking for a filter. Otherwise you're going to get like thousands per second.
(I'm not official, just skimming these because mostly if it's an API request we probably need it for our use case).
(I'm not official, just skimming these because mostly if it's an API request we probably need it for our use case).
Re: Event for machine crafting complete
There was a more clear no response in viewtopic.php?f=28&t=47728 though even that one wasn't moved to Won't Implement.
- micromario
- Fast Inserter
- Posts: 109
- Joined: Thu Apr 05, 2018 11:53 am
- Contact:
Re: Event for machine crafting complete
You should add a dummy item to your recipe with a spoil trigger result of 1 ticks.
Then use this trigger result to get the event of the crafting machine completing.
Then use this trigger result to get the event of the crafting machine completing.