Home

RecipePrototype

A recipe. It can be a crafting recipe, a smelting recipe, or a custom type of recipe, see RecipeCategory.

Parent

Properties

category

The category of this recipe. Controls which machines can craft this recipe.

The built-in categories can be found here. The base "crafting" category can not contain recipes with fluid ingredients or products.

Examples

category = "smelting"

additional_categories

crafting_machine_tint

Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. WorkingVisualisation::apply_recipe_tint determines which of the four colors is used for that layer, if any.

icons

Can't be an empty array.

icon

If given, this determines the recipe's icon. Otherwise, the icon of main_product or the singular product is used.

Only loaded if icons is not defined.

Mandatory if icons is not defined for a recipe with more than one product and no main_product, or no product.

Examples

icon = "__base__/graphics/icons/fluid/heavy-oil.png"

icon_size

The size of the square icon, in pixels. E.g. 32 for a 32px by 32px icon. Must be larger than 0.

Only loaded if icons is not defined.

ingredients

A table containing ingredient names and amounts. Can also contain information about fluid temperature and whether some of the amount is ignored by production statistics.

The maximum ingredient amount is 65 535. Can be set to an empty table to create a recipe that needs no ingredients.

Duplicate ingredients, e.g. two entries with the same name, are *not* allowed. In-game, the item ingredients are ordered by ItemGroup::order_in_recipe.

Examples

-- Recipe with items
ingredients =
{
  {type = "item", name = "iron-stick", amount = 2},
  {type = "item", name = "iron-plate", amount = 3}
}
-- Recipe with fluids
ingredients =
{
  {type = "fluid", name = "water", amount = 50},
  {type = "fluid", name = "crude-oil", amount = 100}
}

results

A table containing result names and amounts. Products also contain information such as fluid temperature, probability of results and whether some of the amount is ignored by productivity.

Can be set to an empty table to create a recipe that produces nothing. Duplicate results, e.g. two entries with the same name, are allowed.

Examples

results =
{
  {type = "fluid", name= "heavy-oil", amount = 3},
  {type = "fluid", name= "light-oil", amount = 3},
  {type = "fluid", name= "petroleum-gas", amount = 4}
}
results =
{
  {type = "item", name = "iron-plate", amount = 9},
  {type = "item", name = "copper-plate", amount = 1}
}
results = {{type = "fluid", name = "steam", amount = 1, temperature = 165}}

main_product

For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. Setting the main_product to an empty string ("") forces the title in the recipe tooltip to use the recipe's name (not that of the product) and shows the products in the tooltip.

If 1) there are multiple products and this property is nil, 2) this property is set to an empty string (""), or 3) there are no products, the recipe will use the localised_name, icon, and subgroup of the recipe. icon and subgroup become non-optional.

energy_required

The amount of time it takes to make this recipe. Must be > 0.001. Equals the number of seconds it takes to craft at crafting speed 1.

emissions_multiplier

maximum_productivity

Must be >= 0.

requester_paste_multiplier

overload_multiplier

Used to determine how many extra items are put into an assembling machine before it's considered "full enough". See insertion limits.

If set to 0, it instead uses the following formula: 1.166 / (energy_required / the assembler's crafting_speed), rounded up, and clamped to be between2 and 100. The numbers used in this formula can be changed by the UtilityConstants properties dynamic_recipe_overload_factor, minimum_recipe_overload_multiplier, and maximum_recipe_overload_multiplier.

allow_inserter_overload

Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).

enabled

This can be false to disable the recipe at the start of the game, or true to leave it enabled.

If a recipe is unlocked via technology, this should be set to false.

hide_from_stats

Hides the recipe from item/fluid production statistics.

hide_from_player_crafting

Hides the recipe from the player's crafting screen. The recipe will still show up for selection in machines.

hide_from_bonus_gui

allow_decomposition

Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.

allow_as_intermediate

Whether the recipe can be used as an intermediate recipe in hand-crafting.

allow_intermediates

Whether the recipe is allowed to use intermediate recipes when hand-crafting.

always_show_made_in

Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.

show_amount_in_title

Whether the recipe name should have the product amount in front of it. E.g. "2x Transport belt".

always_show_products

Whether the products are always shown in the recipe tooltip.

unlock_results

Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).

preserve_products_in_machine_output

result_is_always_fresh

When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.

reset_freshness_on_craft

When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).

allow_consumption_message

allow_speed_message

allow_productivity_message

allow_pollution_message

allow_quality_message

surface_conditions

hide_from_signal_gui

If left unset, this property will be determined automatically: If the recipe is not hidden, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to false. It'll be true otherwise.

allow_consumption

allow_speed

allow_productivity

allow_pollution

allow_quality

allowed_module_categories

Sets the module categories that are allowed to be used with this recipe.

alternative_unlock_methods

Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.

auto_recycle

Whether the recipe should be included in the recycling recipes automatically generated by the quality mod.

This property is not read by the game engine itself, but the quality mod's recycling.lua file. This means it is discarded by the game engine after loading finishes.

hidden

Hides the recipe from crafting menus and other recipe selection lists.