event = {entity = "assembler", recipe = "recipe" }
I want this for assemblers, but I might be able to see some use for players too.
defines.event.on_entity_crafting_complete
Re: defines.event.on_entity_crafting_complete
We specifically don't have such an event because it would be a massive drain on game performance.
If you want to get ahold of me I'm almost always on Discord.
-
Supercheese
- Filter Inserter

- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: defines.event.on_entity_crafting_complete
Don't we already have this for players?Mylon wrote:event = {entity = "assembler", recipe = "recipe" }
I want this for assemblers, but I might be able to see some use for players too.
Re: defines.event.on_entity_crafting_complete
Yes, because the player count is not in the 10s of thousands and has a fixed crafting speed.Supercheese wrote:Don't we already have this for players?Mylon wrote:event = {entity = "assembler", recipe = "recipe" }
I want this for assemblers, but I might be able to see some use for players too.
If you want to get ahold of me I'm almost always on Discord.
-
Supercheese
- Filter Inserter

- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: defines.event.on_entity_crafting_complete
Indeed, I was just pointing that event out because it seemed the OP wasn't aware of it.Rseding91 wrote:Yes, because the player count is not in the 10s of thousands and has a fixed crafting speed.
- IsaacOscar
- Filter Inserter

- Posts: 843
- Joined: Sat Nov 09, 2024 2:36 pm
- Contact:
Re: defines.event.on_entity_crafting_complete
Sorry for necroing an old thread, but would it be possible to have the recipe and/or crafting machine's prototype opt in to an event? So any performance problems can be minimised?
Re: defines.event.on_entity_crafting_complete
+1
Mods that want to do that will find a way and it will cost more performance that such an event (and might have restrictions with mod compatibility). For example using rocket silos or on-tick events with products_finished and/or crafting_progress.
This can be very restrictive, such that is has to be enabled per-prototype or even per-entity (similar to register_on_object_destroyed)
Having this built-in is also the only way to make this work with ultra-fast recipes that do complete more than once per tick (performance-wise this should still be fine if there aren't many of those entities).
Mods that want to do that will find a way and it will cost more performance that such an event (and might have restrictions with mod compatibility). For example using rocket silos or on-tick events with products_finished and/or crafting_progress.
This can be very restrictive, such that is has to be enabled per-prototype or even per-entity (similar to register_on_object_destroyed)
Having this built-in is also the only way to make this work with ultra-fast recipes that do complete more than once per tick (performance-wise this should still be fine if there aren't many of those entities).
- protocol_1903
- Filter Inserter

- Posts: 413
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: defines.event.on_entity_crafting_complete
I'm working on a script handler for such an event but it's not cheap to run. I'll be adding it to the following mod when it's done.
https://mods.factorio.com/mod/perel
https://mods.factorio.com/mod/perel
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
https://mods.factorio.com/user/protocol_1903

