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.

Difference between revisions of "Building token"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
 
(21 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Quality|Superior|21:42, 20 September 2016 (UTC)}}
+
{{Quality|Fine}}
 
{{av}}
 
{{av}}
 +
{{Modding}}
  
'''Building tokens''' control the functionality of custom buildings.
+
'''Building tokens''' control the functionality of custom [[building]]s.
  
All custom buildings are defined as objects of type BUILDING_WORKSHOP or BUILDING_FURNACE; workshops show up in the {{K|b}}-{{K|w}} menu, while furnaces show up in the {{K|b}}-{{K|e}} menu.
+
All custom buildings are defined as objects of type BUILDING_WORKSHOP or BUILDING_FURNACE; [[workshop]]s show up in the Build > Workshops ({{Menu icon|b|o}}) menu, while [[furnace]]s show up in the Build > Workshops > Furnaces ({{Menu icon|b|o|u}}) menu.
You also must add any new custom buildings to the [[Entity token|civilization]] who you want to be using it. Additionally, furnaces must be designed by an [[architect]] before being constructed (and will gain [[quality]] accordingly), though they will always use the labor(s) specified in the building definition, rather than ones based on the materials being used.
+
 
 +
You also must add any new custom buildings to the [[Entity token|civilization]] that you want to use it.
 +
 
 +
