Factorio API Docs

1.1.55 <>

Class LuaRecipe

A crafting recipe. Recipes belong to forces (see LuaForce) because some recipes are unlocked by research, and researches are per-force.

reload()

Reload the recipe from the prototype.


help()
string

All methods and properties that this object supports.


:: string
[R]

Name of the recipe.


[R]

Localised name of the recipe.



[R]

The prototype for this recipe.


:: boolean
[RW]

Can the recipe be used?


:: string
[R]

Category of the recipe.


:: array[Ingredient]
[R]

Ingredients for this recipe.


:: array[Product]
[R]

The results of this recipe.


:: boolean
[R]

Is the recipe hidden?


:: boolean
[RW]

Is the recipe hidden from flow statistics?


:: double
[R]

Energy required to execute this recipe.


:: string
[R]

Order string.


[R]

Group of this recipe.


[R]

Subgroup of this recipe.


[R]

The force that owns this recipe.


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Methods

reload()

Reload the recipe from the prototype.


help() → string

All methods and properties that this object supports.

Return values

:: string

Attributes

name :: string [Read]

Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item.


localised_name :: LocalisedString [Read]

Localised name of the recipe.


localised_description :: LocalisedString [Read]


prototype :: LuaRecipePrototype [Read]

The prototype for this recipe.


enabled :: boolean [Read/Write]

Can the recipe be used?


category :: string [Read]

Category of the recipe.


ingredients :: array[Ingredient] [Read]

Ingredients for this recipe.

Examples

What the "steel-chest" recipe would return

{{type="item", name="steel-plate", amount=8}}

What the "advanced-oil-processing" recipe would return

{{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}}

products :: array[Product] [Read]

The results of this recipe.


hidden :: boolean [Read]

Is the recipe hidden? Hidden recipe don't show up in the crafting menu.


hidden_from_flow_stats :: boolean [Read/Write]

Is the recipe hidden from flow statistics?


energy :: double [Read]

Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one.


order :: string [Read]

Order string. This is used to sort the crafting menu.


group :: LuaGroup [Read]

Group of this recipe.


subgroup :: LuaGroup [Read]

Subgroup of this recipe.


force :: LuaForce [Read]

The force that owns this recipe.


valid :: boolean [Read]

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.


object_name :: string [Read]

The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.

|<

Classes

Events

Concepts

Defines

Builtin types

>|