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.

v0.31:Reactions

From Dwarf Fortress Wiki
Jump to navigation Jump to search
This article is about an older version of DF.

Reactions are moddable crafting formulas. They can be tweaked and added onto to allow smelting of new metals, alloys, and many other products. They can be assigned to specific Entities to allow only certain entities to have access to it.

Currently, a reaction can only result in an object of base quality.


Reaction Makeup

[REACTION:<REACTION_IDENTIFIER>]
[NAME:<REACTION_NAME>]
[BUILDING:<BUILDING_IDENTIFIER>:<BUILDING_KEY>]
<... #Reagents ...>
<... #Products ...>
<... #Reaction Modifiers ...>
<... #Skills ...>

<REACTION_IDENTIFER> - Refers to a unique identifier for the reaction (Used in Entity Raws to allow an Enitity to make use of the reaction.

<REACTION_NAME> - String displayed in the building for the reaction.

<BUILDING_IDENTIFIER - The building at which this reaction can be used. NOTE: SMELTER, KILN, KITCHEN and TANNER seem to be the only non-custom buildings allowed to be specified at this point.[Verify]

<BUILDING_KEY> - The key that is pressed at the building (Such as 'b' for bed at a Carpenter or a block at a Mason's). If two reactions have the same key, then one of them will be assigned a different key, the first alphabetically available at the building.


Reagents

A reagent is some object that is required to produce whatever the intended object is. This is typically something like needing the ore of a metal to smelt bars of it.

Reagent Types

[REAGENT:<Identifier>:<Quantity>:<ITEM_TOKEN>:<ITEM_SUBTYPE>:<MATGLOSS_TOKEN>:<MATGLOSS_SUBTYPE>]
or
[REAGENT:<Identifier>:<Quantity>:<MATGLOSS_TOKEN>:<MATGLOSS_SUBTYPE>]

Type 1: Is used for reactions where a specific type of object is required, such as a BUCKET, SWORD, etc.

Type 2: Is used for when only a material type is needed, such as METAL_ORE for smelter reactions.

<Identifier> - Used to refer to this reagent in the reaction Product.

<Quantity> - Used to refer to the number of individual units of the reagent needed for the reaction. NOTE: If a bar, thread, or cloth is used as the <ITEM_TOKEN>, then this value refers to the PRODUCT_DENSITY of the object (150, 15000, 10000 respectively).

<ITEM_TOKEN> - Refers to the hard coded ITEM_TOKEN that the reagent must be.

<ITEM_SUBTYPE> - Refers to a specific item subtype, defined in the raws, of a specific ITEM_TOKEN, such as TOY:ITEM_TOY_MINIFORGE.

<MATGLOSS_TOKEN> - Refers to the hardcoded material type of the reagent, such as PLANT_MAT, METAL_ORE, etc.

<MATGLOSS_SUBTYPE> - Refers to a specific item subtype, defined in the raws, of a specific MATGLOSS_TOKEN, such as PLANT_MAT:MUSHROOM_HELMET_PLUMP.

Reagent Modifier

A reagent can be modified by attaching one, or more, of the following. The modification is used to narrow the available items that can be used for the reaction.

[REACTION_CLASS:X] - Reagent's MATGLOSS_SUBTYPE must have a REACTION_CLASS of type X attached to it. Such as the various forms of Gypsum having [REACTION_CLASS:GYPSUM] in them.

[HAS_MATERIAL_REACTION_PRODUCT:X] - Reagent's MATGLOSS_SUBTYPE must have a MATERIAL_REACTION_PRODUCT tag. This is used primarily on items that come from a dead, or butchered, animal such as skins or fat for tanning and rendering.

[UNROTTEN] - Reagent must not be rotten, mainly for organic MATGLOSS types.

[BUILDMAT] - Reagent is able to be used to build structures (Stone, Wood, Blocks, Bars?).

[GLASS_MATERIAL] - Reagent has a one of the glass MATGLOSS types.

[FIRE_BUILD_SAFE] - Reagent must be considered fire safe (INORGANIC, excluding COAL types).

[MAGMA_BUILD_SAFE] - Reagent must be considered magma safe (INORGANIC, with a melting point greater than the temperature of Magma.

[CAN_USE_ARTIFACT] - Reagent can be an Artifact.

[WORTHLESS_STONE_ONLY] - Only a stone of value 1 can be used?

[ANY_PLANT_MATERIAL] - Reagent MATGLOSS must be of a plant subtype.

[ANY_SILK_MATERIAL] - Reagent MATGLOSS must be of a silk type.

[ANY_SOAP_MATERIAL] - Reagent MATGLOSS must be of a soap type.

[ANY_LEATHER_MATERIAL] - Reagent MATGLOSS must be of a leather type.

[ANY_BONE_MATERIAL] - Reagent MATGLOSS must be of a bone type.

[ANY_SHELL_MATERIAL] - Reagent MATGLOSS must be of a shell type.

[ANY_TOOTH_MATERIAL] - Reagent MATGLOSS must be of a tooth type.

[ANY_HORN_MATERIAL] - Reagent MATGLOSS must be of a horn type.

[ANY_PEARL_MATERIAL] - Reagent MATGLOSS must be of a pearl type (Excretion from sea creatures?)

[USE_BODY_COMPONENT] - Reagent MATGLOSS must come off a creature's body.

[METAL_ORE] - Reagent MATGLOSS must be a metal ore.

[NOT_WEB] - States that the material cannot be web (For making only plant/adamantine thread?).

[WEB_ONLY] - States that the material has to be web (For making only silk thread?).

[POTASHABLE] - The reagent must be able to be turned into pot ash.

[EMPTY] - If the reagent is a container, it must be empty.

[CONTAINS_LYE] - If the reagent is a container, it must contain LYE.

[NOT_CONTAIN_BARREL_ITEM] - If the reagent is a Barrel, it must not contain an item that has to reside in a barrel (Such as alcohol?).

[BAG] - Reagent has to be a bag.

Products

These are the results of a given reaction. There may be any number of such results.

Product Format

[PRODUCT:<CHANCE>:<QUANTITY>:<ITEM_TOKEN>:<ITEM_SUBTYPE>:<MATGLOSS>:<MATGLOSS_SUBTYPE>]

<CHANCE> - This is the chance (As a percent) that the item described will be created at the building.

<QUANTITY> - This is the number of the item to be created.

(Currently assumed that for each item described by the reaction there is an internal counter, that keeps track of the 'percent' of a complete item at the building. When this counter equals 100, an item is created. So <CHANCE> = 20 and <QUANTITY> = 5 is the same as <CHANCE> = 100 and <QUANTITY> = 1. )

<ITEM_TOKEN> - This is the ITEM_TOKEN of the result.

<ITEM_SUBTYPE> - This is a ITEM_SUBTYPE listed in an actual Raw File.

<MATGLOSS> - This is the MATGLOSS of the item. If you want to use the MATGLOSS information of a Reagent, then this is GET_MATERIAL_FROM_REAGENT:IDENTIFIER, where IDENTIFIER is the reagent's identifier in the reaction.

<MATGLOSS_SUBTYPE> - Refers to a specific item subtype, defined in the raws, of a specific MATGLOSS_TOKEN, such as PLANT_MAT:MUSHROOM_HELMET_PLUMP. If GET_MATERIAL_FROM_REAGENT was used in the MATGLOSS, you can specify a type, or you can state NONE, to recieve the MATGLOSS_SUBTYPE of the reagent.


Product Modifiers

[PRODUCT_TO_CONTAINER:<IDENTIFIER>] - This states that the product should be put into a specific container listed in as a reagent.

<IDENTIFIER> - Refers back to a reagent identifier.

[PRODUCT_DIMENSIONS:<DIMENSION>] - Used to specify the dimensions of the object, primarily for use with bars, threads, and cloth.

<DIMENSION> - The 'size' of the object, for use in reactions that require a certain amount of bars, threads and cloth. 'Normal' size is bars = 150, threads = 15000 and cloth = 10000.[Verify]

Reaction Modifiers

Skills

Bars are entered in increments of 150, where 150 is a bar. Thread is accepted in increments of 15000, where 15000 is a full Thread item. (See: Adamantine) Cloth is unknown.

The new PRODUCT format is:

[PRODUCT:<Percent chance>:<Quantity>:<ITEM_TOKEN>:<ITEM_SUBTYPE>:<MATGLOSS_TOKEN>:<MATGLOSS_SUBTYPE>]

For Bars, [PRODUCT_DIMENSION:150] is added on the end; it is possible that this would also apply to cloth/thread. This multiplies each of the items produced, so that each bar will have the specified dimension.