Assembly machine + creation event ?

Place to get help with not working mods / modding interface.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Assembly machine + creation event ?

Post by binbinhfr »

Hi,

I created an entities derivated from the assembly-machine-2, with a fixed recipe and I would like to detect when this machine creates an object.

How would you do this ? I did not find any event triggered in this case (creation event seems to be triggered only when the player creates something manually)...
My mods on the Factorio Mod Portal :geek:
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Assembly machine + creation event ?

Post by Adil »

There's no such thing.
You'll need to occasionally check entity.crafting_progress intermittently to detect the item completion.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Assembly machine + creation event ?

Post by binbinhfr »

Adil wrote:There's no such thing.
You'll need to occasionally check entity.crafting_progress intermittently to detect the item completion.
Thanks for the idea, I didn't notice this interesting variable.
Finally, I check the content of the output inventory, it is also a good clue.
My mods on the Factorio Mod Portal :geek:
darthun
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 16, 2016 10:19 pm
Contact:

Re: Assembly machine + creation event ?

Post by darthun »

it's a shame, I could have used such an event as well.

Is there a way to call a script from the "stuff" defined in entity.lua, item.lua, and such files ?
Post Reply

Return to “Modding help”