Factorio Prototype DocsVersion 2.0.18

RecipePrototype 'recipe' changedExample code

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

Inherits from Prototype « PrototypeBase

Properties

category optional :: RecipeCategoryID

The category of this recipe. [...]

The category of this recipe. [...]

crafting_machine_tintchanged optional :: RecipeTints

Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]

Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]

icons optional :: array[IconData]

Can't be an empty array.

Can't be an empty array.

icon optional :: FileName

If given, this determines the recipe's icon. [...]

If given, this determines the recipe's icon. [...]

icon_size optional :: SpriteSizeType

The size of the square icon, in pixels. [...]

The size of the square icon, in pixels. [...]

ingredients optional :: array[IngredientPrototype]

A table containing ingredient names and amounts. [...]

A table containing ingredient names and amounts. [...]

results optional :: array[ProductPrototype]

A table containing result names and amounts. [...]

A table containing result names and amounts. [...]

main_product optional :: string

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. [...]

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. [...]

energy_required optional :: double

The amount of time it takes to make this recipe. [...]

The amount of time it takes to make this recipe. [...]

emissions_multiplier optional :: double
maximum_productivitynew optional :: double

Must be >= 0.

Must be >= 0.

requester_paste_multiplier optional :: uint32
overload_multiplier optional :: uint32

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

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

allow_inserter_overload optional :: bool

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

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

enabled optional :: bool

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

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

hide_from_stats optional :: bool

Hides the recipe from item/fluid production statistics.

Hides the recipe from item/fluid production statistics.

hide_from_player_crafting optional :: bool

Hides the recipe from the player's crafting screen. [...]

Hides the recipe from the player's crafting screen. [...]

allow_decomposition optional :: bool

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

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

allow_as_intermediate optional :: bool

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

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

allow_intermediates optional :: bool

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

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

always_show_made_in optional :: bool

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

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 optional :: bool

Whether the recipe name should have the product amount in front of it. [...]

Whether the recipe name should have the product amount in front of it. [...]

always_show_products optional :: bool

Whether the products are always shown in the recipe tooltip.

Whether the products are always shown in the recipe tooltip.

unlock_results optional :: bool

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

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

preserve_products_in_machine_outputnew optional :: bool
result_is_always_freshnew optional :: bool

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

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

allow_consumption_messagenew optional :: LocalisedString
allow_speed_messagenew optional :: LocalisedString
allow_productivity_messagenew optional :: LocalisedString
allow_pollution_messagenew optional :: LocalisedString
allow_quality_messagenew optional :: LocalisedString
surface_conditionsnew optional :: array[SurfaceCondition]
hide_from_signal_guinew optional :: bool
allow_consumptionnew optional :: bool
allow_speednew optional :: bool
allow_productivitynew optional :: bool
allow_pollutionnew optional :: bool
allow_qualitynew optional :: bool
allowed_module_categoriesnew optional :: array[ModuleCategoryID]

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

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

alternative_unlock_methodsnew optional :: array[TechnologyID]

Inherited from Prototype
factoriopedia_alternative optional :: string

The ID type corresponding to the prototype that inherits from this. [...]

The ID type corresponding to the prototype that inherits from this. [...]

Inherited from PrototypeBase
type :: string

Specifies the kind of prototype this is. [...]

Specifies the kind of prototype this is. [...]

name :: string

Unique textual identification of the prototype. [...]

Unique textual identification of the prototype. [...]

order optional :: Order

Used to order prototypes in inventory, recipes and GUIs. [...]

Used to order prototypes in inventory, recipes and GUIs. [...]

localised_name optional :: LocalisedString

Overwrites the name set in the locale file. [...]

Overwrites the name set in the locale file. [...]

localised_description optional :: LocalisedString

Overwrites the description set in the locale file. [...]

Overwrites the description set in the locale file. [...]

factoriopedia_descriptionnew optional :: LocalisedString

Provides additional description used in factoriopedia.

Provides additional description used in factoriopedia.

subgroupnew optional :: ItemSubGroupID

The name of an ItemSubGroup.

