Types/ItemIngredientPrototype: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.17)
(Updated styling of prototype doc migration note)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__An item ingredient definition for a [[Prototype/Recipe]]. Its loading is triggered by the <code>type</code> of a [[Types/IngredientPrototype]] being "item". It can be specified as a table with named or numbered keys, but not a mix of both.
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/types/ItemIngredientPrototype.html https://lua-api.factorio.com/latest/types/ItemIngredientPrototype.html]
 
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
 
 
__NOTOC__An item ingredient definition, for example for a [[Prototype/Recipe]]. Its loading is triggered by the <code>type</code> of a [[Types/IngredientPrototype]] being "item". It can be specified as a table with named or numbered keys, but not a mix of both.


== Mandatory properties ==
== Mandatory properties ==
Line 17: Line 23:
'''Default''': 0
'''Default''': 0


Only loaded if the table is using named keys.
Only loaded if the table is using named keys. Amount of this ingredient that should not be included in the item consumption statistics. Usually used together with an equal catalyst amount on the "product" of the catalyst in the recipe.
 
If this ItemIngredientPrototype is used in a recipe, the catalyst amount is calculated automatically based on the [[Prototype/Recipe#ingredients|ingredients]] and [[Prototype/Recipe#results|results]].[https://factorio.com/blog/post/fff-256]
 
== Example ==
 
<syntaxhighlight lang="lua">
{type="item", name="steel-plate", amount=8}
</syntaxhighlight>


== See also ==
== See also ==
* [[Types/IngredientPrototype]]
* [[Types/IngredientPrototype]]
* [[Types/FluidIngredientPrototype]]
* [[Types/FluidIngredientPrototype]]

Latest revision as of 10:42, 21 September 2023

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/types/ItemIngredientPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.


An item ingredient definition, for example for a Prototype/Recipe. Its loading is triggered by the type of a Types/IngredientPrototype being "item". It can be specified as a table with named or numbered keys, but not a mix of both.

Mandatory properties

name or 1

Type: Types/string

The name of a Prototype/Item.

amount or 2

Type: Types/uint16

Optional properties

catalyst_amount

Type: Types/uint16

Default: 0

Only loaded if the table is using named keys. Amount of this ingredient that should not be included in the item consumption statistics. Usually used together with an equal catalyst amount on the "product" of the catalyst in the recipe.

If this ItemIngredientPrototype is used in a recipe, the catalyst amount is calculated automatically based on the ingredients and results.[1]

Example

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

See also