Additionally, furnaces must be designed by an [[mason]] before being constructed (and will gain [[quality]] accordingly), though they will always use the labor(s) specified in the building definition, rather than ones based on the materials being used.
 +
{{clear}}
  
 
{| {{prettytable}}
 
{| {{prettytable}}
Line 21: Line 26:
 
| {{text anchor|NAME_COLOR}}
 
| {{text anchor|NAME_COLOR}}
 
| [[Color#Modding_color|fg:bg:bright]]
 
| [[Color#Modding_color|fg:bg:bright]]
| The color of the building's name when {{K|q}}uerying it. Seemingly ignored for furnaces, which are hardcoded to 4:0:1.
+
| The [[color]] of the building's name when {{K|q}}uerying it. Seemingly ignored for furnaces, which are hardcoded to 4:0:1.
  
 
|-
 
|-
Line 36: Line 41:
 
| {{text anchor|BUILD_LABOR}}
 
| {{text anchor|BUILD_LABOR}}
 
| [[labor token]]
 
| [[labor token]]
| The labor required to construct the custom building. If multiple BUILD_LABOR tokens are specified, then any of the indicated labors can be used to construct the building; if none are specified, then no labors are required.<br />For furnaces, this labor does not come into play until after the workshop has been designed by an [[architect]].
+
| The labor required to construct the custom building. If multiple BUILD_LABOR tokens are specified, then any of the indicated labors can be used to construct the building; if none are specified, then no labors are required.
  
 
|-
 
|-
 
| {{text anchor|BUILD_KEY}}
 
| {{text anchor|BUILD_KEY}}
| key token
+
| [[Interface.txt#Key_bindings|key bind]]
| The shortcut key used in the Build menu for selecting the custom building.
+
| The shortcut key used in the Build menu for selecting the custom building. For example: "CUSTOM_SHIFT_S"
  
 
|-
 
|-
Line 64: Line 69:
 
* row
 
* row
 
* colors...
 
* colors...
| Specifies the colors in which the custom building's tiles will be displayed. The first parameter is the building stage, the 2nd parameter is the row number, and subsequent parameters are either sets of 3 numbers (foreground:background:brightness) or the token "MAT" to use the color of the primary building material. MAT may not be available on BUILDING_FURNACEs.{{verify}}
+
| Specifies the [[Color|colors]] in which the custom building's tiles will be displayed. The first parameter is the building stage, the 2nd parameter is the row number, and subsequent parameters are either sets of 3 numbers (foreground:background:brightness), or the token "MAT" to use the color of the primary building material, for each tile in the row. MAT may not be available on BUILDING_FURNACEs.{{verify}} However a color settings of 4:0:1 will translate into MAT for furnaces instead.
  
 
|-
 
|-
Line 78: Line 83:
 
|
 
|
 
| Specifies that one of the building's tiles (other than the WORK_LOCATION) must be hanging over [[magma]] in order for the building to function. Buildings with this token also ignore the [FUEL] token in their reactions.
 
| Specifies that one of the building's tiles (other than the WORK_LOCATION) must be hanging over [[magma]] in order for the building to function. Buildings with this token also ignore the [FUEL] token in their reactions.
 +
|
 +
 +
|-
 +
| {{text anchor|TOOLTIP}}
 +
| tooltip
 +
| Adds a tooltip for the building.
 
|}
 
|}
  
Line 88: Line 99:
 
! Meaning
 
! Meaning
 
|-
 
|-
| [{{text anchor|REACTION_CLASS}}:X]
+
| [{{text anchor|ANY_BONE_MATERIAL}}]
| Item's material has a [REACTION_CLASS] token with the appropriate ID.
+
| Item material must have the [BONE] token.
 +
|-
 +
| [{{text anchor|ANY_HORN_MATERIAL}}]
 +
| Item material must have the [HORN] token.
 +
|-
 +
| [{{text anchor|ANY_LEATHER_MATERIAL}}]
 +
| Item material must have the [LEATHER] token.
 
|-
 
|-
| [{{text anchor|HAS_MATERIAL_REACTION_PRODUCT}}:X]
+
| [{{text anchor|ANY_PEARL_MATERIAL}}]
| Item's material has a [MATERIAL_REACTION_PRODUCT] token with the appropriate ID.
+
| Item material must have the [PEARL] token.
 
|-
 
|-
| [{{text anchor|UNROTTEN}}]
+
| [{{text anchor|ANY_PLANT_MATERIAL}}]  
| Item must not be rotten, mainly for organic materials.
+
| Item material must be subordinate to a PLANT object.
 
|-
 
|-
| [{{text anchor|CONTAINS_LYE}}]
+
| [{{text anchor|ANY_SHELL_MATERIAL}}]
| Item must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE.
+
| Item material must have the [SHELL] token.
 
|-
 
|-
| [{{text anchor|POTASHABLE}}]
+
| [{{text anchor|ANY_SILK_MATERIAL}}]  
| Alias for [CONTAINS_LYE].
+
| Item material must have the [SILK] token.
 
|-
 
|-
| [{{text anchor|NOT_WEB}}]
+
| [{{text anchor|ANY_SOAP_MATERIAL}}]
| Item must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
+
| Item material must have the [SOAP] token.
 
|-
 
|-
| [{{text anchor|WEB_ONLY}}]
+
| [{{text anchor|ANY_STRAND_TISSUE}}]
| Item must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
+
| Item is made of a tissue having [TISSUE_SHAPE:STRANDS], intended for matching hair and wool. Must be used with [USE_BODY_COMPONENT].
 
|-
 
|-
| [{{text anchor|EMPTY}}]
+
| [{{text anchor|ANY_TOOTH_MATERIAL}}]
| If the item is a container, it must be empty.
+
| Item material must have the [TOOTH] token.
 
|-
 
|-
| [{{text anchor|NOT_CONTAIN_BARREL_ITEM}}]
+
| [{{text anchor|ANY_YARN_MATERIAL}}]  
| If the item is a container, it must not contain [[lye]] or [[milk]]. Not necessary if specifying [EMPTY].
+
| Item material must have the [YARN] token.
 
|-
 
|-
 
| [{{text anchor|BAG}}]
 
| [{{text anchor|BAG}}]
 
| Item must be a bag - that is, a BOX made of plant fiber, silk, yarn, or leather.
 
| Item must be a bag - that is, a BOX made of plant fiber, silk, yarn, or leather.
|-
 
| [{{text anchor|GLASS_MATERIAL}}]
 
| Item material must have the [IS_GLASS] token. All 3 types of [[glass]] have this token hardcoded.
 
 
|-
 
|-
 
| [{{text anchor|BUILDMAT}}]
 
| [{{text anchor|BUILDMAT}}]
 
| Item must be a general [[building material]] - BAR, BLOCKS, BOULDER, or WOOD.
 
| Item must be a general [[building material]] - BAR, BLOCKS, BOULDER, or WOOD.
 +
|-
 +
| [{{text anchor|CAN_USE_ARTIFACT}}]
 +
| Item can be an Artifact.
 +
|-
 +
| [{{text anchor|CONTAINS_LYE}}]
 +
| Item must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE.
 +
|-
 +
| [{{text anchor|EMPTY}}]
 +
| If the item is a container, it must be empty.
 
|-
 
|-
 
| [{{text anchor|FIRE_BUILD_SAFE}}]
 
| [{{text anchor|FIRE_BUILD_SAFE}}]
 
| Item material must be stable at temperatures below 11000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 
| Item material must be stable at temperatures below 11000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 
|-
 
|-
| [{{text anchor|MAGMA_BUILD_SAFE}}]
+
| [{{text anchor|GLASS_MATERIAL}}]  
| Item material must be stable at temperatures below 12000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
+
| Item material must have the [IS_GLASS] token. All 3 types of [[glass]] have this token hardcoded.
 
|-
 
|-
| [{{text anchor|CAN_USE_ARTIFACT}}]
+
| [{{text anchor|HAS_MATERIAL_REACTION_PRODUCT}}:X]
| Item can be an Artifact.
+
| Item's material has a [MATERIAL_REACTION_PRODUCT] token with the appropriate ID.
 
|-
 
|-
| [{{text anchor|WORTHLESS_STONE_ONLY}}]
+
| [{{text anchor|HAS_TOOL_USE}}:X]
| Item material must be non-[[economic]].
+
| Item must be a [[tool]] with the specific TOOL_USE value. The item type must be TOOL:NONE for this to make any sense.
 
|-
 
|-
| [{{text anchor|ANY_PLANT_MATERIAL}}]  
+
| [{{text anchor|MAGMA_BUILD_SAFE}}]
| Item material must be subordinate to a PLANT object.
+
| Item material must be stable at temperatures below 12000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 
|-
 
|-
| [{{text anchor|ANY_SILK_MATERIAL}}]  
+
| [{{text anchor|METAL_ORE}}:X]
| Item material must have the [SILK] token.
+
| Item material must be an ore of the specified metal.
 
|-
 
|-
| [{{text anchor|ANY_YARN_MATERIAL}}]  
+
| [{{text anchor|MIN_DIMENSION}}:X]
| Item material must have the [YARN] token.
+
| Item's dimension must be at least this large. The item type must be BAR, POWDER_MISC, LIQUID_MISC, DRINK, THREAD, or CLOTH for this to work.
 
|-
 
|-
| [{{text anchor|ANY_SOAP_MATERIAL}}]
+
| [{{text anchor|NO_EDGE_ALLOWED}}]
| Item material must have the [SOAP] token.
+
| Item 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.
 
|-
 
|-
| [{{text anchor|ANY_LEATHER_MATERIAL}}]
+
| [{{text anchor|NOT_CONTAIN_BARREL_ITEM}}]
| Item material must have the [LEATHER] token.
+
| If the item is a container, it must not contain [[lye]] or [[milk]]. Not necessary if specifying [EMPTY].
 
|-
 
|-
| [{{text anchor|ANY_BONE_MATERIAL}}]
+
| [{{text anchor|NOT_ENGRAVED}}]
| Item material must have the [BONE] token.
+
| Item can not be engraved. For example, a memorial slab can not be engraved.
 
|-
 
|-
| [{{text anchor|ANY_STRAND_TISSUE}}]
+
| [{{text anchor|NOT_WEB}}]
| Item is made of a tissue having [TISSUE_SHAPE:STRANDS], intended for matching hair and wool. Must be used with [USE_BODY_COMPONENT].
+
| Item must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 
|-
 
|-
| [{{text anchor|ANY_SHELL_MATERIAL}}]
+
| [{{text anchor|POTASHABLE}}] (Deprecated)
| Item material must have the [SHELL] token.
+
| Alias for [CONTAINS_LYE].
 
|-
 
|-
| [{{text anchor|ANY_TOOTH_MATERIAL}}]
+
| [{{text anchor|REACTION_CLASS}}:X]
| Item material must have the [TOOTH] token.
+
| Item's material has a [REACTION_CLASS] token with the appropriate ID.
 
|-
 
|-
| [{{text anchor|ANY_HORN_MATERIAL}}]
+
| [{{text anchor|UNROTTEN}}]
| Item material must have the [HORN] token.
+
| Item must not be rotten, mainly for organic materials.
|-
 
| [{{text anchor|ANY_PEARL_MATERIAL}}]
 
| Item material must have the [PEARL] token.
 
 
|-
 
|-
 
| [{{text anchor|USE_BODY_COMPONENT}}]
 
| [{{text anchor|USE_BODY_COMPONENT}}]
 
| Item must be a body part (CORPSE or CORPSEPIECE).
 
| Item must be a body part (CORPSE or CORPSEPIECE).
 
|-
 
|-
| [{{text anchor|NO_EDGE_ALLOWED}}]
+
| [{{text anchor|WEB_ONLY}}]
| Item must not have an edge - excludes sharp stones (produced using knapping) and most types of weapon/ammo.
+
| Item must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 
|-
 
|-
| [{{text anchor|NOT_ENGRAVED}}]
+
| [{{text anchor|WORTHLESS_STONE_ONLY}}]
| Item has not been engraved (excludes memorial slabs).
+
| Item material must be non-[[economic]].
|-
 
| [{{text anchor|METAL_ORE}}:X]
 
| Item material must be an ore of the specified metal.
 
|-
 
| [{{text anchor|MIN_DIMENSION}}:X]
 
| Item's dimension must be at least this large. The item type must be BAR, POWDER_MISC, LIQUID_MISC, DRINK, THREAD, or CLOTH for this to work.
 
|-
 
| [{{text anchor|HAS_TOOL_USE}}:X]
 
| Item must be a [[tool]] with the specific TOOL_USE value. The item type must be TOOL:NONE for this to make any sense.
 
 
|}
 
|}
  

Latest revision as of 21:27, 21 February 2024

This article is about the current version of DF.
Note that some content may still need to be updated.


Building tokens control the functionality of custom buildings.

All custom buildings are defined as objects of type BUILDING_WORKSHOP or BUILDING_FURNACE; workshops show up in the Build > Workshops (Ui b.pngbUi bo.pngo) menu, while furnaces show up in the Build > Workshops > Furnaces (Ui b.pngbUi bo.pngoUi bou.pngu) menu.

You also must add any new custom buildings to the civilization that you want to use it.

Additionally, furnaces must be designed by an mason before being constructed (and will gain quality accordingly), though they will always use the labor(s) specified in the building definition, rather than ones based on the materials being used.

Token Arguments Description
NAME name The name of the custom building.
NAME_COLOR fg:bg:bright The color of the building's name when querying it. Seemingly ignored for furnaces, which are hardcoded to 4:0:1.
DIM width:height The size of the custom building, in number of tiles. Defaults to 3:3. Maximum possible size is 31x31.
WORK_LOCATION x:y The tile (1:1 for upper-left) in which dwarves will stand when they are performing tasks. Defaults to 3:3 (bottom-right).
BUILD_LABOR labor token The labor required to construct the custom building. If multiple BUILD_LABOR tokens are specified, then any of the indicated labors can be used to construct the building; if none are specified, then no labors are required.
BUILD_KEY key bind The shortcut key used in the Build menu for selecting the custom building. For example: "CUSTOM_SHIFT_S"
BLOCK
  • row
  • tiles...
Specifies whether or not each workshop tile blocks movement. The first parameter is the row (1 = top), and each subsequent parameter is a 0 (nonblocking) or 1 (blocking) for each column, left to right.
TILE
  • stage
  • row
  • tiles...
Specifies the characters used to represent the custom building. The first parameter is the building stage, varying from 0 (awaiting construction) to N (completed) where N is between 1 and 3, the 2nd parameter is the row number, and each subsequent parameter is a character number (or literal character enclosed in 'quotes').
COLOR
  • stage
  • row
  • colors...
Specifies the colors in which the custom building's tiles will be displayed. The first parameter is the building stage, the 2nd parameter is the row number, and subsequent parameters are either sets of 3 numbers (foreground:background:brightness), or the token "MAT" to use the color of the primary building material, for each tile in the row. MAT may not be available on BUILDING_FURNACEs.[Verify] However a color settings of 4:0:1 will translate into MAT for furnaces instead.
BUILD_ITEM Specifies one of the objects necessary to construct the custom building. Each BUILD_ITEM can be followed by zero or more modifiers.
NEEDS_MAGMA Specifies that one of the building's tiles (other than the WORK_LOCATION) must be hanging over magma in order for the building to function. Buildings with this token also ignore the [FUEL] token in their reactions.
TOOLTIP tooltip Adds a tooltip for the building.

Item Modifiers[edit]

Building items have many of the same modifiers as reagents in custom reactions.

Token Meaning
[ANY_BONE_MATERIAL] Item material must have the [BONE] token.
[ANY_HORN_MATERIAL] Item material must have the [HORN] token.
[ANY_LEATHER_MATERIAL] Item material must have the [LEATHER] token.
[ANY_PEARL_MATERIAL] Item material must have the [PEARL] token.
[ANY_PLANT_MATERIAL] Item material must be subordinate to a PLANT object.
[ANY_SHELL_MATERIAL] Item material must have the [SHELL] token.
[ANY_SILK_MATERIAL] Item material must have the [SILK] token.
[ANY_SOAP_MATERIAL] Item material must have the [SOAP] token.
[ANY_STRAND_TISSUE] Item is made of a tissue having [TISSUE_SHAPE:STRANDS], intended for matching hair and wool. Must be used with [USE_BODY_COMPONENT].
[ANY_TOOTH_MATERIAL] Item material must have the [TOOTH] token.
[ANY_YARN_MATERIAL] Item material must have the [YARN] token.
[BAG] Item must be a bag - that is, a BOX made of plant fiber, silk, yarn, or leather.
[BUILDMAT] Item must be a general building material - BAR, BLOCKS, BOULDER, or WOOD.
[CAN_USE_ARTIFACT] Item can be an Artifact.
[CONTAINS_LYE] Item must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE.
[EMPTY] If the item is a container, it must be empty.
[FIRE_BUILD_SAFE] Item material must be stable at temperatures below 11000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
[GLASS_MATERIAL] Item material must have the [IS_GLASS] token. All 3 types of glass have this token hardcoded.
[HAS_MATERIAL_REACTION_PRODUCT:X] Item's material has a [MATERIAL_REACTION_PRODUCT] token with the appropriate ID.
[HAS_TOOL_USE:X] Item must be a tool with the specific TOOL_USE value. The item type must be TOOL:NONE for this to make any sense.
[MAGMA_BUILD_SAFE] Item material must be stable at temperatures below 12000. Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
[METAL_ORE:X] Item material must be an ore of the specified metal.
[MIN_DIMENSION:X] Item's dimension must be at least this large. The item type must be BAR, POWDER_MISC, LIQUID_MISC, DRINK, THREAD, or CLOTH for this to work.
[NO_EDGE_ALLOWED] Item 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.
[NOT_CONTAIN_BARREL_ITEM] If the item is a container, it must not contain lye or milk. Not necessary if specifying [EMPTY].
[NOT_ENGRAVED] Item can not be engraved. For example, a memorial slab can not be engraved.
[NOT_WEB] Item must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
[POTASHABLE] (Deprecated) Alias for [CONTAINS_LYE].
[REACTION_CLASS:X] Item's material has a [REACTION_CLASS] token with the appropriate ID.
[UNROTTEN] Item must not be rotten, mainly for organic materials.
[USE_BODY_COMPONENT] Item must be a body part (CORPSE or CORPSEPIECE).
[WEB_ONLY] Item must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
[WORTHLESS_STONE_ONLY] Item material must be non-economic.