Recipe Handcrafting Problem

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Recipe Handcrafting Problem

Post by TheSAguy »

Hi,
So I added a burner mining drill disassemble recipe to my mod and it is causing a problem where I now can't auto craft iron gears. What I mean by auto craft is that if the gears is a component in another item and I have iron plate the gears would be automatically crafted as a component of the new entity I'm crafting.

If I remove the Iron Gears from the results of the disassemble recipe I can once again craft gears.
Is there a solution to this?
Is there a way to force a recipe to be done in a assembly machine and not by hand?
Here is the recipe:

Code: Select all

	{
		type = "recipe",
		name = "bi-burner-mining-drill-disassemble",
		icon = "__Bio_Industries__/graphics/icons/burner-mining-drill_disassemble.png",
		subgroup = "extraction-machine",
		order = "a[items]-a[burner-mining-drill]",
		energy_required = 2,
		ingredients =
		{
		  {"burner-mining-drill", 1},
		},
		results=
		{
		  {"iron-gear-wheel", 2},
		  {"stone", 4},
		  {"iron-plate", 6}
		},

	},
Thanks.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Recipe Handcrafting Problem

Post by daniel34 »

TheSAguy wrote:Is there a way to force a recipe to be done in a assembly machine and not by hand?
You can add a crafting category to the recipe, like the engine unit recipe does in the base game:

Code: Select all

    type = "recipe",
    name = "engine-unit",
    energy_required = 20,
    category = "advanced-crafting",
    [...]
It assigns the category "advanced-crafting" to the recipe which only makes it craftable in assembler 2 and 3.

You can also create your own recipe category using

Code: Select all

data:extend({
  {
    type = "recipe-category",
    name = "my-crafting-category"
  }
})
The recipe category also has to be set for the crafting machine, see the code for assembler 2/3 in base\prototypes\entity\entities.lua.
quick links: log file | graphical issues | wiki
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Recipe Handcrafting Problem

Post by orzelek »

Try autocrafting iron gears when you have some burner mining drills in inventory - it will work then.
It's the bug thats been plaguing bob's mods with synthetic wood. If there is more then one path to obtain item game will select one and ignore others for autocrafting purposes.
AndrolGenhald
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Tue Mar 22, 2016 6:35 pm
Contact:

Re: Recipe Handcrafting Problem

Post by AndrolGenhald »

Sorry for the slight necro, but I just ran into this as well. Has anyone put in a feature request for something like an "ignore_when_handcrafting" or "disallow_as_prerequisite" boolean for the recipe prototypes?
Post Reply

Return to “Modding help”