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 (Rated article "Fine" using the rating script)
(complete list - not all of the reagent modifiers can be used with buildings (rather oddly, REACTION_CLASS does not appear to be allowed))
Line 1: Line 1:
 
{{quality|Fine|16:29, 20 February 2011 (UTC)}}These tokens control the functionality of custom buildings.
 
{{quality|Fine|16:29, 20 February 2011 (UTC)}}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.
  
This works around the bug with critters not rotting by giving you a building to cremate them into ash.
+
{| {{prettytable}}
 +
|- bgcolor="#ddd"
 +
! Token
 +
! Arguments
 +
! Description
  
The raw text for the building itself:
+
|-
 +
| NAME
 +
| name
 +
| The name of the custom building.
  
start tag and lookup ID for adding the building to entities
+
|-
[BUILDING_WORKSHOP:MAGMA_CREMATORIUM]
+
| NAME_COLOR
+
| fg:bg:bright
name to display on menus
+
| The color of the building's name when {{K|q}}uerying it.
[NAME:Magma Crematorium]
 
 
color to use for name
 
[NAME_COLOR:7:0:1]
 
 
dimensions of building
 
[DIM:3:3]
 
 
location where your dwarf will stand while working
 
[WORK_LOCATION:2:3]
 
 
labor used to construct building (can be hard to guess- try running the .exe through a hex editor)
 
[BUILD_LABOR:MASON]
 
 
shortcut in build menu
 
[BUILD_KEY:CUSTOM_SHIFT_C]
 
 
which tiles block movement- 1 blocks, 0 is passable; [BLOCK:line number:tile1:tile2...]
 
[BLOCK:1:0:0:0]
 
[BLOCK:2:0:0:0]
 
[BLOCK:3:0:0:0]
 
 
graphics for unbuilt workshop tiles [TILE:build_state:line:tile1:tile2...]
 
[TILE:0:1:' ':' ':236]
 
[TILE:0:2:' ':236:'/']
 
[TILE:0:3:'|':' ':' ']
 
 
color for unbuilt workshop tiles [COLOR:build_state:line:tile1fg:tile1bg:tile1brightness:...]
 
[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]
 
 
graphics for the rest of the build states
 
[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]
 
 
materials used to construct the
 
workshop [BUILD_ITEM:quantity:item type:item subtype:mat type:mat subtype] tokens
 
[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]
 
  
 +
|-
 +
| DIM
 +
| width:height
 +
| The size of the custom building, in number of tiles.
  
Tokens that are availabe (from hexdump of the exe)
+
|-
BUILDING_FURNACE
+
| WORK_LOCATION
REACTION_CLASS
+
| x:y
HAS_MATERIAL_REACTION_PRODUCT
+
| The tile in which dwarves will stand when they are performing tasks. Upper-left is 1:1.
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.
 
ANY_PEARL_MATERIAL
 
USE_BODY_COMPONENT
 
METAL_ORE
 
MIN_DIMENSION
 
BUILD_ITEM
 
NAME
 
NAME_COLOR
 
BUILD_LABOR
 
DIM
 
WORK_LOCATION
 
BUILD_KEY
 
NEEDS_MAGMA
 
BLOCK
 
TILE
 
  
 +
|-
 +
| BUILD_LABOR
 +
| labor token
 +
| The labor required to build the custom building.
  
I'll come back later to add definitions for these, but many can be found at [[Reactions]]
+
|-
 +
| 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 or 1 for each column (1 = left).
 +
 
 +
|-
 +
| TILE
 +
|
 +
* stage
 +
* row
 +
* tiles...
 +
| Specifies the characters used to represent the custom building. The first parameter is the building stage, varying either from 0 to 3 (0 = awaiting construction, 1 = partially constructed, 2 = nearly constructed, 3 = completed) or from 0 to 1 (0 = awaiting construction, 1 = completed, similar to simple buildings like the {{L|quern}}), 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
 +
|
 +
* quantity
 +
* {{L|item token}} (with subtype)
 +
* {{L|material token}}
 +
| 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 {{L|magma}} in order for the building to function.
 +
|}
 +
 
 +
==Item Modifiers==
 +
