How do I craft a given item from lua?

Place to get help with not working mods / modding interface.
Post Reply
Mythbrion
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 13, 2016 9:15 am
Contact:

How do I craft a given item from lua?

Post by Mythbrion »

Hi there,
Just trying to find the method that is called when you click an item to craft.
I realise there is an insert command to place an item in the player's inventory, but I would like to be able to have an item begin crafting on a condition set in a mod.
Hoping there is a simple 'player.craft(itemname, quantity)' style solution, but I couldn't find the code to do it.
Any help would be much appreciated.

Thank you.

Mythbrion
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 13, 2016 9:15 am
Contact:

Re: How do I craft a given item from lua?

Post by Mythbrion »

No one has any info?
Is this something we don't have access to from code?
Any information welcome, or perhaps a work around to emulate crafting an item, taking out mats, waiting a time, then inserting the desired item perhaps.
Messy but might work if there is no way to trigger a player to craft.

keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: How do I craft a given item from lua?

Post by keyboardhack »

You can find all the methods that modify a player here. By the looks of it it doeesn't look like it's possible to force a player to craft something. You can ask the devs to make it possible by making a post about it here.
Waste of bytes : P

Mythbrion
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 13, 2016 9:15 am
Contact:

Re: How do I craft a given item from lua?

Post by Mythbrion »

Thank you very much! I will make a topic requesting it there.

Post Reply

Return to “Modding help”