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.

Reaction examples

From Dwarf Fortress Wiki
Jump to navigation Jump to search
This article is about the current version of DF.
Note that some content may still need to be updated.

Reactions seem to be causing people some issues. As such, examples would probably be useful for those who'd like some help creating what they want. When adding a new reaction, make sure to add a line for it in the entity_default file, under the mountain (first section) section. For example, if adding the adamantine wafer reaction, open entity_default, go to the mountain entry (the first one), scroll down until you see [PERMITTED_REACTION:something] (like [PERMITTED_REACTION:TAN_A_HIDE]) and add another line that says [PERMITTED_REACTION:REACTION_NAME], where REACTION_NAME is whatever is stated in the reaction's REACTION tag, so in this case the entry would read [PERMITTED_REACTION:FREE_ADAMANTINE_WAFERS].

Smelter Emulation[edit]

Smelt Hematite Ore[edit]

Simulates the built-in smelting of hematite ore.

[NAME:Smelt hematite to bars]

Results in 4 iron bars, of basic size.

Smelt Galena Ore[edit]

Simulates the built-in smelting of galena ore.

[NAME:Smelt galena to bars]

Results in 4 copper bars, with a 50% chance of a silver bar.

Plant Reactions[edit]

Brew drink from plant[edit]

This is the built-in reaction to brew alcohol from plants.

	[NAME:brew drink from plant]
		[HAS_MATERIAL_REACTION_PRODUCT:DRINK_MAT] only accept plants that have drinks defined
		[FOOD_STORAGE_CONTAINER] barrel or any non-absorbing tool with FOOD_STORAGE

Bucket/Alcohol Reactions[edit]

Weapon Reactions[edit]

Gemstone Long Sword[edit]

Make a long sword out of four rough gemstones of the same type.

[NAME:make gemstone long sword]

Misc Item Reactions[edit]

Craft Windows from Shells[edit]

Turns shells into a window made from that animal's shell.

	[NAME:make shell window]

Cremate Vermin Remains[edit]

Incinerates all those non-rotting vermin remains so they stop cluttering up your hallways.

[NAME:cremate remains]

Results in 1 bar of ash, and also automatically populates itself in an idle smelter like the loom cloth and tan a hide tasks.

Create Adamantine Wafers[edit]

Creates adamantine wafers, pretty self-explanatory.

[NAME:create adamantine wafers]

Create Adamantine Thread[edit]

Again, self-explanatory. Also, trains clothesmaking.

[NAME:create adamantine thread]

Burning furniture and other wooden objects[edit]

The code below lets you burn furniture and other wooden objects at a wood furnace to obtain charcoal. Normally, a new ID is used for a new reaction. The downside of a new reaction is that a map regen is necessary. The example below shows how a reaction ID of a current game (making billon from raw ores) can be used to add a new reaction without having to start over a map.

In the example below, for each piece of wood furniture, 0.25 charcoal is generated. Since custom reactions can't work in the same way as melting metal, 1 bar of charcoal is generated for 4 units of furniture. Since 4 different reagents are used, this does not necessarily need to be 4 beds, but can be 4 diferent wood objects. in the current code, each type of wooden object is elligible, so it is advisable to create an additional wood furnace and link specific stockpiles to this furnace. This allows you to burn low quality items, while preventing your masterpiece beds going up in flames.

the text below replaces the original 'billon making' reaction in data/save/'your save'/raw/objects/reaction_smelter.txt.

[NAME:burn furniture]

An important thing to note is that the code above works with all wood items. Turning every single wooden bolt into 0.25 charcoal is considered cheaty, so it is up to the user to use the code appropiately. If the user wants more than 4 units per unit of charcoal for better balance, the number of reagents can easily be expanded.