Building items have many of the same modifiers as {{L|Reactions#Modifiers|reagents}} in custom reactions.
 +
 
 +
{| {{prettytable}}
 +
|- bgcolor="#dddddd"
 +
! Token
 +
! Meaning
 +
|-
 +
| [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]
 +
| If the item is a container, it must contain LYE.
 +
|-
 +
| [POTASHABLE]
 +
| The item must be able to be turned into potash - thus, it must be either ASH or LYE.
 +
|-
 +
| [NOT_WEB]
 +
| States that the material cannot be a web (For only plant/adamantine thread?).
 +
|-
 +
| [WEB_ONLY]
 +
| States that the material has to be a web (For only silk thread?).
 +
|-
 +
| [EMPTY]
 +
| If the item is a container, it must be empty.
 +
|-
 +
| [NOT_CONTAIN_BARREL_ITEM]
 +
| If the item is a Barrel, it must not contain an item that has to reside in a barrel.  A building which is built from a barrel should probably have both this and [EMPTY].
 +
|-
 +
| [BAG]
 +
| Item has to be a bag. Intended to be used with an item type of BOX, to prevent chests, coffers, and other containers from being used instead.
 +
|-
 +
| [GLASS_MATERIAL]
 +
| Item is made of one of the 3 types of glass.
 +
|-
 +
| [BUILDMAT]
 +
| Item is a general building component - BAR, BLOCKS, BOULDER, or WOOD.
 +
|-
 +
| [FIRE_BUILD_SAFE]
 +
| Item must be considered fire safe - ie. not wood, and not coal.
 +
|-
 +
| [MAGMA_BUILD_SAFE]
 +
| Item must have a melting point greater than the temperature of Magma.
 +
|-
 +
| [CAN_USE_ARTIFACT]
 +
| Item can be an Artifact.
 +
|-
 +
| [WORTHLESS_STONE_ONLY]
 +
| Item is not made of an economic stone.
 +
|-
 +
| [ANY_PLANT_MATERIAL]
 +
| Item material must have any of the [STRUCTURAL_PLANT_MAT], [SEED_MAT], or [LEAF_MAT] tokens.{{verify}}
 +
|-
 +
| [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]
 +
| Unknown
 +
|-
 +
| [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 material must come off a creature's body.
 +
|-
 +
| [NO_EDGE_ALLOWED]
 +
| Item must not have been sharpened
 +
|-
 +
| [NOT_ENGRAVED]
 +
| ?
 +
|-
 +
| [METAL_ORE]
 +
| Item material must be a metal ore.
 +
|-
 +
| [MIN_DIMENSION]
 +
| ?
 +
|-
 +
| [HAS_TOOL_USE:X]
 +
| Item must be a {{L|tool}} with the specific TOOL_USE value. The item type must be TOOL:NONE for this to make any sense.
 +
|}
  
 
{{Category|Modding}}
 
{{Category|Modding}}
 
{{Category|Tokens}}
 
{{Category|Tokens}}

Revision as of 22:05, 1 March 2011

These tokens control the functionality of custom buildings.

All custom buildings are defined as objects of type BUILDING_WORKSHOP or BUILDING_FURNACE.

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.
DIM width:height The size of the custom building, in number of tiles.
WORK_LOCATION x:y The tile in which dwarves will stand when they are performing tasks. Upper-left is 1:1.
BUILD_LABOR labor token The labor required to build the custom building.
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 or 1 for each column (1 = left).
TILE
  • stage
  • row
  • tiles...
Specifies the characters used to represent the custom building. The first parameter is the building stage, varying either from 0 to 3 (0 = awaiting construction, 1 = partially constructed, 2 = nearly constructed, 3 = completed) or from 0 to 1 (0 = awaiting construction, 1 = completed, similar to simple buildings like the Template:L), 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 Template:L in order for the building to function.

Item Modifiers

Building items have many of the same modifiers as Template:L in custom reactions.

Token Meaning
[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] If the item is a container, it must contain LYE.
[POTASHABLE] The item must be able to be turned into potash - thus, it must be either ASH or LYE.
[NOT_WEB] States that the material cannot be a web (For only plant/adamantine thread?).
[WEB_ONLY] States that the material has to be a web (For only silk thread?).
[EMPTY] If the item is a container, it must be empty.
[NOT_CONTAIN_BARREL_ITEM] If the item is a Barrel, it must not contain an item that has to reside in a barrel. A building which is built from a barrel should probably have both this and [EMPTY].
[BAG] Item has to be a bag. Intended to be used with an item type of BOX, to prevent chests, coffers, and other containers from being used instead.
[GLASS_MATERIAL] Item is made of one of the 3 types of glass.
[BUILDMAT] Item is a general building component - BAR, BLOCKS, BOULDER, or WOOD.
[FIRE_BUILD_SAFE] Item must be considered fire safe - ie. not wood, and not coal.
[MAGMA_BUILD_SAFE] Item must have a melting point greater than the temperature of Magma.
[CAN_USE_ARTIFACT] Item can be an Artifact.
[WORTHLESS_STONE_ONLY] Item is not made of an economic stone.
[ANY_PLANT_MATERIAL] Item material must have any of the [STRUCTURAL_PLANT_MAT], [SEED_MAT], or [LEAF_MAT] tokens.[Verify]
[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] Unknown
[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 material must come off a creature's body.
[NO_EDGE_ALLOWED] Item must not have been sharpened
[NOT_ENGRAVED] ?
[METAL_ORE] Item material must be a metal ore.
[MIN_DIMENSION] ?
[HAS_TOOL_USE:X] Item must be a Template:L with the specific TOOL_USE value. The item type must be TOOL:NONE for this to make any sense.