Prototype/Recipe: Difference between revisions
m (Fixed Types/unsigned) |
No edit summary |
||
Line 24: | Line 24: | ||
'''Type''': [[Types/string]] | '''Type''': [[Types/string]] | ||
The item created by this recipe. Must be the name of an item, such as "iron-gear-wheel". | Can be replaced with the results parameter. The item created by this recipe. Must be the name of an item, such as "iron-gear-wheel". | ||
=== result_count === | === result_count === | ||
Line 30: | Line 30: | ||
Optional. The number of items created by this recipe. The default is 1. | Optional. The number of items created by this recipe. The default is 1. | ||
=== results === | |||
'''Type''': [[Types/table]] | |||
A table containing result names and counts. For example: | |||
<pre> | |||
results= | |||
{ | |||
{type="fluid", name="heavy-oil", amount=3}, | |||
{type="fluid", name="light-oil", amount=3}, | |||
{type="fluid", name="petroleum-gas", amount=4} | |||
}, | |||
</pre> | |||
=== category === | === category === |
Revision as of 14:30, 27 May 2014
Basics
A recipe. It can be a crafting recipe, a smelting recipe, or a custom type of recipe (see Prototype/RecipeCategory).
Properties
type
Type: Types/string
Must be "recipe".
name
Type: Types/string
The unique name of this recipe.
ingredients
Type: Types/table
A table containing ingredient names and counts. For example:
ingredients = {{"iron-stick", 2}, {"iron-plate", 3}}
result
Type: Types/string
Can be replaced with the results parameter. The item created by this recipe. Must be the name of an item, such as "iron-gear-wheel".
result_count
Type: Types/unsigned
Optional. The number of items created by this recipe. The default is 1.
results
Type: Types/table
A table containing result names and counts. For example:
results= { {type="fluid", name="heavy-oil", amount=3}, {type="fluid", name="light-oil", amount=3}, {type="fluid", name="petroleum-gas", amount=4} },
category
Type: Types/string
Optional. The category of this recipe. The default is "crafting". Built-in categories are "crafting" and "smelting"; mods can add other categories. See Prototype/RecipeCategory.
energy_required
Type: Types/unsigned
Optional. The amount of time it takes to make this recipe. The default appears to be 0.5 (confirm).
For crafting recipes, this is the number of seconds it takes to craft. For smelting recipes, this is a percentage of the default smelting time. Most smelting recipes use 100, but steel plates use 500.
enabled
Type: Types/string (!)
Optional. This can be "false" to disable the recipe at the start of the game, or "true" to leave it enabled. The default is "true".
If your recipe is unlocked by a technology, you should set this to "false".