- 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.
Difference between revisions of "Graphics token"
m (→Item Graphics: Corrected ADD_TOOL_GRAPHICS description.) |
(There's a minor bug involving light gen in premium's current beta version adv-mode, where its only rendered at a certain range, but its not exactly worth documenting at the present time.) |
||
(34 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Quality| | + | {{Quality|Exceptional}} |
{{av}} | {{av}} | ||
{{Modding}} | {{Modding}} | ||
:{{for/see|an explanation of how to use the various graphics types|[[Graphics]]}} | :{{for/see|an explanation of how to use the various graphics types|[[Graphics]]}} | ||
− | |||
The <code>[OBJECT:GRAPHICS]</code> [[token]] defines the use of various tile-based graphics in the game. As of version 50.01, graphics tokens have been greatly expanded to accommodate the release of the Steam & Itch premium version. These tokens, and explanations on how to use them, are listed below; the list will expand as the tokens are discovered and understood. | The <code>[OBJECT:GRAPHICS]</code> [[token]] defines the use of various tile-based graphics in the game. As of version 50.01, graphics tokens have been greatly expanded to accommodate the release of the Steam & Itch premium version. These tokens, and explanations on how to use them, are listed below; the list will expand as the tokens are discovered and understood. | ||
− | |||
== Creature Graphics == | == Creature Graphics == | ||
Creature graphics are found within graphics_creature_x files (such as graphics_creature_domestic or graphics_creature_layered). All graphics files must begin with the file name, followed by the <code>[OBJECT:GRAPHICS]</code> type that tells the game that the file contains graphics definitions. A more detailed explanation on how to use these can be found in [[Graphics#Creature_Graphics|creature graphics]]. | Creature graphics are found within graphics_creature_x files (such as graphics_creature_domestic or graphics_creature_layered). All graphics files must begin with the file name, followed by the <code>[OBJECT:GRAPHICS]</code> type that tells the game that the file contains graphics definitions. A more detailed explanation on how to use these can be found in [[Graphics#Creature_Graphics|creature graphics]]. | ||
− | |||
=== Types === | === Types === | ||
Line 34: | Line 31: | ||
* [[Creature token|creature id]] | * [[Creature token|creature id]] | ||
* [[Caste|Caste ID]] | * [[Caste|Caste ID]] | ||
− | | Nearly the same as {{token|CREATURE_GRAPHICS|g}}, but allows a separate sprite to be defined for | + | | Nearly the same as {{token|CREATURE_GRAPHICS|g}}, but allows a separate sprite to be defined for each caste. |
A simple alternative to [[Graphics#Layered Graphics|Layered Graphics]]. | A simple alternative to [[Graphics#Layered Graphics|Layered Graphics]]. | ||
Line 44: | Line 41: | ||
* [[Creature token|creature id]] | * [[Creature token|creature id]] | ||
| Format for beginning a [[Graphics#Statue_Graphics|creature statue definition]]. Defines a 1x2 vertical rectangle to be displayed when a statue depicts one of these creatures. | | Format for beginning a [[Graphics#Statue_Graphics|creature statue definition]]. Defines a 1x2 vertical rectangle to be displayed when a statue depicts one of these creatures. | ||
+ | |||
+ | |- | ||
+ | | {{text anchor|STATUE_CREATURE_CASTE_GRAPHICS}} | ||
+ | | | ||
+ | * [[Creature token|creature id]] | ||
+ | * [[Caste|Caste ID]] | ||
+ | | Format for beginning a [[Graphics#Statue_Graphics|creature statue definition]] while specifying caste. Defines a 1x2 vertical rectangle to be displayed when a statue depicts one of these creatures. | ||
|- | |- | ||
Line 49: | Line 53: | ||
| | | | ||
* [[Creature token|creature id]] | * [[Creature token|creature id]] | ||
− | | Graphics for a 3x2 rectangle | + | | Graphics for a 3x2 rectangle; for creatures, this is used exclusively for representing Forgotten Beasts based on their body parts. Uses [[Graphics#Forgotten_Beast_Graphics|forgotten beast graphics]]. It's also, however, used for interface graphics, see [[graphics_interface.txt]]. |
|} | |} | ||
− | + | === Conditions === | |
− | === | + | Different graphics can be defined for the same creature based on some properties about it. Below is a list of all the basic "creature texture" types that can be used as additional conditions to various basic sprites. |
− | Different graphics can be defined for the same creature based on some properties about it. Below is a list of all | ||
{| {{prettytable}} | {| {{prettytable}} | ||
|- bgcolor="#dddddd" | |- bgcolor="#dddddd" | ||
! Condition | ! Condition | ||
− | |||
! Description | ! Description | ||
|- | |- | ||
− | | {{text anchor|DEFAULT}} | + | | {{text anchor|DEFAULT}} || The default condition that will be displayed unless overwritten by a more specific one below. |
+ | |||
+ | |- | ||
+ | | {{text anchor|LAW_ENFORCE}} || Displayed if the unit is law enforcement. | ||
+ | |||
+ | |- | ||
+ | | {{text anchor|TAX_ESCORT}} || Displayed if the unit escorts a tax collector (unused). | ||
+ | |||
+ | |- | ||
+ | | {{text anchor|ANIMATED}} || Displayed if the creature is raised from the dead using an I_EFFECT:ANIMATE interaction. | ||
+ | |||
+ | |- | ||
+ | | {{text anchor|GHOST}} || Displayed if the creature is a ghost. | ||
+ | |||
+ | |- | ||
+ | | {{text anchor|ADVENTURER}} || Displayed if the creature is an adventurer. | ||
|- | |- | ||
− | | {{text anchor| | + | | {{text anchor|CORPSE}} || Displayed for corpses. |
+ | |||
+ | |} | ||
+ | |||
+ | === Basic creature sprite types === | ||
+ | |||
+ | An individual sprite can be of any of the following classes. If "accepts secondary" is "yes", it can also have an extra condition tacked on at the end. | ||
+ | {| {{prettytable}} | ||
+ | |- bgcolor="#dddddd" | ||
+ | ! Condition | ||
+ | ! Description | ||
|- | |- | ||
− | | {{ | + | | {{text_anchor|Basic Condition}} || Any of the [[Graphics token#Conditions|above conditions]] can be used on their own, as the default for that condition class. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|Unit type}} || Any [[Unit type token]] can be used. You may also append a [[Graphics token#Conditions|basic condition as above]] to further specify. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|Position}} || Any [[Position token]] can be used, such as MONARCH, BROKER etc. All position tokens are raw-defined; any modded positions can have their own graphics. You may also append a [[Graphics token#Conditions|basic condition as above]] to further specify. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|LIST_ICON}} || The default icon for this creature in lists, such as [[Arena]] mode or overall training. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|EGG}} || The sprite for a clutch of eggs. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|SKELETON}} || The sprite for a rotten corpse. |
|- | |- | ||
− | | {{ | + | | {{text_anchor|SKELETON_WITH_SKULL}} || The sprite for a rotten corpse that can have a [[totem]] made from it. |
+ | |||
|} | |} | ||
− | |||
=== Layered Conditions === | === Layered Conditions === | ||
Line 102: | Line 129: | ||
|- | |- | ||
− | | {{text_anchor| | + | | {{text_anchor|LAYER_SET}} || |
− | | Begins defining a layer group. | + | * condition |
+ | | Creature<br>Graphics | ||
+ | | Begins defining a layer set for a creature's graphics. Valid values of ''condition'' are DEFAULT, PORTRAIT{{version|50.13}}, BABY:DEFAULT{{version|51.01-beta20}}, CHILD:DEFAULT{{version|51.01-beta20}}, or CORPSE Valid values for basic conditions may not work.{{verify}} | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|LS_PALETTE}}{{version|50.13}} || | ||
+ | * name | ||
+ | || Layer<br>Set | ||
+ | || Begins defining a palette for the layer set. Its name can be referenced by {{token|USE_PALETTE|g}}. Unlike the palettes used to render all [[descriptor color token]]s, it can be of arbitrary length. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|LS_PALETTE_FILE}}{{version|50.13}} || | ||
+ | * file name | ||
+ | | Palette | ||
+ | | The file name of the 8bit RGBA (sometimes called 32bit) in the <tt>/graphics/images</tt> folder of the mod, such as <tt>images/portraits/dwarf_portrait_body_palette.png</tt>. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|LS_PALETTE_DEFAULT}}{{version|50.13}} || | ||
+ | * integer | ||
+ | | Palette | ||
+ | | Defines the default row of a layer set palette, conventionally 0. The exact color values on this row will be replaced on layer images with the colors in the same column, based on what row is passed as an argument to {{token|USE_PALETTE|g}}. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|LG_CONDITION_BP}}{{version|50.13}} || | ||
+ | * selection criteria BY_TYPE, BY_CATEGORY, BY_TOKEN | ||
+ | * category, type, or token | ||
+ | || Layer<br>Group | ||
+ | || Allows the entire layer group (rather than an individual layer) to be switched on and off depending on the conditions of a body part. Should accept the same tokens {{token|CONDITION_BP|g}} does. {{verify}} | ||
|- | |- | ||
| {{text_anchor|END_LAYER_GROUP}} || || Layer<br>Group | | {{text_anchor|END_LAYER_GROUP}} || || Layer<br>Group | ||
− | | marks the end of a layer group. | + | | Explicitly marks the end of a layer group, which allows layers after to not belong to any layer group. |
|- | |- | ||
Line 117: | Line 171: | ||
|| Armor<br>Wieldables || Defines a clothing or armor graphic by the specific part it is equipped to, the type of armor it is, and the internal id of that item. | || Armor<br>Wieldables || Defines a clothing or armor graphic by the specific part it is equipped to, the type of armor it is, and the internal id of that item. | ||
For example, a condition representing a right handed mitten or glove would be defined as: | For example, a condition representing a right handed mitten or glove would be defined as: | ||
− | <code>[CONDITION_ITEM_WORN:BY_TOKEN:RH:GLOVES: | + | <code>[CONDITION_ITEM_WORN:BY_TOKEN:RH:GLOVES:ITEM_GLOVES_MITTENS]</code> |
+ | Also accepts the input <code>ANY_HELD</code> or <code>WIELD</code> (e.g. <code>WIELD:WEAPON:ANY</code>). | ||
|- | |- | ||
Line 126: | Line 181: | ||
* Item ID(s) | * Item ID(s) | ||
|| Armor || Causes the current layer to not be rendered if the creature has one of the items worn or equipped. Also accepts the input <code>ANY_HELD</code> or <code>WIELD</code> (e.g. <code>WIELD:WEAPON:ANY</code>). | || Armor || Causes the current layer to not be rendered if the creature has one of the items worn or equipped. Also accepts the input <code>ANY_HELD</code> or <code>WIELD</code> (e.g. <code>WIELD:WEAPON:ANY</code>). | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|CONDITION_CASTE}} || | ||
+ | * caste name(s) | ||
+ | || General | ||
+ | || Displays this layer if the creature is this caste. Only one caste is accepted for each condition, but multiple caste conditions can be used in one layer and the layer will be displayed if any of them match. | ||
|- | |- | ||
Line 152: | Line 213: | ||
* FIRE_BUILD_SAFE | * FIRE_BUILD_SAFE | ||
* MAGMA_BUILD_SAFE | * MAGMA_BUILD_SAFE | ||
+ | * GROWN_NOT_CRAFTED{{version|51.01-beta20}} | ||
[http://www.bay12forums.com/smf/index.php?topic=169696.msg8442543#msg8442543 among other, less useful ones.] | [http://www.bay12forums.com/smf/index.php?topic=169696.msg8442543#msg8442543 among other, less useful ones.] | ||
Line 157: | Line 219: | ||
| {{text_anchor|CONDITION_MATERIAL_TYPE}} || | | {{text_anchor|CONDITION_MATERIAL_TYPE}} || | ||
* material token | * material token | ||
− | || Material || Changes graphics based on the material an equipped item is made of. Valid material types take the form <code>METAL:COPPER</code> where copper can be replaced with any weapons-grade metal. | + | || Material || Changes graphics based on the material an equipped item is made of. Valid material types take the form <code>METAL:COPPER</code> where copper can be replaced with any weapons-grade metal. General [[material token]]s are '''not''' functional. {{token|CONDITION_MATERIAL_FLAG|g}} is a better option for any material condition other than metal. |
|- | |- | ||
| {{text_anchor|CONDITION_PROFESSION_CATEGORY}} || | | {{text_anchor|CONDITION_PROFESSION_CATEGORY}} || | ||
− | * [[Unit type token|profession token(s)]] | + | * [[Unit type token#Profession Categories|profession category token(s)]] |
|| General | || General | ||
− | || Checks the profession of the creature to act as a condition. Multiple profession tokens can be chained together. | + | || Checks the profession category of the creature to act as a condition. Multiple profession category tokens can be chained together. You can also use multiple of these tokens instead of listing them all in a single one, but this is functionally identical. Valid Profession tokens which are not categories will be ignored; values that do not match any existing Profession will be treated as <code>NONE</code> and thus apply to doctors, military, etc.. |
|- | |- | ||
| {{text_anchor|CONDITION_RANDOM_PART_INDEX}} || | | {{text_anchor|CONDITION_RANDOM_PART_INDEX}} || | ||
− | * | + | * identifier |
* integer index | * integer index | ||
* integer range | * integer range | ||
|| General | || General | ||
− | || Chooses a random layer | + | || Chooses a random layer among layers with a CONDITION_RANDOM_PART_INDEX with the same identifier. Index is which option this condition is, out of Range number of options. Ex: |
<code>[CONDITION_RANDOM_PART_INDEX:HEAD:3:4]</code> | <code>[CONDITION_RANDOM_PART_INDEX:HEAD:3:4]</code> | ||
− | + | is the third possible random head out of four total options. One of these random conditions each will be put into a set of four different sprites to add some random variation in the appearance of the creature's head. | |
|- | |- | ||
Line 188: | Line 250: | ||
|- | |- | ||
− | | {{text_anchor|CONDITION_CHILD}} || | + | | {{text_anchor|CONDITION_CHILD}} || || General |
|| Checks if the creature is a child or baby. | || Checks if the creature is a child or baby. | ||
|- | |- | ||
− | | {{text_anchor|CONDITION_NOT_CHILD}} || | + | | {{text_anchor|CONDITION_NOT_CHILD}} || || General |
|| Checks if the creature is an adult. | || Checks if the creature is an adult. | ||
|- | |- | ||
− | | {{text_anchor|CONDITION_GHOST}} || | + | | {{text_anchor|CONDITION_GHOST}} || || General |
|| Checks if the creature is a ghost. | || Checks if the creature is a ghost. | ||
Line 207: | Line 269: | ||
* VAMPCURSE | * VAMPCURSE | ||
* RAISED_UNDEAD | * RAISED_UNDEAD | ||
+ | * DISTURBED_DEAD | ||
* GHOUL | * GHOUL | ||
Line 222: | Line 285: | ||
* integer | * integer | ||
|| Tissue | || Tissue | ||
− | || Checks the current {{token|CONDITION_TISSUE_LAYER}}'s LENGTH [[Creature_token#TISSUE_LAYER_APPEARANCE_MODIFIER|appearance modifier]]. Is true if the LENGTH is greater than the integer input. | + | || Checks the current {{token|CONDITION_TISSUE_LAYER|g}}'s LENGTH [[Creature_token#TISSUE_LAYER_APPEARANCE_MODIFIER|appearance modifier]]. Is true if the LENGTH is greater than the integer input. |
|- | |- | ||
Line 228: | Line 291: | ||
* integer | * integer | ||
|| Tissue | || Tissue | ||
− | || Checks the current {{token|CONDITION_TISSUE_LAYER}}'s LENGTH [[Creature_token#TISSUE_LAYER_APPEARANCE_MODIFIER|appearance modifier]]. Is true if the LENGTH is less than the integer input. | + | || Checks the current {{token|CONDITION_TISSUE_LAYER|g}}'s LENGTH [[Creature_token#TISSUE_LAYER_APPEARANCE_MODIFIER|appearance modifier]]. Is true if the LENGTH is less than the integer input. |
|- | |- | ||
Line 240: | Line 303: | ||
* styling token | * styling token | ||
|| Tissue | || Tissue | ||
− | || Checks the current {{token|CONDITION_TISSUE_LAYER}}'s shaping (hairstyle). Valid tokens are NEATLY_COMBED, BRAIDED, DOUBLE_BRAIDS, PONY_TAILS, CLEAN_SHAVEN and STANDARD_HAIR/BEARD/MOUSTACHE/SIDEBURNS_SHAPINGS.{{verify}} | + | || Checks the current {{token|CONDITION_TISSUE_LAYER|g}}'s shaping (hairstyle). Valid tokens are NEATLY_COMBED, BRAIDED, DOUBLE_BRAIDS, PONY_TAILS, CLEAN_SHAVEN and STANDARD_HAIR/BEARD/MOUSTACHE/SIDEBURNS_SHAPINGS.{{verify}} |
|- | |- | ||
| {{text_anchor|TISSUE_NOT_SHAPED}} || || Tissue | | {{text_anchor|TISSUE_NOT_SHAPED}} || || Tissue | ||
− | || Checks the current {{token|CONDITION_TISSUE_LAYER}}'s color. Accepts multiple color tokens, and is true if the any of the colors is present in the selected tissues. | + | || Checks the current {{token|CONDITION_TISSUE_LAYER|g}}'s color. Accepts multiple color tokens, and is true if the any of the colors is present in the selected tissues. |
|- | |- | ||
Line 257: | Line 320: | ||
This condition should be within a [LAYER:... ] that has a similar graphic to the on in the TISSUE_SWAP. | This condition should be within a [LAYER:... ] that has a similar graphic to the on in the TISSUE_SWAP. | ||
− | The current {{token|CONDITION_TISSUE_LAYER}} group must also include a {{token|TISSUE_MIN_LENGTH}}. | + | The current {{token|CONDITION_TISSUE_LAYER|g}} group must also include a {{token|TISSUE_MIN_LENGTH|g}}. |
+ | |||
+ | |- | ||
+ | | {{text_anchor|ITEM_QUALITY}}{{version|50.13}} || | ||
+ | * integer | ||
+ | | Armor<br>Wieldables | ||
+ | || Checks the current {{token|CONDITION_ITEM_WORN|g}}'s [[quality]]. 0 is base quality, 5 is masterwork. See [CONDITION_MATERIAL_FLAG:IS_CRAFTED_ARTIFACT] for [[artifact]]-quality items. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|USE_PALETTE}}{{version|50.13}} || | ||
+ | * layer set palette | ||
+ | * row | ||
+ | | General | ||
+ | || Colors the layer using that row of either the layer-set-specific {{token|LS_PALETTE|}} or a predefined [[Graphics#Palettes|palette]] such as DEFAULT. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|USE_STANDARD_PALETTE_FROM_ITEM}}{{version|50.13}} || || Armor<br>Wieldables | ||
+ | || Uses the default palette to render the layer based on the [[Material definition token#STATE_COLOR|color]] of the current {{token|CONDITION_ITEM_WORN|g}}. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|CONDITION_BP}}{{version|50.13}} || | ||
+ | * selection criteria BY_TYPE, BY_CATEGORY, BY_TOKEN | ||
+ | * category, type, or token | ||
+ | | Body | ||
+ | || Defines a body part graphic using standard [[body token]] selection criteria. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|BP_APPEARANCE_MODIFIER_RANGE}}{{version|50.13}} || | ||
+ | * QUALITY | ||
+ | * minimum | ||
+ | * maximum | ||
+ | | Body | ||
+ | || Checks if current {{token|CONDITION_BP|g}}'s {{token|BP_APPEARANCE_MODIFIER|c}} falls within the chosen range. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|BP_PRESENT}}{{version|50.13}} || || Body | ||
+ | || Checks if the current {{token|CONDITION_BP|g}} is present and not destroyed, pulped, or severed. Can also be applied to {{token|LG_CONDITION_BP|g}}. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|BP_SCARRED}}{{version|50.13}} || || Body | ||
+ | || Checks if the current {{token|CONDITION_BP|g}} is scarred. Seems to also require {{token|BP_PRESENT|g}} to avoid illogical results. {{verify}} | ||
|} | |} | ||
Line 269: | Line 372: | ||
! Description | ! Description | ||
|- | |- | ||
− | | {{text anchor|VERMIN}} || | + | | {{text anchor|VERMIN}} || The default graphic for this vermin. |
|- | |- | ||
Line 284: | Line 387: | ||
|- | |- | ||
− | | {{text anchor|LIGHT_VERMIN}} || For [[firefly|fireflies]] etc. Does not replace {{token|VERMIN|g}}. | + | | {{text anchor|LIGHT_VERMIN}} || For [[firefly|fireflies]] etc. Does not replace {{token|VERMIN|g}}. |
|- | |- | ||
− | | {{text anchor|LIGHT_VERMIN_ALT}} || Like {{token|VERMIN_ALT|g}} for [[firefly|fireflies]] etc. | + | | {{text anchor|LIGHT_VERMIN_ALT}} || Like {{token|VERMIN_ALT|g}} for [[firefly|fireflies]] etc. |
|- | |- | ||
− | | {{text anchor|LIGHT_SWARM_SMALL}} || | + | | {{text anchor|LIGHT_SWARM_SMALL}} || Unused. |
|- | |- | ||
− | | {{text anchor|LIGHT_SWARM_MEDIUM}} || | + | | {{text anchor|LIGHT_SWARM_MEDIUM}} || Unused. |
|- | |- | ||
− | | {{text anchor|LIGHT_SWARM_LARGE}} || | + | | {{text anchor|LIGHT_SWARM_LARGE}} || Unused. |
|- | |- | ||
Line 307: | Line 410: | ||
== Item Graphics == | == Item Graphics == | ||
Item graphics can also be defined, but are mostly hardcoded. This section of the wiki needs to be fleshed out. Descriptions of the token functions is provisional. | Item graphics can also be defined, but are mostly hardcoded. This section of the wiki needs to be fleshed out. Descriptions of the token functions is provisional. | ||
+ | |||
+ | Item graphics currently do not support LARGE_IMAGE. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
Line 358: | Line 463: | ||
* Item ID | * Item ID | ||
| Defines tile graphics for FOOD items. | | Defines tile graphics for FOOD items. | ||
+ | |||
+ | |- | ||
+ | | {{text_anchor|CHEESE_GRAPHICS}} | ||
+ | | | ||
+ | * Tile page ID | ||
+ | * x index | ||
+ | * y index | ||
+ | * Material ID | ||
+ | | Defines tile graphics variants to use for CHEESE items by material. Unused in vanilla raws. | ||
|- | |- |
Latest revision as of 22:33, 4 October 2024
v50.14 · v0.47.05 This article is about the current version of DF.Note that some content may still need to be updated. |
Modding |
---|
Tokens |
Audio · Biome · Graphics · Interaction · Mod info · Plant · Speech · Sphere · Syndrome · World |
Body tokens |
Body · Body detail plan · Bodygloss · Tissue |
Creature tokens |
Creature · Creature mannerism · Personality · Creature variation · Procedural graphics layer |
Descriptor tokens |
Descriptor color · Color · Descriptor pattern · Descriptor shape |
Entity tokens |
Entity · Ethic · Language · Value · Position |
Job tokens |
Building · Labor · Reaction · Skill · Unit type |
Item tokens |
Item type · Item definition · Ammo · Armor · Instrument · Tool · Trap component · Weapon |
Material tokens |
Material type · Material definition · Inorganic material definition |
- For an explanation of how to use the various graphics types, see Graphics.
The [OBJECT:GRAPHICS]
token defines the use of various tile-based graphics in the game. As of version 50.01, graphics tokens have been greatly expanded to accommodate the release of the Steam & Itch premium version. These tokens, and explanations on how to use them, are listed below; the list will expand as the tokens are discovered and understood.
Creature Graphics[edit]
Creature graphics are found within graphics_creature_x files (such as graphics_creature_domestic or graphics_creature_layered). All graphics files must begin with the file name, followed by the [OBJECT:GRAPHICS]
type that tells the game that the file contains graphics definitions. A more detailed explanation on how to use these can be found in creature graphics.
Types[edit]
Type | Arguments | Description |
---|---|---|
CREATURE_GRAPHICS | The simplest and most common form of creature graphics for defining one sprite for each basic condition.
Further conditions are required for this to function following the creature graphics format. Accepts large graphics tokens. Additionally used to start defining a layered graphics set. | |
CREATURE_CASTE_GRAPHICS | Nearly the same as [CREATURE_GRAPHICS] , but allows a separate sprite to be defined for each caste.
A simple alternative to Layered Graphics. Requires conditions defined in creature graphics format. Accepts large graphics tokens. | |
STATUE_CREATURE_GRAPHICS | Format for beginning a creature statue definition. Defines a 1x2 vertical rectangle to be displayed when a statue depicts one of these creatures. | |
STATUE_CREATURE_CASTE_GRAPHICS | Format for beginning a creature statue definition while specifying caste. Defines a 1x2 vertical rectangle to be displayed when a statue depicts one of these creatures. | |
TILE_GRAPHICS_RECTANGLE | Graphics for a 3x2 rectangle; for creatures, this is used exclusively for representing Forgotten Beasts based on their body parts. Uses forgotten beast graphics. It's also, however, used for interface graphics, see graphics_interface.txt. |
Conditions[edit]
Different graphics can be defined for the same creature based on some properties about it. Below is a list of all the basic "creature texture" types that can be used as additional conditions to various basic sprites.
Condition | Description |
---|---|
DEFAULT | The default condition that will be displayed unless overwritten by a more specific one below. |
LAW_ENFORCE | Displayed if the unit is law enforcement. |
TAX_ESCORT | Displayed if the unit escorts a tax collector (unused). |
ANIMATED | Displayed if the creature is raised from the dead using an I_EFFECT:ANIMATE interaction. |
GHOST | Displayed if the creature is a ghost. |
ADVENTURER | Displayed if the creature is an adventurer. |
CORPSE | Displayed for corpses. |
Basic creature sprite types[edit]
An individual sprite can be of any of the following classes. If "accepts secondary" is "yes", it can also have an extra condition tacked on at the end.
Condition | Description |
---|---|
Basic Condition | Any of the above conditions can be used on their own, as the default for that condition class. |
Unit type | Any Unit type token can be used. You may also append a basic condition as above to further specify. |
Position | Any Position token can be used, such as MONARCH, BROKER etc. All position tokens are raw-defined; any modded positions can have their own graphics. You may also append a basic condition as above to further specify. |
LIST_ICON | The default icon for this creature in lists, such as Arena mode or overall training. |
EGG | The sprite for a clutch of eggs. |
SKELETON | The sprite for a rotten corpse. |
SKELETON_WITH_SKULL | The sprite for a rotten corpse that can have a totem made from it. |
Layered Conditions[edit]
Layers aren't very useful on their own, so they come with a set of conditions to define how when they are displayed and how they interact.
Token | Arguments | Type | Description |
---|---|---|---|
LAYER_SET |
|
Creature Graphics |
Begins defining a layer set for a creature's graphics. Valid values of condition are DEFAULT, PORTRAITv50.13, BABY:DEFAULTv51.01-beta20, CHILD:DEFAULTv51.01-beta20, or CORPSE Valid values for basic conditions may not work.[Verify] |
LS_PALETTEv50.13 |
|
Layer Set |
Begins defining a palette for the layer set. Its name can be referenced by [USE_PALETTE] . Unlike the palettes used to render all descriptor color tokens, it can be of arbitrary length.
|
LS_PALETTE_FILEv50.13 |
|
Palette | The file name of the 8bit RGBA (sometimes called 32bit) in the /graphics/images folder of the mod, such as images/portraits/dwarf_portrait_body_palette.png. |
LS_PALETTE_DEFAULTv50.13 |
|
Palette | Defines the default row of a layer set palette, conventionally 0. The exact color values on this row will be replaced on layer images with the colors in the same column, based on what row is passed as an argument to [USE_PALETTE] .
|
LG_CONDITION_BPv50.13 |
|
Layer Group |
Allows the entire layer group (rather than an individual layer) to be switched on and off depending on the conditions of a body part. Should accept the same tokens [CONDITION_BP] does.[Verify]
|
END_LAYER_GROUP | Layer Group |
Explicitly marks the end of a layer group, which allows layers after to not belong to any layer group. | |
CONDITION_ITEM_WORN |
|
Armor Wieldables |
Defines a clothing or armor graphic by the specific part it is equipped to, the type of armor it is, and the internal id of that item.
For example, a condition representing a right handed mitten or glove would be defined as:
|
SHUT_OFF_IF_ITEM_PRESENT |
|
Armor | Causes the current layer to not be rendered if the creature has one of the items worn or equipped. Also accepts the input ANY_HELD or WIELD (e.g. WIELD:WEAPON:ANY ).
|
CONDITION_CASTE |
|
General | Displays this layer if the creature is this caste. Only one caste is accepted for each condition, but multiple caste conditions can be used in one layer and the layer will be displayed if any of them match. |
CONDITION_DYE |
|
Armor | Should represent which color the clothing is dyed. Currently nonfunctional.v50.05 |
CONDITION_NOT_DYED | Armor | Should check if the clothing is dyed. Currently nonfunctional.v50.05 | |
CONDITION_MATERIAL_FLAG |
|
Material | Changes graphics based on the material an equipped item is made of. Valid material flags are similar to reactant conditions including:
|
CONDITION_MATERIAL_TYPE |
|
Material | Changes graphics based on the material an equipped item is made of. Valid material types take the form METAL:COPPER where copper can be replaced with any weapons-grade metal. General material tokens are not functional. [CONDITION_MATERIAL_FLAG] is a better option for any material condition other than metal.
|
CONDITION_PROFESSION_CATEGORY | General | Checks the profession category of the creature to act as a condition. Multiple profession category tokens can be chained together. You can also use multiple of these tokens instead of listing them all in a single one, but this is functionally identical. Valid Profession tokens which are not categories will be ignored; values that do not match any existing Profession will be treated as NONE and thus apply to doctors, military, etc..
| |
CONDITION_RANDOM_PART_INDEX |
|
General | Chooses a random layer among layers with a CONDITION_RANDOM_PART_INDEX with the same identifier. Index is which option this condition is, out of Range number of options. Ex:
|
CONDITION_HAUL_COUNT_MIN |
|
General | Counts how many items the creature is hauling. Used for [PACK_ANIMAL] s in vanilla.
|
CONDITION_HAUL_COUNT_MAX |
|
General | Counts how many items the creature is hauling. Used for [PACK_ANIMAL] s in vanilla.
|
CONDITION_CHILD | General | Checks if the creature is a child or baby. | |
CONDITION_NOT_CHILD | General | Checks if the creature is an adult. | |
CONDITION_GHOST | General | Checks if the creature is a ghost. | |
CONDITION_SYN_CLASS | Syndrome | Changes graphics based on any syndromes the creature is affected by. Vanilla values include:
| |
CONDITION_TISSUE_LAYER |
|
Tissue | Selects a tissue layer to use for checking other conditions. Ex:
|
TISSUE_MIN_LENGTH |
|
Tissue | Checks the current [CONDITION_TISSUE_LAYER] 's LENGTH appearance modifier. Is true if the LENGTH is greater than the integer input.
|
TISSUE_MAX_LENGTH |
|
Tissue | Checks the current [CONDITION_TISSUE_LAYER] 's LENGTH appearance modifier. Is true if the LENGTH is less than the integer input.
|
TISSUE_MAY_HAVE_COLOR | Tissue | Checks the selected tissue's color. Accepts multiple color tokens, and is true if the any of the colors is present in the selected tissues. | |
TISSUE_MAY_HAVE_SHAPING |
|
Tissue | Checks the current [CONDITION_TISSUE_LAYER] 's shaping (hairstyle). Valid tokens are NEATLY_COMBED, BRAIDED, DOUBLE_BRAIDS, PONY_TAILS, CLEAN_SHAVEN and STANDARD_HAIR/BEARD/MOUSTACHE/SIDEBURNS_SHAPINGS.[Verify]
|
TISSUE_NOT_SHAPED | Tissue | Checks the current [CONDITION_TISSUE_LAYER] 's color. Accepts multiple color tokens, and is true if the any of the colors is present in the selected tissues.
| |
TISSUE_SWAP |
|
Tissue | Checks if a tissue is sufficiently curly, and if so swaps to display a different image. The new image is defined by the tile page ID, x position, and y position.
This condition should be within a [LAYER:... ] that has a similar graphic to the on in the TISSUE_SWAP.
The current |
ITEM_QUALITYv50.13 |
|
Armor Wieldables |
Checks the current [CONDITION_ITEM_WORN] 's quality. 0 is base quality, 5 is masterwork. See [CONDITION_MATERIAL_FLAG:IS_CRAFTED_ARTIFACT] for artifact-quality items.
|
USE_PALETTEv50.13 |
|
General | Colors the layer using that row of either the layer-set-specific [LS_PALETTE] or a predefined palette such as DEFAULT.
|
USE_STANDARD_PALETTE_FROM_ITEMv50.13 | Armor Wieldables |
Uses the default palette to render the layer based on the color of the current [CONDITION_ITEM_WORN] .
| |
CONDITION_BPv50.13 |
|
Body | Defines a body part graphic using standard body token selection criteria. |
BP_APPEARANCE_MODIFIER_RANGEv50.13 |
|
Body | Checks if current [CONDITION_BP] 's [BP_APPEARANCE_MODIFIER] falls within the chosen range.
|
BP_PRESENTv50.13 | Body | Checks if the current [CONDITION_BP] is present and not destroyed, pulped, or severed. Can also be applied to [LG_CONDITION_BP] .
| |
BP_SCARREDv50.13 | Body | Checks if the current [CONDITION_BP] is scarred. Seems to also require [BP_PRESENT] to avoid illogical results.[Verify]
|
Vermin Conditions[edit]
Special Conditions for [VERMIN]
creature graphics:
Condition | Description |
---|---|
VERMIN | The default graphic for this vermin. |
VERMIN_ALT | Image cycles every 1 second. |
SWARM_SMALL | For swarming vermin like flies and fairies in small groups. |
SWARM_MEDIUM | For swarming vermin like flies and fairies in medium-sized groups. |
SWARM_LARGE | For swarming vermin like flies and fairies in large groups. |
LIGHT_VERMIN | For fireflies etc. Does not replace [VERMIN] .
|
LIGHT_VERMIN_ALT | Like [VERMIN_ALT] for fireflies etc.
|
LIGHT_SWARM_SMALL | Unused. |
LIGHT_SWARM_MEDIUM | Unused. |
LIGHT_SWARM_LARGE | Unused. |
REMAINS | Vermin corpses. |
HIVE | Vermin hives. |
Item Graphics[edit]
Item graphics can also be defined, but are mostly hardcoded. This section of the wiki needs to be fleshed out. Descriptions of the token functions is provisional.
Item graphics currently do not support LARGE_IMAGE.
Token | Arguments | Description |
---|---|---|
TILE_GRAPHICS |
|
Begins defining tile graphics for an item. Sets default tile graphic.[Verify] |
BOULDER_GRAPHICS |
|
Defines tile graphics variants to use for BOULDER items by material; currently all boulders use material palette instead. |
ROUGH_GEM_GRAPHICS |
|
Defines tile graphics variants to use for ROUGH (gem) items by material; currently all rough gems use material palette instead. |
BARS_GRAPHICS |
|
Defines tile graphics variants to use for BAR items by material. |
FOOD_GRAPHICS |
|
Defines tile graphics for FOOD items. |
CHEESE_GRAPHICS |
|
Defines tile graphics variants to use for CHEESE items by material. Unused in vanilla raws. |
ARMOR_GRAPHICS |
|
Defines tile graphics for ARMOR items; this is for items not being worn by a creature. |
GLOVES_GRAPHICS |
|
Defines tile graphics for GLOVES items; this is for items not being worn by a creature. |
HELM_GRAPHICS |
|
Defines tile graphics for HELM items; this is for items not being worn by a creature. |
PANTS_GRAPHICS |
|
Defines tile graphics for PANTS items; this is for items not being worn by a creature. |
SHOES_GRAPHICS |
|
Defines tile graphics for SHOES items; this is for items not being worn by a creature. |
SHOES_GRAPHICS_METAL |
|
Defines metal material tile graphics variants for SHOES items; this is for items not being worn by a creature. |
SHIELD_GRAPHICS |
|
Defines tile graphics for SHIELD items; this is for items not being worn by a creature. |
SHIELD_GRAPHICS_WOODEN |
|
Defines wood material tile graphics variants for SHIELD items; this is for items not being worn by a creature. |
TOY_GRAPHICS |
|
Defines tile graphics for TOY items. Material ID in this case is one of STONE, WOOD, METAL, or GLASS. |
TRAPCOMP_GRAPHICS |
|
Defines tile graphics for TRAPCOMP items. |
TRAPCOMP_GRAPHICS_WEAPON_TRAP |
|
Defines tile graphics for TRAPCOMP items when built into a weapon trap; must follow TRAPCOMP_GRAPHICS. |
TRAPCOMP_GRAPHICS_UPRIGHT_#X |
|
Defines tile graphics for installed upright spike traps. These comprise two-tile graphics: # is replaced with the number of spikes, 1-10; X is replaced with T (for top graphic tile) or B (bottom graphic tile). This follows the tile graphics definition of either MENACINGSPIKE or SPEAR. |
SIEGEAMMO_GRAPHICS |
|
Begins defining graphics for SIEGEAMMO items. |
SIEGEAMMO_GRAPHICS_STRAIGHT_DEFAULT |
|
Defines graphics for ballista arrows aligned orthogonally on the map; follows SEIGEAMMO_GRAPHICS. |
SIEGEAMMO_GRAPHICS_STRAIGHT_WOOD |
|
Wooden variant of above. |
SIEGEAMMO_GRAPHICS_DIAGONAL_DEFAULT |
|
Defines graphics for ballista arrows aligned diagonally on the map; follows SEIGEAMMO_GRAPHICS. |
SIEGEAMMO_GRAPHICS_DIAGONAL_WOOD |
|
Wood variant of above. |
AMMO_GRAPHICS |
|
Begins defining graphics for AMMO items. |
AMMO_GRAPHICS_STRAIGHT_DEFAULT |
|
Defines graphics for AMMO items aligned orthogonally on the map; follows AMMO_GRAPHICS. |
AMMO_GRAPHICS_STRAIGHT_WOOD |
|
Wooden variant of above. |
AMMO_GRAPHICS_DIAGONAL_DEFAULT |
|
Defines graphics for AMMO aligned diagonally on the map; follows AMMO_GRAPHICS. |
AMMO_GRAPHICS_DIAGONAL_WOOD |
|
Wood variant of above. |
WEAPON_GRAPHICS |
|
Begins defining graphics for WEAPON items. |
WEAPON_GRAPHICS_DEFAULT |
|
Defines default graphics for WEAPON item defined by WEAPON_GRAPHICS not being worn by creatures; follows WEAPON_GRAPHICS. |
WEAPON_GRAPHICS_MATERIAL |
|
Defines material palette[Verify] graphics for WEAPON item defined by WEAPON_GRAPHICS not being worn by creatures; follows WEAPON_GRAPHICS. |
WEAPON_GRAPHICS_WOOD_GROWN |
|
Defines graphics for grown-wood WEAPON item defined by WEAPON_GRAPHICS not being worn by creatures; follows WEAPON_GRAPHICS. |
WEAPON_GRAPHICS_WOOD |
|
Defines graphics for wooden WEAPON item defined by WEAPON_GRAPHICS not being worn by creatures; follows WEAPON_GRAPHICS. |
WEAPON_GRAPHICS_WEAPON_TRAP |
|
Defines graphics for WEAPON item defined by WEAPON_GRAPHICS as it appears installed in a weapon trap; follows WEAPON_GRAPHICS. |
TOOL_GRAPHICS |
|
Defines default graphics for TOOL items; also begins defining variant graphics for material or container conditions when followed by tokens below. |
ADD_TOOL_GRAPHICS |
|
Adds graphics to an existing tool defined with TOOL_GRAPHICS, followed by the tool graphics material or container condition tokens below. |
TOOL_GRAPHICS_WOOD |
|
Defines additonal variant graphics for wooden TOOL items defined by TOOL_GRAPHICS; follows TOOL_GRAPHICS or ADD_TOOL_GRAPHICS. Requires seven variants; the resulting tool graphic is selected randomly from these (they can all point to the same tile index if desired). |
TOOL_GRAPHICS_STONE |
|
Defines additonal variant graphics for stone TOOL items defined by TOOL_GRAPHICS; follows TOOL_GRAPHICS or ADD_TOOL_GRAPHICS. Requires seven variants; the resulting tool graphic is selected randomly from these (they can all point to the same tile index if desired). |
TOOL_GRAPHICS_METAL |
|
Defines additonal variant graphics for metal TOOL items defined by TOOL_GRAPHICS; follows TOOL_GRAPHICS or ADD_TOOL_GRAPHICS. Requires seven variants; the resulting tool graphic is selected randomly from these (they can all point to the same tile index if desired). |
TOOL_GRAPHICS_GLASS |
|
Defines additonal variant graphics for glass TOOL items defined by TOOL_GRAPHICS; follows TOOL_GRAPHICS or ADD_TOOL_GRAPHICS. Requires seven variants; the resulting tool graphic is selected randomly from these (they can all point to the same tile index if desired). |
TOOL_GRAPHICS_CONTAINER_WOOD_LIQUID |
|
Defines graphics for wooden liquid-containing containers (empty); follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_CONTAINER_STONE_LIQUID |
|
Defines graphics for stone liquid-containing containers (empty); follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_CONTAINER_METAL_LIQUID |
|
Defines graphics for metal (and glass?) liquid-containing containers (empty); follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_CONTAINER_LIQUID |
|
Defines graphics for the liquid filling a liquid-containing container; follows TOOL_GRAPHICS_CONTAINER_*_LIQUID. |
TOOL_GRAPHICS_CONTAINER_WOOD_ITEM |
|
Defines graphics for wooden containers holding items; follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_CONTAINER_STONE_ITEM |
|
Defines graphics for stone containers holding items; follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_CONTAINER_METAL_ITEM |
|
Defines graphics for metal (and glass?) containers holding items; follows ADD_TOOL_GRAPHICS definition for container. |
TOOL_GRAPHICS_HIVE_BLD |
|
Defines the built item graphics for HIVE items. |
TOOL_GRAPHICS_HIVE_BLD_IN_USE |
|
Defines the built item graphics for HIVE items that have hives installed. |
TOOL_GRAPHICS_HIVE_PRODUCTS |
|
Defines the built item graphics for HIVE items that are ready to be harvested. |
TOOL_GRAPHICS_SHAPE |
|
Defines graphics for shaped items; currently used for dice. |
World Map Graphics[edit]
World map graphics are defined in Dwarf Fortress\data\vanilla\vanilla_world_map\graphics\graphics_world_map.txt
Tokens that accept variants have 5 of them:
[TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>:1] [TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>:2] [TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>:3] [TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>:4] [TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>:5]
Otherwise:
[TILE_GRAPHICS:<tile page identifier>:<x position>:<y position>:<TOKEN>]