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 "v0.31:Building token"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
 
(34 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{quality|Fine|22:04, 2 March 2011 (UTC)}}{{av}}
 +
 
These tokens control the functionality of custom buildings.
 
These tokens control the functionality of custom buildings.
  
A good first try at modding buildings is building a bug burning workshop. http://www.bay12forums.com/smf/index.php?topic=54058.0
+
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.
 
 
This works around the bug with critters not rotting by giving you a building to cremate them into ash.
 
 
 
The raw text for the building itself:
 
 
 
[BUILDING_WORKSHOP:MAGMA_CREMATORIUM]
 
[NAME:Magma Crematorium]
 
[NAME_COLOR:7:0:1]
 
[DIM:3:3]
 
[WORK_LOCATION:2:3]
 
[BUILD_LABOR:MASON]
 
[BUILD_KEY:CUSTOM_SHIFT_C]
 
[BLOCK:1:0:0:0]
 
[BLOCK:2:0:0:0]
 
[BLOCK:3:0:0:0]
 
[TILE:0:1:' ':' ':236]
 
[TILE:0:2:' ':236:'/']
 
[TILE:0:3:'|':' ':' ']
 
[COLOR:0:1:0:0:0:0:0:0:0:0:1]
 
[COLOR:0:2:0:0:0:0:0:1:6:0:0]
 
[COLOR:0:3:6:0:0:0:0:0:0:0:0]
 
[TILE:1:1:236:' ':227]
 
[TILE:1:2:'|':' ':8]
 
[TILE:1:3:' ':' ':236]
 
[COLOR:1:1:0:0:1:0:0:0:0:0:1]
 
[COLOR:1:2:6:0:0:0:0:0:0:0:1]
 
[COLOR:1:3:0:0:0:0:0:0:0:0:1]
 
[TILE:2:1:201:227:187]
 
[TILE:2:2:200:8:188]
 
[TILE:2:3:' ':' ':' ']
 
[COLOR:2:1:0:0:1:0:0:1:0:0:1]
 
[COLOR:2:2:0:0:1:0:0:1:0:0:1]
 
[COLOR:2:3:0:0:0:0:0:0:0:0:0]
 
[TILE:3:1:201:227:187]
 
[TILE:3:2:200:8:188]
 
[TILE:3:3:150:210:253]
 
[COLOR:3:1:0:0:1:0:0:1:0:0:1]
 
[COLOR:3:2:0:0:1:0:4:1:0:0:1]
 
[COLOR:3:3:0:0:1:6:0:0:7:0:1]
 
[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]
 
 
 
Tokens that are availabe (from hexdump of the exe)
 
 
 
BUILDING_FURNACE
 
 
 
REACTION_CLASS
 
 
 
HAS_MATERIAL_REACTION_PRODUCT
 
 
 
UNROTTEN
 
 
 
CONTAINS_LYE
 
 
 
POTASHABLE
 
 
 
NOT_WEB
 
 
 
WEB_ONLY
 
 
 
EMPTY
 
 
 
NOT_CONTAIN_BARREL_ITEM
 
 
 
BAG
 
 
 
GLASS_MATERIAL
 
 
 
BUILDMAT
 
 
 
FIRE_BUILD_SAFE
 
 
 
MAGMA_BUILD_SAFE
 
 
 
CAN_USE_ARTIFACT
 
 
 
WORTHLESS_STONE_ONLY
 
 
 
ANY_PLANT_MATERIAL
 
 
 
ANY_SILK_MATERIAL
 
 
 
ANY_SOAP_MATERIAL
 
 
 
ANY_LEATHER_MATERIAL
 
 
 
ANY_BONE_MATERIAL
 
 
 
ANY_SHELL_MATERIAL
 
 
 
ANY_TOOTH_MATERIAL
 
  
ANY_HORN_MATERIAL.
+
You also must add any new custom buildings to the [[Entity token|civilization]] that you want to use it.
  
ANY_PEARL_MATERIAL
+
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.
  
USE_BODY_COMPONENT
+
{| {{prettytable}}
 +
|- bgcolor="#ddd"
 +
! Token
 +
! Arguments
 +
! Description
  
METAL_ORE
+
|-
 +
| NAME
 +
| name
 +
| The name of the custom building.
  
MIN_DIMENSION
+
|-
 +
| NAME_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.
  
BUILD_ITEM
+
|-
 +
| DIM
 +
| width:height
 +
| The size of the custom building, in number of tiles. Defaults to 3:3. Maximum possible size is 31x31.
  
NAME
+
|-
 +
| 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).
  