The name of an ItemSubGroup.

hiddennew optional :: bool
hidden_in_factoriopedianew optional :: bool
parameternew optional :: bool

Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.

Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.

factoriopedia_simulationnew optional :: SimulationDefinition

The simulation shown when looking at this prototype in the Factoriopedia GUI.

The simulation shown when looking at this prototype in the Factoriopedia GUI.

Properties

category :: RecipeCategoryID optional

Default: "crafting"

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.

Example

category = "smelting"

crafting_machine_tint :: RecipeTints optional changed

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 :: array[IconData] optional

Can't be an empty array.

icon :: FileName optional

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

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

Example

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

icon_size :: SpriteSizeType optional

Default: 64

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 :: array[IngredientPrototype] optional

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 :: array[ProductPrototype] optional

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-nuggets", amount = 9},
  {type = "item", name = "gold-nuggets", amount = 1}
}
results = {{type = "fluid", name = "steam", amount = 1, temperature = 165}}

main_product :: string optional

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 :: double optional

Default: 0.5

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 :: double optional

Default: 1

maximum_productivity :: double optional new

Default: 3.0

Must be >= 0.

requester_paste_multiplier :: uint32 optional

Default: 30

overload_multiplier :: uint32 optional

Default: 0

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 :: bool optional

Default: true

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

enabled :: bool optional

Default: true

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 :: bool optional

Default: false

Hides the recipe from item/fluid production statistics.

hide_from_player_crafting :: bool optional

Default: false

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

allow_decomposition :: bool optional

Default: true

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

allow_as_intermediate :: bool optional

Default: true

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

allow_intermediates :: bool optional

Default: true

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

always_show_made_in :: bool optional

Default: false

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 :: bool optional

Default: true

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

always_show_products :: bool optional

Default: false

Whether the products are always shown in the recipe tooltip.

unlock_results :: bool optional

Default: true

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

preserve_products_in_machine_output :: bool optional new

Default: false

result_is_always_fresh :: bool optional new

Default: false

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

allow_consumption_message :: LocalisedString optional new

Default: {"item-limitation.consumption-effect"}

allow_speed_message :: LocalisedString optional new

Default: {"item-limitation.speed-effect"}

allow_productivity_message :: LocalisedString optional new

Default: {"item-limitation.productivity-effect"}

allow_pollution_message :: LocalisedString optional new

Default: {"item-limitation.pollution-effect"}

allow_quality_message :: LocalisedString optional new

Default: {"item-limitation.quality-effect"}

surface_conditions :: array[SurfaceCondition] optional new

hide_from_signal_gui :: bool optional new

Default: unset

allow_consumption :: bool optional new

Default: true

allow_speed :: bool optional new

Default: true

allow_productivity :: bool optional new

Default: false

allow_pollution :: bool optional new

Default: true

allow_quality :: bool optional new

Default: true

allowed_module_categories :: array[ModuleCategoryID] optional new

Default: All module categories are allowed

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

alternative_unlock_methods :: array[TechnologyID] optional new

Examples

{
  type = "recipe",
  name = "iron-plate",
  category = "smelting",
  energy_required = 3.5,
  ingredients = {{type = "item", name = "iron-ore", amount = 1}},
  results = {{type="item", name="iron-plate", amount=1}}
}
{
  type = "recipe",
  name = "coal-liquefaction",
  category = "oil-processing",
  subgroup = "fluid-recipes",
  order = "a[oil-processing]-c[coal-liquefaction]",
  enabled = false,
  energy_required = 5,
  icon = "__base__/graphics/icons/fluid/coal-liquefaction.png",
  icon_size = 32,
  ingredients =
  {
    {type="item", name="coal", amount=10},
    {type="fluid", name="heavy-oil", amount=25},
    {type="fluid", name="steam", amount=50}
  },
  results=
  {
    {type="fluid", name="heavy-oil", amount=35},
    {type="fluid", name="light-oil", amount=15},
    {type="fluid", name="petroleum-gas", amount=20}
  },
  allow_decomposition = false
}

Prototypes

Types

Defines