Page 1 of 1

[Solved] How to get two or more items as result of recipe?

Posted: Thu Mar 24, 2016 6:15 am
by zurisar
Hi guys, that's me again :)

I continue develop my mod and meet another problem, I want to centrifuge ore subproduct and get 3 items as result, firstly I try furnace type for machine, and game said that I has bad result in recipe, after that I start use assembling-machine type for machine

Firstly game said that I hasn't icon node, I add icon node to recipe, but now game said that 'unknown item subgroup for recipe', I don't understand what is that.

Recipe category

Code: Select all

  {
    type = "recipe-category",
    name = "centrifuge"
  },
Recipe

Code: Select all

{
    type = "recipe",
    name = "iron-dust",
    category = "centrifuge",
	icon = "__zorio__/graphics/components/iron-plate.png",
    energy_required = 50,
	enabled = true,
    ingredients = 
	{
		{ type="item", name="hutched-iron-ore", amount=1}
	},
    results =
	{
		{type="item", name="iron-dust", amount=2},
		{type="item", name="iron-plate", amount=2},
	}
  },
* I use test items as result for now

Centrifuge machine

Code: Select all

{
    type = "assembling-machine",
    name = "zcentrifuge",
    icon = "__base__/graphics/icons/stone-furnace.png",
    flags = {"placeable-neutral","placeable-player", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "zcentrifuge"},
    max_health = 400,
    corpse = "big-remnants",
    dying_explosion = "medium-explosion",
    collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
		selection_box = {{-0.8, -1}, {0.8, 1}},
    --[[ module_specification =
    {
      module_slots = 2
    },
    allowed_effects = {"consumption", "speed", "productivity", "pollution"}, ]]--
    animation =
		{
			filename = "__base__/graphics/entity/stone-furnace/stone-furnace.png",
			priority = "extra-high",
			width = 81,
			height = 64,
			frame_count = 1,
			shift = {0.5, 0.05 }
		},
    working_visualisations =
		{
			{
				north_position = {0.0, 0.0},
				east_position = {0.0, 0.0},
				south_position = {0.0, 0.0},
				west_position = {0.0, 0.0},
				animation =
					{
						filename = "__base__/graphics/entity/stone-furnace/stone-furnace-fire.png",
						priority = "extra-high",
						width = 23,
						height = 27,
						frame_count = 12,
						shift = { 0.078125, 0.5234375}
					},
				light = {intensity = 1, size = 1}
			}
		},
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound =
      {
        {
          filename = "__base__/sound/chemical-plant.ogg",
          volume = 0.8
        }
      },
      idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
      apparent_volume = 1.5,
    },
    crafting_speed = 1,
    energy_source =
		{
			type = "burner",
			effectivity = 0.7,
			fuel_inventory_size = 1,
			emissions = 0.02,
			smoke =
				{
					{
						name = "smoke",
						deviation = {0.1, 0.1},
						frequency = 5,
						position = {0.0, -0.8},
						starting_vertical_speed = 0.08,
						starting_frame_deviation = 60
					}
				}
		},
    energy_usage = "500kW",
    ingredient_count = 1,
    crafting_categories = {"centrifuge"},
  },
Is that possible to get few items as result of recipe? I read basemod code and saw only item+fluid as result...

Re: How to get two or more items as result of recipe?

Posted: Thu Mar 24, 2016 6:31 am
by Koub
Look at the recipes of refining/advanced refining. They take 1/2 ingredients and produce 3. I guess it should help :).
However, there is only one exit slot on regular assembling machines. I don't think you could craft your recipe in it.

Re: How to get two or more items as result of recipe?

Posted: Thu Mar 24, 2016 6:38 am
by zurisar
Koub wrote:Look at the recipes of refining/advanced refining. They take 1/2 ingredients and produce 3. I guess it should help :).
However, there is only one exit slot on regular assembling machines. I don't think you could craft your recipe in it.
yep, I read this, but all of them output 1 item and 1-2 fluid, I thinks that why I can't get more than one item
I found node

Code: Select all

result_inventory_size = 2,
as I understand this for furnace type, but it still now work :(

anyway I always can out only ore dust as item and some fluids as subproducts after centrifuge, but that make my mod more difficulty, I thought made 'coal version' of all machines, but if one of them will output fluids - player will need pipes and tanks and do something else with this... so it will be a plan 'B' ;)

Re: How to get two or more items as result of recipe?

Posted: Sat Mar 26, 2016 6:17 am
by zurisar
I did this I hass 1 input and 2 ouput items for recipe

I use furnace type, then I add nodes to recipe when game ouput error, so my recipe for now look like this

Code: Select all

{
    type = "recipe",
    name = "iron-dust",
    category = "centrifuge",
	subgroup = "hash-resources",
	icon = "__zorio__/graphics/components/iron-plate.png",
    energy_required = 50,
	enabled = true,
    ingredients = 
	{
		{ type="item", name="hutched-iron-ore", amount=1}
	},
    results =
	{
		{type="item", name="iron-dust", amount=2},
		{type="item", name="iron-plate", amount=2},
	}
  },
yep, it has icon and subgroup, I don't understand why game ask about this nodes, but it work, so...

machine code

Code: Select all

{
    type = "furnace",
    name = "zcentrifuge",
    icon = "__base__/graphics/icons/stone-furnace.png",
    flags = {"placeable-neutral","placeable-player", "player-creation"},
    minable = {hardness = 0.2, mining_time = 0.5, result = "zcentrifuge"},
    max_health = 400,
    corpse = "big-remnants",
    dying_explosion = "medium-explosion",
	source_inventory_size = 1,
	result_inventory_size = 3,
    collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
		selection_box = {{-0.8, -1}, {0.8, 1}},
    --[[ module_specification =
    {
      module_slots = 2
    },
    allowed_effects = {"consumption", "speed", "productivity", "pollution"}, ]]--
    animation =
		{
			filename = "__base__/graphics/entity/stone-furnace/stone-furnace.png",
			priority = "extra-high",
			width = 81,
			height = 64,
			frame_count = 1,
			shift = {0.5, 0.05 }
		},
    working_visualisations =
		{
			{
				north_position = {0.0, 0.0},
				east_position = {0.0, 0.0},
				south_position = {0.0, 0.0},
				west_position = {0.0, 0.0},
				animation =
					{
						filename = "__base__/graphics/entity/stone-furnace/stone-furnace-fire.png",
						priority = "extra-high",
						width = 23,
						height = 27,
						frame_count = 12,
						shift = { 0.078125, 0.5234375}
					},
				light = {intensity = 1, size = 1}
			}
		},
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound =
      {
        {
          filename = "__base__/sound/chemical-plant.ogg",
          volume = 0.8
        }
      },
      idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
      apparent_volume = 1.5,
    },
    crafting_speed = 1,
    energy_source =
		{
			type = "burner",
			effectivity = 0.7,
			fuel_inventory_size = 1,
			emissions = 0.02,
			smoke =
				{
					{
						name = "smoke",
						deviation = {0.1, 0.1},
						frequency = 5,
						position = {0.0, -0.8},
						starting_vertical_speed = 0.08,
						starting_frame_deviation = 60
					}
				}
		},
    energy_usage = "500kW",
    ingredient_count = 1,
    crafting_categories = {"centrifuge"},
  },
Recipe result
Image