v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing Reaction

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Quality|Superior}}
+
{{Quality|Unrated}}
 
{{av}}
 
{{av}}
 
{{Modding}}
 
{{Modding}}
Line 13: Line 13:
  
 
== Anatomy of a reaction ==
 
== Anatomy of a reaction ==
 +
 
Reactions are found within reaction_x files (such as reaction_smelter or reaction_other).  All reaction files must begin with the file name, followed by the <code>[OBJECT:REACTION]</code> token that tells the game that the file contains reaction definitions.
 
Reactions are found within reaction_x files (such as reaction_smelter or reaction_other).  All reaction files must begin with the file name, followed by the <code>[OBJECT:REACTION]</code> token that tells the game that the file contains reaction definitions.
  
Line 24: Line 25:
 
       [FUEL]  
 
       [FUEL]  
 
       [SKILL:<SKILL TOKEN>]
 
       [SKILL:<SKILL TOKEN>]
      [MAX_MULTIPLIER:<multiplier>]
 
 
       [AUTOMATIC]
 
       [AUTOMATIC]
 
       [ADVENTURE_MODE_ENABLED]
 
       [ADVENTURE_MODE_ENABLED]
      [DESCRIPTION:<description>]
 
 
 
* ''[[#Reaction identifier|identifier]]'': The internal ID of the reaction.
 
* ''[[#Reaction identifier|identifier]]'': The internal ID of the reaction.
 
* ''[[#Reaction name|name]]'': The name of the reaction, visible to the player in the Fortress mode or Adventure mode menus.
 
* ''[[#Reaction name|name]]'': The name of the reaction, visible to the player in the Fortress mode or Adventure mode menus.
Line 34: Line 32:
 
* ''[[#Reagents|...reagents...]]'': Zero or more reagents (ingredients) that are required to be in stock for the reaction to be possible.
 
* ''[[#Reagents|...reagents...]]'': Zero or more reagents (ingredients) that are required to be in stock for the reaction to be possible.
 
* ''[[#Products|...products...]]'': Zero or more products that are created from the reaction.
 
* ''[[#Products|...products...]]'': Zero or more products that are created from the reaction.
* ''[[#Fuel|fuel]]'': (optional) If present, the reaction requires charcoal, coke or a magma-powered workshop.
+
* ''[[#fuel|fuel]]'': (optional) If present, the reaction requires charcoal, coke or a magma-powered workshop.
* ''[[#Skill|skill]]'': (optional) The skill required and trained by the reaction.
+
* ''[[#skill|skill]]'': (optional) The skill required and trained by the reaction.
* ''[[#Max multiplier|multiplier]]'': (optional) If present, the reaction will only be done the specified number of times per job; used to limit the output of reactions that accept stacks of items as reagents.
+
* ''[[#automatic|automatic]]'': (optional) If present, the reaction will automatically be enqueued whenever it can possibly be performed.
* ''[[#Automatic|automatic]]'': (optional) If present, the reaction will automatically be enqueued whenever it can possibly be performed.
+
* ''[[#adventure mode|adventure mode]]'': (optional) If present, the reaction can be used by the player in Adventure mode.
* ''[[#Adventure mode enabled|adventure mode enabled]]'': (optional) If present, the reaction can be used by the player in Adventure mode.
 
* ''[[#Description|description]]'': (optional) If present, shows pop-up description when the reaction is selected in workshop (not working in v50).
 
  
 
=== Reaction identifier ===
 
=== Reaction identifier ===
Line 51: Line 47:
 
     [REACTION_NAME:<name>]
 
     [REACTION_NAME:<name>]
  
==== Name ====
+
==== name ====
 
This can be anything at all, and is how the reaction will appear in the job list of the building it is assigned to, and so should describe the reaction. '''Tan a hide''', for example, is the name of the default leather-producing reaction. Generally this should be written as a small descriptive verb phrase, with the first letter capitalized, for consistency with the existing reactions.
 
This can be anything at all, and is how the reaction will appear in the job list of the building it is assigned to, and so should describe the reaction. '''Tan a hide''', for example, is the name of the default leather-producing reaction. Generally this should be written as a small descriptive verb phrase, with the first letter capitalized, for consistency with the existing reactions.
  
Line 58: Line 54:
  
 
     [BUILDING:<building name>:<building key>]
 
     [BUILDING:<building name>:<building key>]
* [[#Building name|''building name:'']] The ID of the building the reaction appears in.
+
* [[#building name|''building name:'']] The ID of the building the reaction appears in.
* [[#Building key|''building key:'']] The hotkey to queue up the reaction in the specified building.
+
* [[#building key|''building key:'']] The hotkey to queue up the reaction in the specified building.
  
==== Building name ====
+
==== building name ====
 
This is the ID of the building where the reaction will be carried out.  Valid building names are as follows:
 
This is the ID of the building where the reaction will be carried out.  Valid building names are as follows:
  
Line 87: Line 83:
 
** SCREW_PRESS - [[Screw press]]
 
** SCREW_PRESS - [[Screw press]]
  
Custom reactions cannot be added to the following buildings:
+
==== building key ====
* JEWELER - [[Jeweler's workshop]]
 
 
 
==== Building key ====
 
 
This defines the shortcut key(s) used to queue up the reaction in the workshop during gameplay in Classic mode only.  It can be NONE for no shortcut, or take the format of CUSTOM_X, where X can be: any uppercase letter, which shows as a lowercase letter in the building UI, eg. "CUSTOM_A" creates the shortcut {{k|a}}; or a valid modifier key (ALT, CTRL, or SHIFT) followed by an uppercase letter, eg. CUSTOM_SHIFT_A.
 
This defines the shortcut key(s) used to queue up the reaction in the workshop during gameplay in Classic mode only.  It can be NONE for no shortcut, or take the format of CUSTOM_X, where X can be: any uppercase letter, which shows as a lowercase letter in the building UI, eg. "CUSTOM_A" creates the shortcut {{k|a}}; or a valid modifier key (ALT, CTRL, or SHIFT) followed by an uppercase letter, eg. CUSTOM_SHIFT_A.
  
Line 98: Line 91:
  
 
Categories can be nested indefinitely—you can have a category within a category within a category within a category within a category within... but as a practical matter, nesting categories more than 2 deep is not recommended.
 
Categories can be nested indefinitely—you can have a category within a category within a category within a category within a category within... but as a practical matter, nesting categories more than 2 deep is not recommended.
 
Categories will be displayed in alphabetical order, first off the file name and then off the category name. 
 
  
 
Categories currently have no effect on adventure mode reactions.
 
Categories currently have no effect on adventure mode reactions.
Line 138: Line 129:
 
     [REAGENT:<name>:<quantity>:<item token>:<material token>][...modifiers...]
 
     [REAGENT:<name>:<quantity>:<item token>:<material token>][...modifiers...]
 
* ''[[#Reagent name|name]]'': The name of the reagent, local to the reaction.
 
* ''[[#Reagent name|name]]'': The name of the reagent, local to the reaction.
* ''[[#Quantity|quantity]]'': The amount of the item that will be used in the reaction.
+
* ''[[#quantity|quantity]]'': The amount of the item that will be used in the reaction.
* ''[[#Item_token|item token]]'': The type (and subtype) of the item you require.
+
* ''[[#item_token|item token]]'': The type (and subtype) of the item you require.
* ''[[#Material_token|material token]]'': The material the item should be made of.
+
* ''[[#material_token|material token]]'': The material the item should be made of.
 
* ''[[#Modifiers|...modifiers...]]'': Zero or more tokens which further clarify the acceptable types when the item type and material types are insufficient to distinguish them.
 
* ''[[#Modifiers|...modifiers...]]'': Zero or more tokens which further clarify the acceptable types when the item type and material types are insufficient to distinguish them.
  
==== <span id="Reagent name">Name</span> ====
+
==== <span id="Reagent name">name</span> ====
  
 
The name field is a small string used to identify the reagent within the reaction. The name is not visible to the player. It is local to the reaction and does not need to be unique across all of the reactions, so you can reuse the same names over and over, although each reagent within the same individual reaction must have a different name.
 
The name field is a small string used to identify the reagent within the reaction. The name is not visible to the player. It is local to the reaction and does not need to be unique across all of the reactions, so you can reuse the same names over and over, although each reagent within the same individual reaction must have a different name.
Line 149: Line 140:
 
Most reagents are simply named '''A''', '''B''', and so forth in default reactions, although names such as '''TOOLSTONE''', '''FLUX''', or '''seeds''' will also work equally well. The PRODUCT may make reference to this name &ndash; for instance, if a container '''B''' is specified as a reagent, PRODUCT_TO_CONTAINER:B specifies that container.
 
Most reagents are simply named '''A''', '''B''', and so forth in default reactions, although names such as '''TOOLSTONE''', '''FLUX''', or '''seeds''' will also work equally well. The PRODUCT may make reference to this name &ndash; for instance, if a container '''B''' is specified as a reagent, PRODUCT_TO_CONTAINER:B specifies that container.
  
==== Quantity ====
+
==== quantity ====
  
How many or how much of this reagent the reaction requires.  For most item types this is just the number of them required.  However, some other item types─specifically bars, cloth, thread, globs, liquids, powder, and sheets of paper or parchment─instead use numbers representing the size of the material within one (or more) of these items. For example, while REAGENT:A:'''''10''''':'''''TOY''''':NONE:NONE:NONE is ten unique, solid toy items, REAGENT:A:'''''10''''':'''''THREAD''''':NONE:NONE:NONE is an extremely tiny portion of a random spool of thread. One can see which items have what size quantities in the description of the [[Reaction#PRODUCT_DIMENSION|PRODUCT_DIMENSION]] token.
+
How many or how much of this reagent the reaction requires.  For most item types this is just the number of them required.  However, some other item types─specifically bars, cloth, thread, globs, liquids, and powder─instead use numbers representing the size of the material within one (or more) of these items. For example, while REAGENT:A:'''''10''''':'''''TOY''''':NONE:NONE:NONE is ten unique, solid toy items, REAGENT:A:'''''10''''':'''''THREAD''''':NONE:NONE:NONE is an extremely tiny portion of a random spool of thread. One can see which items have what size quantities in the description of the [[Reaction#PRODUCT_DIMENSION|PRODUCT_DIMENSION]] token.
  
 
If one of the reagents is in a stack, or the reaction is only using a fraction of the amount of a sized item, the reaction will consume the entire stack, or as much of the sized item as possible, and multiply the product accordingly.  This behaviour can be controlled using the [[Reaction#MAX_MULTIPLIER|MAX_MULTIPLIER]] token.
 
If one of the reagents is in a stack, or the reaction is only using a fraction of the amount of a sized item, the reaction will consume the entire stack, or as much of the sized item as possible, and multiply the product accordingly.  This behaviour can be controlled using the [[Reaction#MAX_MULTIPLIER|MAX_MULTIPLIER]] token.
  
==== Item token ====
+
==== item token ====
  
 
[[Item token]]s are of the form ITEM_TYPE:ITEM_SUBTYPE.
 
[[Item token]]s are of the form ITEM_TYPE:ITEM_SUBTYPE.
Line 167: Line 158:
 
For backwards compatibility, reagents can also accept "METAL_ORE:metal_id" in place of both the item and material tokens—this is equivalent to using the reagent BOULDER:NONE:NONE:NONE with the modifier [METAL_ORE:metal_id] (see below).
 
For backwards compatibility, reagents can also accept "METAL_ORE:metal_id" in place of both the item and material tokens—this is equivalent to using the reagent BOULDER:NONE:NONE:NONE with the modifier [METAL_ORE:metal_id] (see below).
  
==== Material token ====
+
==== material token ====
  
 
[[Material token]]s come in several forms. For most reagents, this will typically be INORGANIC:MATERIAL_ID or NONE:NONE (to allow multiple materials using other modifier tokens).
 
[[Material token]]s come in several forms. For most reagents, this will typically be INORGANIC:MATERIAL_ID or NONE:NONE (to allow multiple materials using other modifier tokens).
  
Some reactions will allow the player to select specific materials after creating the job (or in [[Reaction#material_token_2|some cases]], armor size from the product), by clicking on the magnifying glass icon next to the job in the workshop queue.  To permit this behaviour in your reaction, the reagent materials must be specified as follows:
+
Some reactions will allow the player to select specific materials after creating the job, by clicking on the magnifying glass icon next to the job in the workshop queue.  To permit this behaviour in your reaction, the reagent materials must be specified as follows:
 
{| {{prettytable}}
 
{| {{prettytable}}
 
|- bgcolor="#dddddd"
 
|- bgcolor="#dddddd"
Line 178: Line 169:
 
! Notes
 
! Notes
 
|-
 
|-
| style="vertical-align: top"| BAR<br>BLOCKS<br>BOULDER<br>ROUGH<br>SMALLGEM || style="vertical-align: top"| INORGANIC:NONE || style="vertical-align: top"| These all appear as "stone" in the material selection menu, and list all inorganic materials regardless of any material modifier tokens, eg. [ITEMS_METAL]. BAR and BLOCKS made of organic materials, and BOULDER made of clay, are excluded.
+
| style="vertical-align: top"| BAR<br>BLOCKS<br>BOULDER<br>ROUGH<br>SMALLGEM || style="vertical-align: top"| INORGANIC:NONE || style="vertical-align: top"| These all appear as "stone" in the material selection menu, and list all inorganic materials regardless of any material modifier tokens, eg. [ITEMS_METAL]. BAR and BLOCKS made of organic materials are excluded.
 
|-
 
|-
 
| style="vertical-align: top"| SKIN_TANNED or WOOD || style="vertical-align: top"| NONE:NONE ||  
 
| style="vertical-align: top"| SKIN_TANNED or WOOD || style="vertical-align: top"| NONE:NONE ||  
 
|-
 
|-
| style="vertical-align: top"| Other Item Types || style="vertical-align: top"| NONE:NONE || style="vertical-align: top"| These will appear if a material modifier token other than [ANY_LEATHER_MATERIAL] is included.  
+
| style="vertical-align: top"| Any Item Type || style="vertical-align: top"| NONE:NONE || style="vertical-align: top"| These will appear if a material modifier token other than [ANY_LEATHER_MATERIAL] is included.  
 
|}
 
|}
  
Line 199: Line 190:
 
! Description
 
! Description
 
|-
 
|-
| style="vertical-align: top"| ANY_BONE_MATERIAL
+
| style="vertical-align: top"| REACTION_CLASS
 +
| style="vertical-align: top"|
 +
* CLASS_ID
 +
| Reagent material must have the reaction class specified by CLASS_ID - [[Reaction#Reaction_classes|see below]] for more details.
 +
|-
 +
| style="vertical-align: top"| HAS_MATERIAL_REACTION_PRODUCT
 +
| style="vertical-align: top"|
 +
* PRODUCT_ID
 +
| Reagent material must have the material reaction product specified by PRODUCT_ID - [[Reaction#Material_reaction_products|see below]] for more details.
 +
|-
 +
| style="vertical-align: top"| HAS_ITEM_REACTION_PRODUCT
 +
| style="vertical-align: top"|
 +
* PRODUCT_ID
 +
| Reagent material must have the item reaction product specified by PRODUCT_ID - [[Reaction#Item_reaction_products|see below]] for more details. This can be used interchangeably with HAS_MATERIAL_REACTION_PRODUCT.
 +
|-
 +
| style="vertical-align: top"| CONTAINS
 +
| style="vertical-align: top"|
 +
* [[#Reagent name|Reagent name]]
 +
| Reagent is a container that holds the specified reagent (where ''Reagent name'' is the locally-defined name of the reagent).
 +
|-
 +
| style="vertical-align: top"| UNROTTEN
 
|
 
|
| Reagent material must have the [BONE] token.
+
| Reagent must not be rotten, mainly for organic materials.
 
|-
 
|-
| style="vertical-align: top"| ANY_GEM_MATERIAL
+
| style="vertical-align: top"| CONTAINS_LYE
 
|
 
|
| Reagent material must have the [IS_GEM] token.
+
| Reagent must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE. Use of this token is discouraged, as it does not work with buckets (instead, use [CONTAINS:lye] &mdash; note the colon &mdash; and a corresponding lye reagent [REAGENT:lye:150:LIQUID_MISC:NONE:LYE]).
 
|-
 
|-
| style="vertical-align: top"| ANY_HORN_MATERIAL
+
| style="vertical-align: top"| POTASHABLE (Deprecated)
 
|
 
|
| Reagent material must have the [HORN] token.
+
| Alias for [CONTAINS_LYE].
 
|-
 
|-
| style="vertical-align: top"| ANY_LEATHER_MATERIAL
+
| style="vertical-align: top"| NOT_WEB
 
|
 
|
| Reagent material must have the [LEATHER] token.
+
| Reagent must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 
|-
 
|-
| style="vertical-align: top"| ANY_PEARL_MATERIAL
+
| style="vertical-align: top"| WEB_ONLY
 
|
 
|
| Reagent material must have the [PEARL] token.
+
| Reagent must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 
|-
 
|-
| style="vertical-align: top"| ANY_PLANT_MATERIAL
+
| style="vertical-align: top"| EMPTY
 
|
 
|
| Reagent material must be subordinate to a PLANT object.
+
| If the reagent is a container, it must be empty.
 
|-
 
|-
| style="vertical-align: top"| ANY_SHELL_MATERIAL
+
| style="vertical-align: top"| NOT_CONTAIN_BARREL_ITEM
 
|
 
|
| Reagent material must have the [SHELL] token.
+
| If the reagent is a container, it must not contain [[lye]] or [[milk]]. Not necessary if specifying [EMPTY].
 
|-
 
|-
| style="vertical-align: top"| ANY_SILK_MATERIAL
+
| style="vertical-align: top"| GLASS_MATERIAL
 
|
 
|
| Reagent material must have the [SILK] token.
+
| Reagent material must have the IS_GLASS token. All 3 types of [[glass]] have this token hardcoded.
 
|-
 
|-
| style="vertical-align: top"| ANY_SOAP_MATERIAL
+
| style="vertical-align: top"| BUILDMAT
 
|
 
|
| Reagent material must have the [SOAP] token.
+
| Reagent must be a general [[building material]] - BAR, BLOCKS, BOULDER, or WOOD.
 
|-
 
|-
| style="vertical-align: top"| ANY_STONE_MATERIAL
+
| style="vertical-align: top"| FIRE_BUILD_SAFE
 
|
 
|
| Reagent material must have the [IS_STONE] token.
+
| Reagent material must be solid and stable at temperatures approaching 11000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 
|-
 
|-
| style="vertical-align: top"| ANY_STRAND_TISSUE
+
| style="vertical-align: top"| MAGMA_BUILD_SAFE
 
|
 
|
| Reagent is made of a tissue having TISSUE_SHAPE:STRANDS, intended for matching hair and wool. Must be used with USE_BODY_COMPONENT.
+
| Reagent material must be solid and stable at temperatures approaching 12000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 
|-
 
|-
| style="vertical-align: top"| ANY_TOOTH_MATERIAL
+
| style="vertical-align: top"| CAN_USE_ARTIFACT
 
|
 
|
| Reagent material must have the [TOOTH] token.
+
| Reagent can be an Artifact. Using [PRESERVE_REAGENT] with this is strongly advised.
 
|-
 
|-
| style="vertical-align: top"| ANY_WOOD_MATERIAL
+
| style="vertical-align: top"| IS_CRAFTED_ARTIFACT{{verify}}
 
|
 
|
| Reagent material must have the [WOOD] token.
+
| Reagent item must be an artifact.
 
|-
 
|-
| style="vertical-align: top"| ANY_YARN_MATERIAL
+
| style="vertical-align: top"| NOT_ARTIFACT{{verify}}
 
|
 
|
| Reagent material must have the [YARN] token.
+
| Reagent item must not be an artifact.
 
|-
 
|-
| style="vertical-align: top"| BUILDMAT
+
| style="vertical-align: top"| WORTHLESS_STONE_ONLY
 
|
 
|
| Reagent must be a general [[building material]] - BAR, BLOCKS, BOULDER, or WOOD.
+
| Reagent material must be non-[[economic]].
 
|-
 
|-
| style="vertical-align: top"| CAN_USE_ARTIFACT
+
| style="vertical-align: top"| ANY_WOOD_MATERIAL
 
|
 
|
| Reagent can be an Artifact. Using [PRESERVE_REAGENT] with this is strongly advised.
+
| Reagent material must have the [WOOD] token.
 
|-
 
|-
| style="vertical-align: top"| CONTAINS
+
| style="vertical-align: top"| ANY_STONE_MATERIAL
| style="vertical-align: top"|
+
|
* [[#Reagent name|Reagent name]]
+
| Reagent material must have the [IS_STONE] token.
| Reagent is a container that holds the specified reagent (where ''Reagent name'' is the locally-defined name of the reagent).
 
 
|-
 
|-
| style="vertical-align: top"| CONTAINS_LYE
+
| style="vertical-align: top"| ANY_PLANT_MATERIAL
 
|
 
|
| Reagent must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE. Use of this token is discouraged, as it does not work with buckets (instead, use [CONTAINS:lye] &mdash; note the colon &mdash; and a corresponding lye reagent [REAGENT:lye:150:LIQUID_MISC:NONE:LYE]).
+
| Reagent material must be subordinate to a PLANT object.
 
|-
 
|-
| style="vertical-align: top"| DOES_NOT_ABSORB
+
| style="vertical-align: top"| ANY_SILK_MATERIAL
 
|
 
|
| Reagent material must have ABSORPTION:0
+
| Reagent material must have the [SILK] token.
 
|-
 
|-
| style="vertical-align: top"| DOES_NOT_DETERMINE_PRODUCT_AMOUNT
+
| style="vertical-align: top"| ANY_YARN_MATERIAL
 
|
 
|
| Reagent quantity is ignored for the purposes of producing extra outputs. Typically used for containers so that [[stack]]s of reagents will correctly produce additional outputs.
+
| Reagent material must have the [YARN] token.
 
|-
 
|-
| style="vertical-align: top"| EMPTY
+
| style="vertical-align: top"| ANY_SOAP_MATERIAL
 
|
 
|
| If the reagent is a container, it must be empty.
+
| Reagent material must have the [SOAP] token.
 
|-
 
|-
| style="vertical-align: top"| FIRE_BUILD_SAFE
+
| style="vertical-align: top"| ANY_LEATHER_MATERIAL
 
|
 
|
| Reagent material must be solid and stable at temperatures approaching 11000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
+
| Reagent material must have the [LEATHER] token.
 
|-
 
|-
| style="vertical-align: top"| FOOD_STORAGE_CONTAINER
+
| style="vertical-align: top"| ANY_BONE_MATERIAL
 
|
 
|
| Reagent is either a BARREL or a TOOL with the FOOD_STORAGE use.
+
| Reagent material must have the [BONE] token.
 
|-
 
|-
| style="vertical-align: top"| GLASS_MATERIAL
+
| style="vertical-align: top"| ANY_STRAND_TISSUE
 
|
 
|
| Reagent material must have the IS_GLASS token. All 3 types of [[glass]] have this token hardcoded.
+
| Reagent is made of a tissue having TISSUE_SHAPE:STRANDS, intended for matching hair and wool. Must be used with USE_BODY_COMPONENT.
 
|-
 
|-
| style="vertical-align: top"| HARD_ITEM_MATERIAL
+
| style="vertical-align: top"| ANY_GEM_MATERIAL
 
|
 
|
| Reagent material must have the [ITEMS_HARD] token.
+
| Reagent material must have the [IS_GEM] token.
 
|-
 
|-
| style="vertical-align: top"| HAS_EDGE
+
| style="vertical-align: top"| ANY_SHELL_MATERIAL
 
|
 
|
| Reagent must have an edge.
+
| Reagent material must have the [SHELL] token.
 
|-
 
|-
| style="vertical-align: top"| HAS_ITEM_REACTION_PRODUCT
+
| style="vertical-align: top"| ANY_TOOTH_MATERIAL
| style="vertical-align: top"|
+
|
* PRODUCT_ID
+
| Reagent material must have the [TOOTH] token.
| Reagent material must have the item reaction product specified by PRODUCT_ID - [[Reaction#Item_reaction_products|see below]] for more details. This can be used interchangeably with HAS_MATERIAL_REACTION_PRODUCT.
 
 
|-
 
|-
| style="vertical-align: top"| HAS_MATERIAL_REACTION_PRODUCT
+
| style="vertical-align: top"| ANY_HORN_MATERIAL
| style="vertical-align: top"|
 
* PRODUCT_ID
 
| Reagent material must have the material reaction product specified by PRODUCT_ID - [[Reaction#Material_reaction_products|see below]] for more details.
 
|-
 
| style="vertical-align: top"| HAS_TOOL_USE
 
| style="vertical-align: top"|
 
* [[Tool token#TOOL_USE|TOOL_USE]] value
 
| Reagent must be a [[tool]] with the specific TOOL_USE value. The reagent's item type must be TOOL:NONE for this to make any sense.
 
|-
 
| style="vertical-align: top"| IS_CRAFTED_ARTIFACT{{verify}}
 
 
|
 
|
| Reagent item must be an artifact.
+
| Reagent material must have the [HORN] token.
 
|-
 
|-
| style="vertical-align: top"| IS_DIVINE_MATERIAL
+
| style="vertical-align: top"| ANY_PEARL_MATERIAL
 
|
 
|
| Reagent material must have the [DIVINE] token.
+
| Reagent material must have the [PEARL] token.
 
|-
 
|-
 
| style="vertical-align: top"| IS_SAND_MATERIAL
 
| style="vertical-align: top"| IS_SAND_MATERIAL
Line 331: Line 330:
 
| Reagent material must have the [SOIL_SAND] token.
 
| Reagent material must have the [SOIL_SAND] token.
 
|-
 
|-
| style="vertical-align: top"| MAGMA_BUILD_SAFE
+
| style="vertical-align: top"| IS_DIVINE_MATERIAL
 
|
 
|
| Reagent material must be solid and stable at temperatures approaching 12000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
+
| Reagent material must have the [DIVINE] token.
 
|-
 
|-
| style="vertical-align: top"| METAL_ITEM_MATERIAL
+
| style="vertical-align: top"| USE_BODY_COMPONENT
 
|
 
|
| Reagent material must have the [ITEMS_METAL] token.
+
| Reagent must be a body part (CORPSE or CORPSEPIECE). Must be used even if your reagent item type is CORPSE or CORPSEPIECE, otherwise it will match any item.
|-
 
| style="vertical-align: top"| METAL_ORE
 
| style="vertical-align: top"|
 
* Metal ID
 
| Reagent material must be an ore of the specified metal.
 
|-
 
| style="vertical-align: top"| MIN_DIMENSION
 
| style="vertical-align: top"|
 
* Integer
 
| Reagent's item size must be at least as large as ''Integer''. The reagent's item type must be BAR, POWDER_MISC, LIQUID_MISC, DRINK, THREAD, CLOTH, or GLOB for this to work.  See [[Reaction#PRODUCT_DIMENSION|PRODUCT_DIMENSION]] below.
 
 
|-
 
|-
 
| style="vertical-align: top"| NO_EDGE_ALLOWED
 
| style="vertical-align: top"| NO_EDGE_ALLOWED
Line 353: Line 342:
 
| Reagent must not have an edge, so must be blunt. Sharp stones (produced using knapping) and most types of weapon/ammo can not be used with this token.
 
| Reagent must not have an edge, so must be blunt. Sharp stones (produced using knapping) and most types of weapon/ammo can not be used with this token.
 
|-
 
|-
| style="vertical-align: top"| NOT_ARTIFACT{{verify}}
+
| style="vertical-align: top"| HAS_EDGE
 
|
 
|
| Reagent item must not be an artifact.
+
| Reagent must have an edge.
 
|-
 
|-
| style="vertical-align: top"| NOT_CONTAIN_BARREL_ITEM
+
| style="vertical-align: top"| ON_GROUND
 
|
 
|
| If the reagent is a container, it must not contain [[lye]] or [[milk]]. Not necessary if specifying [EMPTY].
+
| Reagent must be on the ground. Grabs from stockpiles. Does not grab from inventories (workshops, wagon) and causes infinite gathering for reactions in workshop.
 
|-
 
|-
 
| style="vertical-align: top"| NOT_ENGRAVED
 
| style="vertical-align: top"| NOT_ENGRAVED
Line 369: Line 358:
 
| Reagent has not been decorated.
 
| Reagent has not been decorated.
 
|-
 
|-
| style="vertical-align: top"| NOT_PRESSED
+
| style="vertical-align: top"| DOES_NOT_ABSORB
 +
|
 +
| Reagent material must have ABSORPTION:0
 +
|-
 +
| style="vertical-align: top"| FOOD_STORAGE_CONTAINER
 
|
 
|
| Reagent must not be in the SOLID_PRESSED state.
+
| Reagent is either a BARREL or a TOOL with the FOOD_STORAGE use.
 
|-
 
|-
| style="vertical-align: top"| NOT_WEB
+
| style="vertical-align: top"| HARD_ITEM_MATERIAL
 
|
 
|
| Reagent must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
+
| Reagent material must have the [ITEMS_HARD] token.
 
|-
 
|-
| style="vertical-align: top"| ON_GROUND
+
| style="vertical-align: top"| METAL_ITEM_MATERIAL
 
|
 
|
| Reagent must be on the ground. Grabs from stockpiles. Does not grab from inventories (workshops, wagon) and causes infinite gathering for reactions in workshop.
+
| Reagent material must have the [ITEMS_METAL] token.
 
|-
 
|-
| style="vertical-align: top"| POTASHABLE (Deprecated)
+
| style="vertical-align: top"| WOVEN_ITEM
 
|
 
|
| Alias for [CONTAINS_LYE].
+
| Reagent material must be a woven material, eg. plant cloth, silk, yarn. This ''excludes'' CLOTH or THREAD items.
 
|-
 
|-
| style="vertical-align: top"| PRESERVE_REAGENT
+
| style="vertical-align: top"| NOT_PRESSED
 
|
 
|
| Reagent is not destroyed, which is the normal effect, at the completion of the reaction. Typically used for containers.
+
| Reagent must not be in the SOLID_PRESSED state.
 
|-
 
|-
| style="vertical-align: top"| REACTION_CLASS
+
| style="vertical-align: top"| METAL_ORE
 
| style="vertical-align: top"|
 
| style="vertical-align: top"|
* CLASS_ID
+
* Metal ID
| Reagent material must have the reaction class specified by CLASS_ID - [[Reaction#Reaction_classes|see below]] for more details.
+
| Reagent material must be an ore of the specified metal.
 
|-
 
|-
| style="vertical-align: top"| UNROTTEN
+
| style="vertical-align: top"| MIN_DIMENSION
|
+
| style="vertical-align: top"|
| Reagent must not be rotten, mainly for organic materials.
+
* Integer
 +
| Reagent's item size must be at least as large as ''Integer''. The reagent's item type must be BAR, POWDER_MISC, LIQUID_MISC, DRINK, THREAD, CLOTH, or GLOB for this to work.  See [[Reaction#PRODUCT_DIMENSION|PRODUCT_DIMENSION]] below.
 
|-
 
|-
| style="vertical-align: top"| USE_BODY_COMPONENT
+
| style="vertical-align: top"| HAS_TOOL_USE
|
+
| style="vertical-align: top"|
| Reagent must be a body part (CORPSE or CORPSEPIECE). Must be used even if your reagent item type is CORPSE or CORPSEPIECE, otherwise it will match any item.
+
* [[Tool token#TOOL_USE|TOOL_USE]] value
 +
| Reagent must be a [[tool]] with the specific TOOL_USE value. The reagent's item type must be TOOL:NONE for this to make any sense.
 
|-
 
|-
| style="vertical-align: top"| WEB_ONLY
+
| PRESERVE_REAGENT
 
|
 
|
| Reagent must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
+
| Reagent is not destroyed, which is the normal effect, at the completion of the reaction. Typically used for containers.
 
|-
 
|-
| style="vertical-align: top"| WORTHLESS_STONE_ONLY
+
| style="vertical-align: top"| DOES_NOT_DETERMINE_PRODUCT_AMOUNT
 
|
 
|
| Reagent material must be non-[[economic]].
+
| Reagent quantity is ignored for the purposes of producing extra outputs. Typically used for containers so that [[stack]]s of reagents will correctly produce additional outputs.
|-
 
| style="vertical-align: top"| WOVEN_ITEM
 
|
 
| Reagent must be a clothing item made of a woven material, ie. plant, silk, or yarn cloth.
 
 
|}
 
|}
  
Line 426: Line 417:
 
   [PRODUCT:<probability>:<quantity>:<item token>:<material token>][...modifiers...]
 
   [PRODUCT:<probability>:<quantity>:<item token>:<material token>][...modifiers...]
  
==== Probability ====
+
==== probability ====
  
The percentage chance the product will be produced when the reaction is completed. Must be an integer.
+
The percentage chance the product will be produced when the reaction is completed.
  
==== Quantity ====
+
==== quantity ====
  
 
Determines how many of the product will be produced. For the item types AMMO, REMAINS, MEAT, FISH, FISH_RAW, PLANT, PLANT_GROWTH, DRINK, CHEESE, LIQUID_MISC, COIN, and EGG, the resulting items will be created as a single [[stack]], while all other item types will produce multiple individual items.
 
Determines how many of the product will be produced. For the item types AMMO, REMAINS, MEAT, FISH, FISH_RAW, PLANT, PLANT_GROWTH, DRINK, CHEESE, LIQUID_MISC, COIN, and EGG, the resulting items will be created as a single [[stack]], while all other item types will produce multiple individual items.
Line 436: Line 427:
 
If a reaction can take stacks of input items, then it will attempt to perform the reaction enough times to consume as many full sets of reagents as it can—for example, if a reaction "1 piece of meat + 2 pieces of fish -> 3 pieces of cheese" is given a stack of 5 meat and 5 fish, it will produce 6 pieces of cheese and leave 3 meat and 1 fish behind. Using the token DOES_NOT_DETERMINE_PRODUCT_AMOUNT allows a reagent to be excluded from this calculation - for example, with the reaction "1 plant + 1 barrel -> 5 alcohol (into barrel)", using this on the barrel allows the reaction to be performed as "5 plant + 1 barrel -> 25 alcohol" instead of "5 plant + 5 barrel -> 25 alcohol".
 
If a reaction can take stacks of input items, then it will attempt to perform the reaction enough times to consume as many full sets of reagents as it can—for example, if a reaction "1 piece of meat + 2 pieces of fish -> 3 pieces of cheese" is given a stack of 5 meat and 5 fish, it will produce 6 pieces of cheese and leave 3 meat and 1 fish behind. Using the token DOES_NOT_DETERMINE_PRODUCT_AMOUNT allows a reagent to be excluded from this calculation - for example, with the reaction "1 plant + 1 barrel -> 5 alcohol (into barrel)", using this on the barrel allows the reaction to be performed as "5 plant + 1 barrel -> 25 alcohol" instead of "5 plant + 5 barrel -> 25 alcohol".
  
==== Item token ====
+
==== item token ====
  
 
The [[item token]] and subtype of the item you produce.
 
The [[item token]] and subtype of the item you produce.
Line 444: Line 435:
 
For products, this can also be set to CRAFTS:NONE to produce up to three random [[craft]] items. This value cannot be used in any other context.
 
For products, this can also be set to CRAFTS:NONE to produce up to three random [[craft]] items. This value cannot be used in any other context.
  
==== Material token ====
+
==== material token ====
  
 
A [[material token]] describing what the product will be made of.
 
A [[material token]] describing what the product will be made of.
  
 
If you want the product's material to be derived from one of the reagents, and the reagent has a [[Reaction#Material_reaction_products|material reaction product]] defined, you can use GET_MATERIAL_FROM_REAGENT:reagent:REACTION_PRODUCT_ID in place of the material token. You can also specify GET_MATERIAL_FROM_REAGENT:reagent:NONE in order to directly use the reagent's own material.
 
If you want the product's material to be derived from one of the reagents, and the reagent has a [[Reaction#Material_reaction_products|material reaction product]] defined, you can use GET_MATERIAL_FROM_REAGENT:reagent:REACTION_PRODUCT_ID in place of the material token. You can also specify GET_MATERIAL_FROM_REAGENT:reagent:NONE in order to directly use the reagent's own material.
 
Similarly to choosing material types for a reagent, if the item product is armor/clothing, and has the appropriate [[Entity_token#Available_resources|armor token]] in the entity file, you will be able to choose the armor/clothing size for different creatures by clicking the magnifying glass of the workshop task. However, this will only work if the product material is [[Modding pitfalls#My_custom_armor.2Fclothing_reaction_won.27t_let_user_choose_size|cloth leather or certain metals]], and the item is also recognized by the related vanilla workshop reaction{{verify}}.
 
  
 
==== Product modifiers ====
 
==== Product modifiers ====
  
Zero or more tokens which further set the properties or disposition of the resulting product item.
+
Zero or more tokens which further clarify the acceptable types when the item type and material types are insufficient to distinguish them.
  
 
{| {{prettytable}}
 
{| {{prettytable}}
Line 477: Line 466:
 
| style="vertical-align: top"|
 
| style="vertical-align: top"|
 
* Integer
 
* Integer
| Specifies the dimension of the product for those items that use dimensions. For items of type BAR, DRINK, GLOB, LIQUID_MISC, and POWDER_MISC, one item is dimension 150; one item of CLOTH or SHEET is dimension 10000; and one item of THREAD is dimension 15000. Has no effect on any other item types. Note: this is not the actual [[storage]] volume of the product, which is hard-coded by the item token.  
+
| Specifies the size of the product for those items that use sizes. For items of type BAR, DRINK, GLOB, LIQUID_MISC, and POWDER_MISC, one item is size 150; one item of CLOTH is size 10000; and one item of THREAD is size 15000. Has no effect on any other item types. Note: this is not the actual [[storage]] volume of the product, which is hard-coded by the item token.  
 
|-
 
|-
 
| style="vertical-align: top"| PRODUCT_TO_CONTAINER
 
| style="vertical-align: top"| PRODUCT_TO_CONTAINER
Line 483: Line 472:
 
* [[#Reagent name|Name]]
 
* [[#Reagent name|Name]]
 
| Places the product in a container; ''Name'' must be the name of a reagent with the [PRESERVE_REAGENT] token and a container item type.
 
| Places the product in a container; ''Name'' must be the name of a reagent with the [PRESERVE_REAGENT] token and a container item type.
|-
 
| style="vertical-align: top"| PRODUCT_TOKEN
 
| style="vertical-align: top"|
 
* [[#Reagent name|Name]]
 
| Allows the product to be referred to by the given name for the purpose of being passed down as and argument in other tokens, in the same fashion as reagent names.
 
|-
 
| style="vertical-align: top"| TRANSFER_ARTIFACT_STATUS
 
|
 
| style="vertical-align: top"| Transfers artifact status from the reagent to the product.
 
 
|}
 
|}
  
Line 501: Line 481:
 
   [IMPROVEMENT:<probability>:<reagent name>:<improvement type>:<material token>]
 
   [IMPROVEMENT:<probability>:<reagent name>:<improvement type>:<material token>]
  
==== Probability ====
+
==== probability ====
 +
 
 
The percentage chance the improvement will be applied to the reagent when the reaction is completed.
 
The percentage chance the improvement will be applied to the reagent when the reaction is completed.
  
==== Reagent name ====
+
==== reagent name ====
 +
 
 
The [[#Reagent name|name]] of the reagent that will be improved. In order to be meaningful, this reagent must have [PRESERVE_REAGENT].
 
The [[#Reagent name|name]] of the reagent that will be improved. In order to be meaningful, this reagent must have [PRESERVE_REAGENT].
  
==== Improvement type ====
+
==== improvement type ====
 +
 
 
The following improvement types can be used:
 
The following improvement types can be used:
  
Line 532: Line 515:
 
| PAGES
 
| PAGES
 
| Adds pages to a [[book]].
 
| Adds pages to a [[book]].
|-
 
| SPECIFIC
 
| With subtype ROLLERS, adds rollers of <material> to a [[scroll]]; with subtype HANDLE, adds a handle of <material> to an item; with subtype TRACTION_BENCH_CHAIN or TRACTION_BENCH_ROPE adds a chain or rope of <material> to an item.
 
 
|}
 
|}
  
 
All other item improvement tokens (ART_IMAGE, ITEMSPECIFIC, THREAD, CLOTH, SEWN_IMAGE, and ILLUSTRATION) are ignored.
 
All other item improvement tokens (ART_IMAGE, ITEMSPECIFIC, THREAD, CLOTH, SEWN_IMAGE, and ILLUSTRATION) are ignored.
  
==== Material token ====
+
==== material token ====
  
 
A [[material token]] describing what the decoration will be made of.
 
A [[material token]] describing what the decoration will be made of.
Line 547: Line 527:
 
=== Other tokens ===
 
=== Other tokens ===
  
==== Fuel ====
+
==== fuel ====
  
 
The FUEL token means that the reaction requires coke or charcoal to be performed. Fuel is not needed when the reaction is performed at a magma workshop (a [[magma kiln]], [[magma smelter]], or any custom building having [NEEDS_MAGMA]).
 
The FUEL token means that the reaction requires coke or charcoal to be performed. Fuel is not needed when the reaction is performed at a magma workshop (a [[magma kiln]], [[magma smelter]], or any custom building having [NEEDS_MAGMA]).
  
==== Skill ====
+
==== skill ====
  
 
The [[Skill token|skill tokens]] determine what skill the reaction requires and trains; also how quickly skill is gained, how quickly those skill gains raise attributes, and how skill level affects the quality of the reaction product.
 
The [[Skill token|skill tokens]] determine what skill the reaction requires and trains; also how quickly skill is gained, how quickly those skill gains raise attributes, and how skill level affects the quality of the reaction product.
Line 585: Line 565:
 
|}
 
|}
  
==== Max multiplier ====
+
==== automatic ====
 
 
The [MAX_MULTIPLIER:<#>] token specifies how many times to do the reaction. This can be used to limit stacked reagent use to the specified quantity instead of the whole stack.
 
 
 
==== Automatic ====
 
  
 
The AUTOMATIC token means that the reaction will be queued automatically if the reaction reagents are all present.
 
The AUTOMATIC token means that the reaction will be queued automatically if the reaction reagents are all present.
Line 595: Line 571:
 
This token only works with jobs performed at a [[kiln]], [[smelter]], [[tanner's shop]], [[kitchen]], or custom workshop, and [[standing orders]] allow you to limit which ones trigger; custom reactions performed at a [[quern]], [[millstone]]{{verify}}, [[still]]{{verify}} or [[craftsdwarf's workshop]]{{verify}} cannot be made automatic.
 
This token only works with jobs performed at a [[kiln]], [[smelter]], [[tanner's shop]], [[kitchen]], or custom workshop, and [[standing orders]] allow you to limit which ones trigger; custom reactions performed at a [[quern]], [[millstone]]{{verify}}, [[still]]{{verify}} or [[craftsdwarf's workshop]]{{verify}} cannot be made automatic.
  
==== Adventure mode enabled ====
+
==== Adventure Mode enabled ====
  
 
The ADVENTURE_MODE_ENABLED token means that this version of the reaction can be used by the wanderers of Adventure Mode without needing to also give the dwarves at home in a fortress access to it.  When using this token, it will be allowed for adventurers of any race, without editing entity files. This token does not prevent Fortress Mode usage assuming the reaction also has a usable building assigned and is a {{token|PERMITTED_REACTION|entity}} within the entity file.
 
The ADVENTURE_MODE_ENABLED token means that this version of the reaction can be used by the wanderers of Adventure Mode without needing to also give the dwarves at home in a fortress access to it.  When using this token, it will be allowed for adventurers of any race, without editing entity files. This token does not prevent Fortress Mode usage assuming the reaction also has a usable building assigned and is a {{token|PERMITTED_REACTION|entity}} within the entity file.
  
==== Description ====
+
==== max multiplier ====
 +
 
 +
The [MAX_MULTIPLIER:<#>] token specifies how many times to do the reaction. This can be used to limit stacked reagent use to the specified quantity instead of the whole stack.
 +
 
 +
==== description ====
  
 
This feature is exclusive to Classic Mode, as no description window pops up when mousing over reactions in workshops in Premium.
 
This feature is exclusive to Classic Mode, as no description window pops up when mousing over reactions in workshops in Premium.
Line 865: Line 845:
 
| style="vertical-align: top"| {{text anchor|BUILDING}}
 
| style="vertical-align: top"| {{text anchor|BUILDING}}
 
| style="vertical-align: top"|  
 
| style="vertical-align: top"|  
* [[#building name|Building name]]
+
* Building name
* [[#building key|In-building reaction hotkey]]
+
* In-building reaction hotkey
 
|
 
|
 
| style="vertical-align: top"| Sets the building that the reaction will be performed in, and the button used to queue the reaction once that building's menu is accessed in-game.
 
| style="vertical-align: top"| Sets the building that the reaction will be performed in, and the button used to queue the reaction once that building's menu is accessed in-game.
Line 1,162: Line 1,142:
 
* Size
 
* Size
 
| style="vertical-align: top"| Product modifier
 
| style="vertical-align: top"| Product modifier
| style="vertical-align: top"| Specifies the amount of the product for those items that use dimension. For items of type BAR, DRINK, GLOB, LIQUID_MISC, and POWDER_MISC, one item is dimension 150; one item of CLOTH or SHEET is dimension 10000; and one item of THREAD is dimension 15000. Has no effect on any other item types. Note: this is not the actual [[storage]] volume of the product, which is hard-coded by the item token.
+
| style="vertical-align: top"| Specifies the size of the product for those items that use sizes. For items of type BAR, DRINK, GLOB, LIQUID_MISC, and POWDER_MISC, one item is size 150; one item of CLOTH is size 10000; and one item of THREAD is size 15000. Has no effect on any other item types. Note: this is not the actual [[storage]] volume of the product, which is hard-coded by the item token.
  
 
|-
 
|-
Line 1,273: Line 1,253:
  
 
|}
 
|}
 
== Examples ==
 
:''Main articles: [[Reaction Examples]]''
 
  
 
{{Category|Modding}}
 
{{Category|Modding}}
 
{{Category|Tokens}}
 
{{Category|Tokens}}
 
[[ru:Reaction]]
 
[[ru:Reaction]]

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Templates used on this page:

This page is a member of 2 hidden categories: