Dwarf Fortress : Anatomy of a Reaction (as of v31.13)
Reaction refers to the command in the reaction_(whatever) file.
It defines a process by which listed raw materials, called [REAGENT]s, are taken one at a time in listed order to a building (or not in adventure mode), and turned in to a [PRODUCT], giving the worker an increase in a defined skill. They are made up of individual lines that are started by '[' and ended by ']' and contain the parameters for each step of the reaction.
format:
[REACTION:(reaction name in capitals, no spaces, use '_')]
[NAME:(text shown in the building's "add new task" menu or Adventure Mode's action/create menu)]
[ADVENTURE_MODE_ENABLED] or [BUILDING:(building the reaction will appear in):(keyboard shortcut)]
[REAGENT:(reagent 'name' usually single capital letter):(number value of how many):(items type):(item's subtype):(items's matgloss):(item's matgloss subtype)][(additional tags for further item screening/definition)]
[PRODUCT:(percentage chance of success):(number of products made per task):(product's item type):(product's item subtype):(product's matgloss):(product's matgloss subtype)][(additional commands affecting the product)]
[(several misc tags for reaction)]
[SKILL:(skill to be increased by task doer)]
Simple right? The indents on the lines aren't necessary I think, but I do them to make it clear to me where the reaction starts and ends etc.
ok now a breakdown of every step. I'll be using the 'Line #' header for these, they refer to the formatting example above and are not used at all in the creation of reactions, simply as a tool for this tutorial.
----------------------------------------------
LINE 1
[REACTION:(reaction name)]
The easiest part of custom modding.
examples:
[REACTION:BRASS_MAKING]
[REACTION:BLAH]
[REACTION:CUSTOM_101010]
Accepts any name that is composed of all capital letters, numbers and underscores. Has no effect on the actual product itself so can be anything really. Usually named something that defines what the reaction does so the modder (or whoever) can easily refer back to it.
----------------------------------------------
LINE 2
[NAME:(text)]
The (text) is what will show up on the screen in the building "add new task" or adventure mode "create" menus and is usually a descriptor of what the reaction produces (and sometimes the materials, especially if you have multiple methods of making the same product).
examples:
[NAME:make soap]
[NAME:make brass bars (use ore)]
[NAME:make brass bars (use bars)]
----------------------------------------------
LINE 3
[ADVENTURE_MODE_ENABLED] or [BUILDING:(building name):(keyboard shortcut)]
Can only be one of these arguments.
Reactions with the [ADVENTURE_MODE_ENABLED] line will only work in Adventure Mode. They will appear in the "create" section of the action menu. Keyboard shortcuts are not defined in the reaction for adventure Mode, but in the key binding main menu (or at least I think they can be bound there, either way they can't be defined in the reaction).
Reactions with the [BUILDING:(building name):(keyboard shortcut)] only work in Fortress Mode. They will appear in the defined building's "add new task" menu.
Valid (building name) values are SMELTER, KITCHEN, TANNER, KILN, SOAP_MAKER and any custom building name that you may have designed yourself.
The (keyboard shortcut) is in the format of NONE, CUSTOM_(key), CUSTOM_SHIFT_(key), where (key) is always in capital letters. If defined it will add a green representation of the defined key and white colon before the Line 2 [NAME:(text)] entry in the "add new task" screen.
examples:
[BUILDING:SOAP_MAKER:CUSTOM_S]
makes the reaction appear in the SOAP_MAKER building and can be quick selected with the "s" key.
[BUILDING:KILN:CUSTOM_SHIFT_P]
makes the reaction appear in the KILN building and can be quick selected with the shift+"p" key.
[BUILDING:SMELTER:NONE]
makes the reaction appear in the SMELTER building with no quick key.
----------------------------------------------
LINE 4
[REAGENT:(name):(number):(item):(item subtype):(matgloss):(matgloss subtype)][(outside arguments)]
This is the start of the meat and potatoes of your reaction and could probably fill 5 tutorials on its own, but I'll try to do my best to be thorough.
[REAGENT]s are the 'building blocks' of your reactions and represent the raw material used to make the [PRODUCT](s). There can be multiple [REAGENT] lines in any given reaction (or none but those are rare and are usually 'cheats' to get free items or training).
(name)
Usually just a single capital letter, this entry can and usually is referred to in the later [PRODUCT] line for material definitions. You can have as many [REAGENT] lines as you want, just note that each one will define something that is needed/used in the reaction to make the [PRODUCT], though it may not contribute any material itself. The (name) entries on multiple lines DO NOT HAVE TO BE DIFFERENT, but if you have multiple lines with different items/materials but the same (name) entry the LAST one listed will be the one referrenced by any [PRODUCT] material requests for that (name). Therefore it is adviseable to use differnt values for (name) for each [REAGENT] defined. In Adventure Mode, the text for this entry is actually displayed when selecting the defined item for the reaction, so you may want to use a short descriptive entry for this for any Adventure Mode reactions, though capital letters etc. still work fine.
example:
A
B
C
tool stone
hammerstone
(number)
The amount of the item you are about to define that is required. Usually a low number but in special cases can be large values. BAR, POWDER_MISC, CLOTH and THREAD items have differnt formats for how they are measured in units. While most items are 1 item = 1 reagent unit, BARS are 1 BAR = 150 reagent units, POWDER_MISC is 1 item = 150 reagent units, THREAD (and CLOTH I believe not 100% sure though) are 1 item = 15000 reagent units. So having a (number) of 150 for a BAR reagent will only use 1 bar and 15000 for thread will only use 1 thread (or cloth...I think).
example:
1
2
150
15000
(item):(item subtype):(matgloss):(matgloss subtype)][(outside arguments)]
The item type and subtype (if any) of the [REAGENT] as well as the materials it is made of and any outside filters/restrictions independent of the [REAGENT] itself. These are listed later as there are quite alot of them.
----------------------------------------------
LINE 5
[PRODUCT:(number1):(number2):(item):(item subtype):(matgloss):(matgloss subtype)][(outside arguments)]
This line defines the end [PRODUCT] of your reaction, how many are made and from what material (and with outside arguments possibnly where it is stored upon creation). As with the [REAGENT] line, there can be multiple [PRODUCT] lines in any reaction. Each line defines its own separate [PRODUCT](s).
(number1)
The chance, in percent, of the [PRODUCT] actually being made. A value of 100 guarantees success. Values over 100 do not make multiples of the [PRODUCT]. Values under 100 mean that there is a chance to not make anything.
(number 2)
The amount of the [PRODUCT] that is made. [PRODUCT]s are usually single entites in themselves (if you make 10 there will be 10 individual things to stockpile), but certain item types are stacked (up to a specific number which is different for each stackable item type) and may possibly all come out as one or more number of stacks if the (number2) value is greater than 1.
(item):(item subtype):(matgloss):(matgloss subtype)][(outside arguments)]
The item type and subtype (if any) of the [PRODUCT] as well as the materials it is made of and any outside filters/restrictions independent of the [PRODUCT] itself. They follow the same guidelines and use the same values as [REAGENT] variables of the same type. These are listed later as there are quite alot of them.
----------------------------------------------
LINE 6
[(misc reaction parameters)]
These parameters are optional and do not have to be in a reaction. You can have both in one reaction as well if desired.
valid values:
[AUTOMATIC]
As soon as the required reagent(s) are available the reaction will be performed. No input is required from the player.
[FUEL]
Coke or charcoal is required for this reaction to take place.
----------------------------------------------
LINE 7
[SKILL:(text)]
Defines the skill that will be improved by the dwarf performing the reaction. Only one can be used (or at least when I tried to do multiples it crashed the game).
valid values:
MINING
WOODCUTTING
CARPENTRY
DETAILSTONE
MASONRY
PROCESSFISH
TRAPPING
WEAVING
BREWING
ALCHEMY
CLOTHESMAKING
MILLING
PROCESSPLANTS
CHEESEMAKING
HERBALISM
CUTGEM
ENCRUSTGEM
WOODCRAFT
STONECRAFT
METALCRAFT
LEATHERWORK
BONECARVE
AXE
SWORD
MISC_WEAPON
DAGGER
MACE
HAMMER
SPEAR
CROSSBOW
SHIELD
ARMOR
PIKE
WHIP
BOW
BLOWGUN
THROW
MECHANICS
MAGIC_NATURE
SNEAK
DESIGNBUILDING
DRESS_WOUNDS
SET_BONE
SUTURE
CRUTCH_WALK
WOOD_BURNING
SOAP_MAKING
SWIMMING
NEGOTIATION
JUDGING_INTENT
APPRAISAL
ORGANIZATION
RECORD_KEEPING
INTIMIDATION
CONVERSATION
COMEDY
FLATTERY
CONSOLE
PACIFY
TRACKING
KNOWLEDGE_ACQUISITION
CONCENTRATION
SITUATIONAL_AWARENESS
PROSE
READING
SPEAKING
COORDINATION
LEADERSHIP
TEACHING
MELEE_COMBAT
RANGED_COMBAT
WRESTLING
BITE
GRASP_STRIKE
STANCE_STRIKE
DODGING
----------------------------------------------
Valid ITEM and ITEM SUBTYPE Values
There are alot (yes ALOT) of different valid values for these variables, and they are mostly shared by both [REAGENT]s and [PRODUCT]s.
NOTE: if your [REAGENT] is a piece of furniture, only stockpiled/un set-up furniture will be used. As well, only building materials (BOULDER, BLOCKS, etc.) that are stockpiled will be used (no they won't tear the building down to recycle itself).
ITEM TYPE ITEM SUBTYPE(s) NOTES (text formatting etc.)
BAR none (material) bars, dimension 150
SMALLGEM none (material)
BLOCKS none (material) blocks
ROUGH none rough (material)
BOULDER none (material) boulder
WOOD none (material) wood
DOOR none (material) door/portal
the item's material further defines it:
WOOD = door
STONE or METAL (or any other INORGANIC) = door
GLASS = portal
FLOODGATE none (material) floodgate
HATCH_COVER none (material) hatch
GRATE none (material) grate
BED none (material) bed
TRACTION_BENCH none (material) traction bench
CHAIR none (material) throne/chair
the item's material further defines it:
WOOD = chair
STONE or METAL (or any other INORGANIC) = throne
GLASS = throne
CHAIN none (material) rope/chain
the item's material further defines it:
cloth = rope
METAL = chain
FLASK none container (liquid)
(material) flask/waterskin/vial
the item's material further defines it:
LEATHER = waterskin
METAL = flask
GLASS = vial
GOBLET none (material) goblet
INSTRUMENT ITEM_INSTRUMENT_FLUTE (material) flute
ITEM_INSTRUMENT_TRUMPET (material) trumpet
ITEM_INSTRUMENT_HARP (material) harp
ITEM_INSTRUMENT_DRUM (material) drum
ITEM_INSTRUMENT_PICCOLO (material) piccolo
ITEM_INSTRUMENT_(custom defined)
TOY ITEM_TOY_PUZZLEBOX (material) puzzlebox
ITEM_TOY_BOAT (material) boat
ITEM_TOY_AXE (material) axe
ITEM_TOY_MINIFORGE (material) miniforge
ITEM_TOY_HAMMER (material) hammer
ITEM_TOY_(custom defined)
WINDOW none (material) window
CAGE none (material) cage/terrarium/aquarium
the item's material further defines it:
WOOD = cage
METAL = cage
GLASS = terrarium/aquarium
BARREL none container (many), (material) barrel
BUCKET none container (many), (material) bucket
ANIMALTRAP none (material) animal trap
TABLE none (material) table
COFFIN none (material) coffin/sarcophagus
the item's material further defines it:
WOOD = coffin
STONE or METAL (or any other INORGANIC) = sarc.
GLASS = coffin
STATUE none (material) statue
QUERN none (material) quern
MILLSTONE none (material) millstone
CORPSE none (material) corpse
WEAPON ITEM_WEAPON_AXE_BATTLE (material) battle axe
ITEM_WEAPON_HAMMER_WAR (material) warhammer
ITEM_WEAPON_BOW (material) bow
ITEM_WEAPON_CROSSBOW (material) crossbow
ITEM_WEAPON_BLOWGUN (material) blowgun
ITEM_WEAPON_WHIP (material) whip
ITEM_WEAPON_SWORD_SHORT (material) short sword
ITEM_WEAPON_MACE (material) mace
ITEM_WEAPON_SPEAR (material) spear
ITEM_WEAPON_PIKE (material) pike
ITEM_WEAPON_AXE_GREAT (material) greataxe
ITEM_WEAPON_SCOURGE (material) scourge
ITEM_WEAPON_PICK (material) pick
ITEM_WEAPON_HALBERD (material) halberd
ITEM_WEAPON_MAUL (material) maul
ITEM_WEAPON_SWORD_LONG (material) long sword
ITEM_WEAPON_SWORD_2H (material) two-handed sword
ITEM_WEAPON_DAGGER_LARGE large (material) dagger
ITEM_WEAPON_FLAIL (material) flail
ITEM_WEAPON_MORNINGSTAR (material) morningstar
ITEM_WEAPON_SCIMITAR (material) scimitar
ITEM_WEAPON_AXE_TRAINING (material) training axe
ITEM_WEAPON_SPEAR_TRAINING (material) training spear
ITEM_WEAPON_SWORD_SHORT_TRAINING (material) training sword
ITEM_WEAPON_(custom defined)
ARMOR ITEM_ARMOR_BREASTPLATE (material) breastplate
ITEM_ARMOR_SHIRT (material) shirt
ITEM_ARMOR_MAIL_SHIRT (material) mail shirt
ITEM_ARMOR_LEATHER (material) leather
ITEM_ARMOR_DRESS (material) dress
ITEM_ARMOR_ROBE (material) robe
ITEM_ARMOR_TUNIC (material) tunic
ITEM_ARMOR_CLOAK (material) cloak
ITEM_ARMOR_CAPE (material) cape
ITEM_ARMOR_VEST (material) vest
ITEM_ARMOR_COAT (material) coat
ITEM_ARMOR_(custom defined)
SHOES ITEM_SHOES_SHOES (material) shoe
ITEM_SHOES_BOOTS (material) high boot
ITEM_SHOES_BOOTS_LOW (material) low boot
ITEM_SHOES_SANDALS (material) sandal
ITEM_SHOES_SOCKS (material) sock
ITEM_SHOES_CHAUSSES (material) chausse
ITEM_SHOES_(custom defined)
HELM ITEM_HELM_HELM (material) helm
ITEM_HELM_CAP (material) cap
ITEM_HELM_MASK (material) mask
ITEM_HELM_HOOD (material) hood
ITEM_HELM_TURBAN (material) turban
ITEM_HELM_VEIL_HEAD (material) head veil
ITEM_HELM_VEIL_FACE (material) face veil
ITEM_HELM_SCARF (material) headscarf
ITEM_HELM_(custom defined)
GLOVES ITEM_GLOVES_GAUNTLETS (material) gauntlet
ITEM_GLOVES_GLOVES (material) glove
ITEM_GLOVES_MITTENS (material) mitten
ITEM_GLOVES_(custom defined)
BOX none container (many)
(material) coffer/chest/bag
the item's material further defines it:
WOOD = chest
STONE or METAL (or any other INORGANIC) = coffer
GLASS = coffer
CLOTH or LEATHER = bag
BIN none container (many) (material) bin
ARMORSTAND none (material) armor stand
WEAPONRACK none (material) weapon rack
CABINET none (material) cabinet
FIGURINE none (material) figyrine
AMULET none (material) amulet
SCEPTER none (material) scepter
AMMO ---- stacks
ITEM_AMMO_BOLTS (material) bolt(s)
ITEM_AMMO_ARROWS (material) arrow(s)
ITEM_AMMO_BLOWDARTS (material) blowdart(s)
ITEM_AMMO_(custom defined)
CROWN none (material) crown
RING none (material) ring
EARRING none (material) earring
BRACELET none (material) brcelet
GEM none rough (material)
ANVIL none (material) anvil
CORPSEPIECE none (material) ?
REMAINS none (material) remains
MEAT none stacks, (material) meat
FISH_RAW none stacks, raw (material)
VERMIN none (material)
PET none (material)
SEEDS none (material) seed
SKIN_TANNED none (material) leather
LEAVES none stacks, (material) leaves
TOTEM none (material) totem
PANTS ITEM_PANTS_PANTS (material) trousers
ITEM_PANTS_LEGGINGS (material) leggings
ITEM_PANTS_GREAVES (material) greaves
ITEM_PANTS_SKIRT (material) skirt
ITEM_PANTS_SKIRT_SHORT (material) short skirt
ITEM_PANTS_SKIRT_LONG (material) long skirt
ITEM_PANTS_BRAIES (material) braies
ITEM_PANTS_THONG (material) thong
ITEM_PANTS_LOINCLOTH (material) loincloth
ITEM_PANTS_(custom defined)
BACKPACK none container (any edible), (material) backpack
QUIVER none container (ammo), (material) quiver
SPLINT none (material) splint
ORTHOPEDIC_CAST none (material) ?
CRUTCH none (material) crutch
CATAPULTPARTS none (material) catapult parts
BALLISTAPARTS none (material) ballista parts
SIEGEAMMO ITEM_SIEGEAMMO_BALLISTA (material) ballista arrows
(custom defined)
BALLISTAARROWHEAD none (material) ballista arrowhead
TRAPPARTS none (material) mechanism
TRAPCOMP ITEM_TRAPCOMP_GIANTAXEBLADE giant (material) axe blade
ITEM_TRAPCOMP_ENORMOUSCORKSCREW enormous (material) corkscrew
ITEM_TRAPCOMP_SPIKEDBALL spiked (material) ball
ITEM_TRAPCOMP_LARGESERRATEDDISC large, serrated (material) disc
ITEM_TRAPCOMP_MENACINGSPIKE menacing (material) spike
ITEM_TRAPCOMP_(custome defined)
DRINK none stacks, (material)
POWDER_MISC none stacks, (material)
CHEESE none stacks, (material) cheese
LIQUID_MISC none stacks, (material)
COIN none stacks, (material) coin
GLOB none stacks, (material)
ROCK none small (material) rock
PIPE_SECTION none (material) pipe section/tube
the item's material further defines it:
WOOD = pipe section
METAL = pipe section
GLASS = tube
PLANT none stacks (max 5), (material) plant
CREATURE none (material), broken kinda...
SEWN_IMAGE none (material) image
CLOTH none (material) cloth, dimension 15000 (I think)
THREAD none (material) thread, dimension 15000
----------------------------------------------
Valid MATGLOSS and MATGLOSS SUBTYPE Values
NONE:NONE will use any material
AMBER:NONE will use any amber material
CORAL:NONE will use any coral material
GLASS_GREEN:NONE will use any green glass material
GLASS_CLEAR:NONE will use any clear glass material
GLASS_CRYSTAL:NONE will use any crystal glass material
POTASH:NONE will use potash material
ASH:NONE will use ash material
PEARLASH:NONE will use pearlash material
LYE:NONE will use lye material
MUD:NONE will use any mud material
VOMIT:NONE will use any vomit material
FILTH_B:NONE a brown solid
FILTH_Y:NONE heh as pointed out that's yellow liquid
UNKNOWN_SUBSTANCE:NONE and a white liquid associated with tentacle monsters
GRIME:NONE ?
STONE:NONE will use any STONE, METAL or INORGANIC material (should be any STONE but isn't)
STONE:(type) will use specified type of STONE material
valid STONE subtype values: alot... any stone or gem (and probably any metal too) defined in the inorganic_stone_ files
METAL:NONE will use any STONE, METAL or INORGANIC material (should be any METAL but isn't)
METAL:(type) will use specified type of METAL material
valid METAL subtype values: IRON
GOLD
SILVER
COPPER
NICKEL
ZINC
BRONZE
BRASS
STEEL
PIG_IRON
PLATINUM
ELECTRUM
TIN
PEWTER_FINE
PEWTER_TRIFLE
PEWTER_LAY
LEAD
ALUMINUM
NICKEL_SILVER
BILLION
STERLING_SILVER
BLACK_BRONZE
ROSE_GOLD
BISMUTH
BISMUTH_BRONZE
ADAMANTINE
(custom defined METAL)
INORGANIC:NONE will use any STONE, METAL or INORGANIC material
INORGANIC:(type) will use specified INORGANIC material
valid INORGANIC subtype values: PLASTER, any METAL matgloss subtype, any STONE matgloss subtype or any (custom inorganic)
COAL:NONE will use any COAL material (coke or charcoal)
COAL:COKE will only use coke
COAL:COAL will only use charcoal
GET_MATERIAL_FROM_REAGENT:NONE:NONE will default to NONE:NONE
GET_MATERIAL_FROM_REAGENT:(name):NONE will use the matgloss value of the last [REAGENT:(name)...] with no subtype
GET_MATERIAL_FROM_REAGENT:NONE:(specified) will default to NONE:NONE
valid GET_MAT_ subtype values: any value that would be valid for the specified [REAGENT] matgloss
NOTE: the GET_MATERIAL_FROM_REAGENT matgloss is only used in [PRODUCT] material fields, not in [REAGENT]s.
PLANT_MAT:NONE:NONE will default to NONE:NONE (should be any plant material)
PLANT_MAT:(type):NONE will use specified plant with no matgloss subtype
PLANT_MAT:NONE:WOOD will default to NONE:NONE (but I wish it did any WOOD material)
PLANT_MAT:NONE:(specified) will default to NONE:NONE (should be the specified matgloss subtype from any plant)
valid PLANT_MAT subtype values: STRUCTURAL
DRINK
MILL
LEAVES
SEED
EXTRACT
WOOD
THREAD
(sustom defined)
CREATURE_MAT:NONE:NONE will default to NONE:NONE (should be any creature material)
CREATURE_MAT:(type):NONE will use specified creature with no matgloss subtype
CREATURE_MAT:NONE:(specified) will default to NONE:NONE (should be the specified matgloss subtype from any creature)
valid CREATURE_MAT subtype values:
BLOOD
HORN
HOOF
SHELL
EYE
EXTRACT
BRAIN
LUNG
SPLEEN
ICHOR
GOO
LIVER
HEART
PANCREAS
SLIME
PEARL
BONE
NERVE
SILK
SKIN
KIDNEY
GUT
CARTILAGE
STOMACH
FEATHER
TOOTH
MILK
PUS
CHEESE
CHITIN
SCALE
NAIL
FAT
TALLOW
MUSCLE
HAIR
LEATHER
TAN_MAT
TALLOW
SOAP_MAT
SOAP
(custom defined)
----------------------------------------------
[REAGENT] line valid [(outside elements)]
These are added after the [REAGENT] has been defined and are usually conditional filters or material filters that further help define the [REAGENT].
valid values:
[PRESERVE_REAGENT] [REAGENT] is not destroyed in reaction
[EMPTY] [REAGENT] if a container, must be empty
[CONTAINS_LYE] [REAGENT] if a container, must have lye in it
[BAG] [REAGENT] must be a bag
[ANY_PLANT_MATERIAL] [REAGENT) must be a plant material
[ANY_SILK_MATERIAL] [REAGENT) must be a silk material
[GLASS_MATERIAL] [REAGENT) must be a glass material
[ANY_BONE_MATERIAL] [REAGENT) must be a bone material
[ANY_HORN_MATERIAL] [REAGENT) must be a horn material
[ANY_TOOTH_MATERIAL] [REAGENT) must be a tooth material
[ANY_SOAP_MATERIAL] [REAGENT) must be a soap material
[ANY_SHELL_MATERIAL] [REAGENT) must be a shell material
[ANY_PEARL_MATERIAL] [REAGENT) must be a pearl material
[ANY_LEATHER_MATERIAL] [REAGENT) must be a leather material
[NOT_WEB] [REAGENT] cannot be a web
[WEB_ONLY] [REAGENT] must be a web
[POTASHABLE] [REAGENT] must be able to be turned in to potash (i.e. must be ash or lye)
[BUILDMAT] [REAGENT] must be a building material (STONE, WOOD, BLOCKS, BARS]
[CAN_USE_ARTIFACT] [REAGENT] may be an artifact
[WORTHLESS_STONE_ONLY] [REAGENT] follows the economic stone restrictions
[METAL_ORE] [REAGENT] must be a metal ore
[UNROTTEN] [REAGENT] must be unrotten
[USE_BODY_COMPONENT] [REAGENT] must be a body component
[FIRE_BUILD_SAFE] [REAGENT] must be considered fire safe (no wood or coal)
[MAGMA_BUILD_SAFE] [REAGENT] must be magma safe (melting point higher than magma)
[NO_EDGE_ALLOWED] [REAGENT] must be blunt (used for Adventure Mode ROCK knapping [REAGENT]s)
[REACTION_CLASS:(text)] [REAGENT] matgloss must contain [REACTION_CLASS:(text)]
valid values for (text): FLUX
TALLOW
GYPSUM
FAT
MILK
SOAP
(custom defined)
[HAS_MATERIAL_REACTION_PRODUCT:(text)] [REAGENT] matgloss must contain [MATERIAL_REACTION_PRODUCT:(text)]
valid values for (text): TAN_MAT
SOAP_MAT
CHEESE_MAT
RENDER_MAT
(custom defined)
Those last 2 are a tutorial in themselves.
----------------------------------------------
[PRODUCT] line valid [(outside elements)]
These are added to the end of the [PRODUCT] line, after the [PRODUCT] has been defined.
[PRODUCT_TO_CONTAINER:(name)] [PRODUCT] will be placed inside container [REAGENT:(name),,,]
Used on powder and liquid [PRODUCT](s) so they don't just spill on the ground when made.
[PRODUCT_DIMENSION:(number)] [PRODUCT] will have each single item produced be (number) reagent units large.
Used with POWDER_MISC [PRODUCT] (number) = 150
Used with BAR [PRODUCT] (number) = 150
Used with THREAD [PRODUCT] (number) = 15000
Used with CLOTH [PRODUCT] (number) = 15000 (I think but I'm not 100% sure, I usually let the game's hard coded mechanic make my cloth)
[FORCE_EDGE] gives non-weapon material an EDGE value (for Adventure Mode knapping]
And there you have it, the Anatomy of a Reaction.
How To Use Your Custom Reactions
You should save all of your custom reactions in their own file (though you can use the reaction_other and reaction_smelter files given with standard DF if you so wish). The file name can really be anything but conventional formatting usually has the filename starting with reaction_(somethingorother). If making a mod the (somethingorother) is usually the name of the mod. The file format is a standard text (.txt) file.
Inside the actual file itself, the first line must be the filename.
So if your file is "reaction_custom", the first line in that file must be "reaction_custom" otherwise it won't work at all.
The next text line inside the file must be [OBJECT:REACTION]. If not, again, your reactions won't work.
From there on you can list your custom reactions however you wish.
The next step is to go to your "entity_default" file (or whatever entity_ file contains the race you are making reactions for). This file contains all the races in dwarf fortress, what weapons they can use, what buildings are available to them etc. It also contains a list of [PERMITTED_REACTION]s. For your chosen race to use the custom reactions you just made you have to add in each and every custom reaction, by name, as a [PERMITTED_REACTION:(reaction name)] line. Custom buildings that have these reactions are also added in this file using the [PERMITTED_BUILDING:(building name)] format. If the buildings and/or reactions are not added to the entity/race, that entity/race will not have access to those buildings and/or reactions. You must put the building in if it has been specified by the reaction to use it, otherwise you won't be able to access the reaction even though its use is permitted. And you must enter all the reactions connected to a specific added building otherwise, even though you can build the building, you won't have access to the reactions.
Any custom files you make for dwarf fortress must be located in the /raw/object directory of the dwarf fortress install before you generate a world in order for them to be available. You cannot add new files to already generated save game worlds, they won't work. You also cannot change any reaction names in an already created world (will crash it) but you can change everything else about the reaction so long as the name stays the same.
Adventure Mode reactions DO NOT have to be added to the entity_* file and are automatically loaded for all playable races.