NAME_COLOR
+
|-
 +
| 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.<br />For furnaces, this labor does not come into play until after the workshop has been designed by an [[architect]].
  
BUILD_LABOR
+
|-
 +
| BUILD_KEY
 +
| key token
 +
| The shortcut key used in the Build menu for selecting the custom building.
  
DIM
+
|-
 +
| 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.
  
WORK_LOCATION
+
|-
 +
| 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').
  
BUILD_KEY
+
|-
 +
| 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.
  
NEEDS_MAGMA
+
|-
 +
| BUILD_ITEM
 +
|
 +
* quantity
 +
* [[item token]]
 +
* [[material token]]
 +
| Specifies one of the objects necessary to construct the custom building. Each BUILD_ITEM can be followed by zero or more modifiers.
  
BLOCK
+
|-
 +
| 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.
 +
|}
  
TILE
+
==Item Modifiers==
 +
Building items have many of the same modifiers as [[Reactions#Modifiers|reagents]] in custom reactions.
  
 +
{| {{prettytable}}
 +
|- bgcolor="#dddddd"
 +
! Token
 +
! Meaning
 +
|-
 +
| [REACTION_CLASS:X]
 +
| Item's material has a [REACTION_CLASS] token with the appropriate ID.
 +
|-
 +
| [HAS_MATERIAL_REACTION_PRODUCT:X]
 +
| Item's material has a [MATERIAL_REACTION_PRODUCT] token with the appropriate ID.
 +
|-
 +
| [UNROTTEN]
 +
| Item must not be rotten, mainly for organic materials.
 +
|-
 +
| [CONTAINS_LYE]
 +
| Item must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE.
 +
|-
 +
| [POTASHABLE]
 +
| Alias for [CONTAINS_LYE].
 +
|-
 +
| [NOT_WEB]
 +
| Item must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 +
|-
 +
| [WEB_ONLY]
 +
| Item must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
 +
|-
 +
| [EMPTY]
 +
| If the item is a container, it must be empty.
 +
|-
 +
| [NOT_CONTAIN_BARREL_ITEM]
 +
| If the item is a container, it must not contain [[lye]] or [[milk]]. Not necessary if specifying [EMPTY].
 +
|-
 +
| [BAG]
 +
| Item must be a bag - that is, a BOX made of plant fiber, silk, yarn, or leather.
 +
|-
 +
| [GLASS_MATERIAL]
 +
| Item material must have the [IS_GLASS] token. All 3 types of [[glass]] have this token hardcoded.
 +
|-
 +
| [BUILDMAT]
 +
| Item must be a general [[building material]] - BAR, BLOCKS, BOULDER, or WOOD.
 +
|-
 +
| [FIRE_BUILD_SAFE]
 +
| Item material must be stable at temperatures below 11000. Currently broken - requires material's IGNITE_POINT to be set to "NONE". Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 +
|-
 +
| [MAGMA_BUILD_SAFE]
 +
| Item material must be stable at temperatures below 12000. Currently broken - requires material's IGNITE_POINT to be set to "NONE". Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
 +
|-
 +
| [CAN_USE_ARTIFACT]
 +
| Item can be an Artifact.
 +
|-
 +
| [WORTHLESS_STONE_ONLY]
 +
| Item material must be non-[[economic]].
 +
|-
 +
| [ANY_PLANT_MATERIAL]
 +
| Item material must be subordinate to a PLANT object.
 +
|-
 +
| [ANY_SILK_MATERIAL]
 +
| Item material must have the [SILK] token.
 +
|-
 +
| [ANY_YARN_MATERIAL]
 +
| Item material must have the [YARN] token.
 +
|-
 +
| [ANY_SOAP_MATERIAL]
 +
| Item material must have the [SOAP] token.
 +
|-
 +
| [ANY_LEATHER_MATERIAL]
 +
| Item material must have the [LEATHER] token.
 +
|-
 +
| [ANY_BONE_MATERIAL]
 +
| Item material must have the [BONE] 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_SHELL_MATERIAL]
 +
| Item material must have the [SHELL] token.
 +
|-
 +
| [ANY_TOOTH_MATERIAL]
 +
| Item material must have the [TOOTH] token.
 +
|-
 +
| [ANY_HORN_MATERIAL]
 +
| Item material must have the [HORN] token.
 +
|-
 +
| [ANY_PEARL_MATERIAL]
 +
| Item material must have the [PEARL] token.
 +
|-
 +
| [USE_BODY_COMPONENT]
 +
| Item must be a body part (CORPSE or CORPSEPIECE).
 +
|-
 +
| [NO_EDGE_ALLOWED]
 +
| Item must not have an edge - excludes sharp stones (produced using knapping) and most types of weapon/ammo.
 +
|-
 +
| [NOT_ENGRAVED]
 +
| Item has not been engraved (excludes memorial slabs).
 +
|-
 +
| [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.
 +
|-
 +
| [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.
 +
|}
  
I'll come back later to add definitions for these, but many can be found at [[Reactions]]
+
{{Category|Modding}}
 +
{{Category|Tokens}}

Latest revision as of 18:07, 2 February 2012

This article is about an older version of DF.

These 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 b-w menu, while furnaces show up in the b-e 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 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.

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.
For furnaces, this labor does not come into play until after the workshop has been designed by an architect.
BUILD_KEY key token The shortcut key used in the Build menu for selecting the custom building.
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.
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.

Item Modifiers[edit]

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

Token Meaning
[REACTION_CLASS:X] Item's material has a [REACTION_CLASS] token with the appropriate ID.
[HAS_MATERIAL_REACTION_PRODUCT:X] Item's material has a [MATERIAL_REACTION_PRODUCT] token with the appropriate ID.
[UNROTTEN] Item must not be rotten, mainly for organic materials.
[CONTAINS_LYE] Item must be a BARREL or TOOL which contains at least one item of type LIQUID_MISC made of LYE.
[POTASHABLE] Alias for [CONTAINS_LYE].
[NOT_WEB] Item must be collected (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
[WEB_ONLY] Item must be undisturbed (to distinguish silk thread from webs). Only makes sense for items of type THREAD.
[EMPTY] If the item is a container, it must be empty.
[NOT_CONTAIN_BARREL_ITEM] If the item is a container, it must not contain lye or milk. Not necessary if specifying [EMPTY].
[BAG] Item must be a bag - that is, a BOX made of plant fiber, silk, yarn, or leather.
[GLASS_MATERIAL] Item material must have the [IS_GLASS] token. All 3 types of glass have this token hardcoded.
[BUILDMAT] Item must be a general building material - BAR, BLOCKS, BOULDER, or WOOD.
[FIRE_BUILD_SAFE] Item material must be stable at temperatures below 11000. Currently broken - requires material's IGNITE_POINT to be set to "NONE". Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
[MAGMA_BUILD_SAFE] Item material must be stable at temperatures below 12000. Currently broken - requires material's IGNITE_POINT to be set to "NONE". Only works with items of type BAR, BLOCKS, BOULDER, WOOD, and ANVIL - all others are considered unsafe.
[CAN_USE_ARTIFACT] Item can be an Artifact.
[WORTHLESS_STONE_ONLY] Item material must be non-economic.
[ANY_PLANT_MATERIAL] Item material must be subordinate to a PLANT object.
[ANY_SILK_MATERIAL] Item material must have the [SILK] token.
[ANY_YARN_MATERIAL] Item material must have the [YARN] token.
[ANY_SOAP_MATERIAL] Item material must have the [SOAP] token.
[ANY_LEATHER_MATERIAL] Item material must have the [LEATHER] token.
[ANY_BONE_MATERIAL] Item material must have the [BONE] 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_SHELL_MATERIAL] Item material must have the [SHELL] token.
[ANY_TOOTH_MATERIAL] Item material must have the [TOOTH] token.
[ANY_HORN_MATERIAL] Item material must have the [HORN] token.
[ANY_PEARL_MATERIAL] Item material must have the [PEARL] token.
[USE_BODY_COMPONENT] Item must be a body part (CORPSE or CORPSEPIECE).
[NO_EDGE_ALLOWED] Item must not have an edge - excludes sharp stones (produced using knapping) and most types of weapon/ammo.
[NOT_ENGRAVED] Item has not been engraved (excludes memorial slabs).
[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.
[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.