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 "40d:Body token"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
 
(24 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:Modding]]
+
{{quality|Exceptional|21:17, 30 March 2011 (UTC)}}{{av}}
 +
{{Category|Modding}}
  
 
'''Body tokens''' are one of the fundamental parts of creatures, and determine their bodily structure.  There are two major types of body tokens: ''body templates'' (BODY) and ''body parts'' (BP).
 
'''Body tokens''' are one of the fundamental parts of creatures, and determine their bodily structure.  There are two major types of body tokens: ''body templates'' (BODY) and ''body parts'' (BP).
  
A creature uses the [[creature tokens#B|BODY creature token]] to list all of the body templates it includes.  Each part listed in each template is then included in the creature.  In other words: a creature lists the ''body templates'' it is made of.  Each ''body template'' contains a set of ''body parts''.  Each ''body part'' specifies which other body part it is attached to.
+
A creature uses the [[creature token#B|BODY creature token]] to list all of the body templates it includes.  Each part listed in each template is then included in the creature.  In other words: a creature lists the ''body templates'' it is made of.  Each ''body template'' contains a set of ''body parts''.  Each ''body part'' specifies which other body part it is attached to.
  
 
Body parts can connect specifically to another body part, or generally to any body part of a certain category.  These connections are handled by the CON and CONTYPE body part tokens respectively.
 
Body parts can connect specifically to another body part, or generally to any body part of a certain category.  These connections are handled by the CON and CONTYPE body part tokens respectively.
Line 31: Line 32:
 
==Body==
 
==Body==
  
{| border="1" cellpadding="2" width="100%"
+
{| {{prettytable}}
! width="20%" | Token
+
|- bgcolor="#ddd"
! width="20%" | Arguments
+
! Token
! width="60%" | Description
+
! Arguments
 +
! Description
  
 
|-
 
|-
Line 56: Line 58:
 
==Body Parts==
 
==Body Parts==
  
{| border="1" cellpadding="2" width="100%"
+
{| {{prettytable}}
! width="20%" | Token
+
|- bgcolor="#ddd"
! width="20%" | Arguments
+
! Token
! width="60%" | Description
+
! Arguments
 
+
! Description
|-
 
| APERTURE
 
|
 
| An opening in the body. Cannot be destroyed  except by destroying the part is attached to.
 
  
 
|-
 
|-
Line 70: Line 68:
 
|
 
|
 
* id
 
* id
| The internal object ID of the body part.  Unlike many other tokens in the game, the id of the BP does not need to be unique throughout all of the raw object files, though it does need to be unique within the BODY it is in.
+
* name
 +
| The internal object ID of the body part.  Unlike many other tokens in the game, the id of the BP does not need to be unique throughout all of the raw object files, though it does need to be unique within the BODY it is in, as well as within the set of body templates used by any given creature.
  
 
|-
 
|-
| BREATHE
+
| UPPERBODY
 
|  
 
|  
| The body part is necessary to breatheIf the body part is destroyed, the creature can suffocate unless it has the NOBREATHE token.
+
| The body part is the "core" of the creature; when the upperbody body part is destroyed, the creature is blown apart.
 +
A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these
 +
can't be killed*.  UPPERBODYs aren't redundant, once one is destroyed the creature dies.  Body parts with [CONTYPE:UPPERBODY] will be connected to these.
 +
*most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
 +
 
 +
|-
 +
| LOWERBODY
 +
|
 +
| The body part is another part of the "core" of the creatureWhen the lowerbody body part is destroyed, the creature is bisected.  A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these can't be killed*.  LOWERBODYs aren't redundant, once one is destroyed the creature dies.  Body parts with [CONTYPE:LOWERBODY] will be connected to these.
 +
*most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
  
 
|-
 
|-
| CIRCULATION
+
| HEAD
|  
+
|
| If this body part is destroyed, the creature will bleed to death?
+
| Vital bodypart. If severed, creature dies.  A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these can't be killed*.  HEADs aren't redundant, once one is destroyed the creature dies.  Body parts with [CONTYPE:HEAD] will be connected to these.
 +
*most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
  
 
|-
 
|-
Line 86: Line 95:
 
|
 
|
 
* id
 
* id
| The specific body part ''object ID'' to which this body part attaches.
+
| The specific body part ''object ID'' to which this body part attaches.  This tag is optional.  Interesting effects can be created by leaving unconnected body parts.  If an invalid ID is given, the body part is unconnected.  This can lead to interesting bugs.
  
 
|-
 
|-
Line 92: Line 101:
 
|
 
|
 
* type
 
* type
| The body part ''token type'' to which this body part attaches. Note that if the creature has more than one body part with that token type each of them will get its own additional body part attached.
+
| The body part ''token type'' to which this body part attaches - valid values are UPPERBODY, LOWERBODY, HEAD, GRASP, and STANCE. Note that if the creature has more than one body part with that token type each of them will get its own additional body part attached.  For example, if a creature has two upper bodies (two torsos) and a lower body, the CONTYPE:UPPERBODY means that the two upper torsos are connected to the lower torso by default.  This tag is optional.  Interesting effects can be created by leaving unconnected body parts.
  
 
|-
 
|-
| DIGIT
+
| LIMB
|  
+
|
| Is a finger/toe. Unknown effect.
+
| The body part is usable for [[wrestling]] (i.e. can grab, lock, choke, etc.).
  
 
|-
 
|-
| EMBEDDED
+
| THROAT
 
|  
 
|  
| The body part is embedded into the body -- it is external and can be gouged out. This does not make a part invisible.
+
| Can be strangled with [[wrestling]] to cause winding, unconsciousness, and eventual death. Strangely, even creatures with the NOBREATHE token can be rendered unconscious (but not dead) by strangulation.
  
 
|-
 
|-
| FLIER
+
| JOINT
 
|  
 
|  
| The body part is necessary for the creature to fly, and damage to the body part will ground the creature.
+
| Can be broken by [[wrestling]].
  
 
|-
 
|-
| GRASP
+
| SKELETON
|  
+
|
| The body part can be used to hold items (if the creature has the EQUIPS token) or [[wrestling|wrestle]].
+
| Prevents game code from removing this bodypart when the creature is converted to skeletal undead.
  
 
|-
 
|-
| GUTS
+
| THOUGHT
 
|  
 
|  
| To be thought of like intestines. Can be disembowelled, causing a slow painful death from heavy bleeding.
+
| Necessary for the creature to think. Without a working brain, the creature dies unless it has the NOTHOUGHT Creature Token. Also seems to apply the effects of NERVOUS.
  
 
|-
 
|-
| HEAD
+
| NERVOUS
|
 
| Vital bodypart. If severed, creature dies.
 
 
 
|-
 
| HEAR
 
 
|  
 
|  
| Unknown effect. Presumably allows the creature to listen.
+
| Causes pain when destroyed and appears to stop a part from healing over time. However, it will heal normally if creature is NOTHOUGHT. Other effects?
  
 
|-
 
|-
| INTERNAL
+
| GRASP
 
|  
 
|  
| The body part is an internal organ and is not visible until injured.
+
| The body part can be used to hold items (if the creature has the EQUIPS token) or [[wrestling|wrestle]]. Body parts with [CONTYPE:GRASP] will be connected to these.
  
 
|-
 
|-
| JOINT
+
| FLIER
 
|  
 
|  
| Can be broken by [[wrestling]] (possibly falling damage in a future version).
+
| The body part is necessary for the creature to fly, and damage to the body part will ground the creature.
  
 
|-
 
|-
| LEFT
+
| STANCE
|  
+
|
| The body part is on the left side of the creature and is thus vulnerable to attacks from the left side.
+
| The body part is used to keep the creature standing; injury to the body part will cause the creature to collapse. It also makes the body part act like a foot, and can be problematic as the body part can be armored by a boot.  STANCE body parts that are unconnected to the root (have no CON tag) do not count towards keeping the creature standing (NOTE: if '''any''' [STANCE] body parts are unconnected to root, the creature may fall over.  Further testing required).  Body parts with [CONTYPE:STANCE] will be connected to these.
  
 
|-
 
|-
| LIMB
+
| SIGHT
 
|
 
|
| The body part is usable for [[wrestling]] (i.e. can grab, lock, choke, etc).
+
| Allows creatures to see; creatures without this tag on any part of their bodies cannot see for the purposes of aiming missile weapons (though apparently can find and kill mad adventurers fairly well with melee attacks).  May need more testing.
  
 
|-
 
|-
| LOWERBODY
+
| HEAR
|
+
|  
| The body part is another part of the "core" of the creatureWhen the lowerbody body part is destroyed, the creature is bisected.
+
| Unknown effectPresumably allows the creature to listen. Also makes earrings equippable.
  
 
|-
 
|-
| MOUTH
+
| SMELL
|
+
|  
| Allows the creature to eat?
+
| Unknown effect.  Presumably allows creature to smell.
  
 
|-
 
|-
| NERVOUS
+
| EMBEDDED
 
|  
 
|  
| Causes pain when destroyed and appears to stop a part from healing over time. Other effects?
+
| The body part is embedded into the body -- it is external and can be gouged out. This does not make a part invisible.
  
 
|-
 
|-
| RIGHT
+
| APERTURE
 
|  
 
|  
| The body part is on the right side of the creature and is thus vulnerable to attacks from the right side.
+
| An opening in the body. Cannot be destroyed  except by destroying the part is attached to.
  
 
|-
 
|-
| SIGHT
+
| SMALL
|
+
|  
| Allows creatures to see; creatures without this tag on any part of their bodies cannot see for the purposes of aiming missile weapons (though apparently can find and kill mad adventurers fairly well with melee attacks).  May need more testing.
+
| Unknown effect.  Reduces chance to hit? Also will cloak body parts much like the [INTERNAL] or the [EMBEDDED] tags will. Allows body parts to be pinched.  In 40d it appears that body parts are visible unless [SMALL], even if they are [INTERNAL] or [EMBEDDED].  If the root (first BP) of the creature is [SMALL], it will not be targeted until all other parts have been severed or torn off.
  
 
|-
 
|-
| SKELETON
+
| INTERNAL
|
+
|  
| Prevents game code from removing this bodypart when the creature is converted to skeletal undead.
+
| The body part is an internal organ and is not visible until injured.  In 40d, it appears that the [SMALL] tag is what actually makes organs invisible, and that non-SMALL internal organs are visible even before being damaged.
  
 
|-
 
|-
| SMALL
+
| BREATHE
 
|  
 
|  
| Unknown effectReduces chance to hit? Also will cloak body parts much like the [INTERNAL] or the [EMBEDDED] tags will. Allows body parts to be pinched.
+
| The body part is necessary to breatheIf the body part is destroyed, the creature can suffocate unless it has the NOBREATHE token. The NOBREATHE token also causes the part to heal normally.
  
 
|-
 
|-
| SMELL
+
| CIRCULATION
 
|  
 
|  
| Unknown effect.  Presumably allows creature to smell.
+
| If this body part is destroyed, the creature will bleed to death?
  
 
|-
 
|-
| STANCE
+
| GUTS
|
+
|  
| The body part is used to keep the creature standing; injury to the body part will cause the creature to collapse. It also makes the body part act like a foot, and can be problematic as the body part can be armored by a boot.
+
| To be thought of like intestines. Can be disemboweled, causing a slow painful death from heavy bleeding.
  
 
|-
 
|-
| THOUGHT
+
| RIGHT
 
|  
 
|  
| Necessary for the creature to think.  Without a working brain, the creature dies unless it has the NOTHOUGHT Creature Token. Also seems to apply the effects of NERVOUS.
+
| The body part is on the right side of the creature and is thus vulnerable to attacks from the right side.
  
 
|-
 
|-
| THROAT
+
| LEFT
 
|  
 
|  
| Can be strangled with [[wrestling]] to cause winding, unconsciousness, and eventual death. Strangely, even creatures with the NOBREATHE token can be rendered unconscious (but not dead) by strangulation.
+
| The body part is on the left side of the creature and is thus vulnerable to attacks from the left side.
  
 
|-
 
|-
| UPPERBODY
+
| DIGIT
 
|  
 
|  
| The body part is the "core" of the creature; when the upperbody body part is destroyed, the creature is blown apart.
+
| Is a finger/toe.  Unknown effect.  DIGITs '''may''' only be damaged when their connected body part is damaged, they do not appear to be valid targets for damage otherwise.
  
 
|-
 
|-
 +
| MOUTH
 +
|
 +
| Unknown effect. Does not allow creature to eat.  Often tied to a creature's attacks, so this may be the primary use of the tag.
 
|}
 
|}
  
 
==Body Part Types==
 
==Body Part Types==
  
Legal token types for use with the Attack Token "BYTYPE" argument or for the Body Token "CONTYPE" argument:
+
Legal token types for use with the Attack Token "BYTYPE" argument:
  
 
* APERTURE
 
* APERTURE
Line 333: Line 340:
 
To understand how the above connections are determined (for example, why "lower spine" knows that it goes in "lower body", why "heart" knows that it goes in "upper body", etc.) refer to the CONTYPE tag.
 
To understand how the above connections are determined (for example, why "lower spine" knows that it goes in "lower body", why "heart" knows that it goes in "upper body", etc.) refer to the CONTYPE tag.
  
[[Category:Modding]]
+
{{Category|Modding}}
[[Category:Tokens]]
+
{{Category|Tokens}}

Latest revision as of 20:06, 23 June 2017

This article is about an older version of DF.

Body tokens are one of the fundamental parts of creatures, and determine their bodily structure. There are two major types of body tokens: body templates (BODY) and body parts (BP).

A creature uses the BODY creature token to list all of the body templates it includes. Each part listed in each template is then included in the creature. In other words: a creature lists the body templates it is made of. Each body template contains a set of body parts. Each body part specifies which other body part it is attached to.

Body parts can connect specifically to another body part, or generally to any body part of a certain category. These connections are handled by the CON and CONTYPE body part tokens respectively.

Body parts can be renamed with a bodygloss, allowing someone to reuse an existing template instead of defining a similar template with only the names of the body parts changed.

Convention[edit]

The convention in the unmodded raw object data in Dwarf Fortress is to make the centre of mass the core of the creature. All other body parts then attach to this central mass, or to those body parts that attach to this central mass. Creating chains of attachments in this fashion produces limbs. If a part is listed before a part that it is attached to is, this can create strange bugs, such as the creatures instantly suffocating.

While it is possible to use the CON token to connect to a specific body part ID even if it is in another template, it is convention within the default raw object data to use a CONTYPE if the connected part is in another template, for safety. Otherwise, a creature must have both templates within its BODY token to prevent unpredictable behaviour when the creature is used during world generation or simulated during gameplay.

Basic Syntax[edit]

filename

[OBJECT:BODY]

[BODY:TEMPLATE1]
[BP:CORE][UPPERBODY][...]
[BP:PART1][CONTYPE:UPPERBODY][...]
[BP:PART2][CON:CORE][...]

[BODYGLOSS:FOOBAR:foo:bar]


Body[edit]

Token Arguments Description
BODY
  • id
The name of the body template. Each BP token underneath a given Body Token BODY template is added to a creature when the Creature Token BODY specifies this ID.
BODYGLOSS
  • id
  • match
  • replacement
Replaces all occurrences of "match" in the creature's body parts with "replacement". E.g., the Body Token [BODYGLOSS:TENTACLE:leg:tentacle], used by the Creature Token [BODYGLOSS:TENTACLE], will cause any "right leg" to appear as "right tentacle". Testing required: would "brain legend" appear as "brain tentacleend"?[Verify]


Body Parts[edit]

Token Arguments Description
BP
  • id
  • name
The internal object ID of the body part. Unlike many other tokens in the game, the id of the BP does not need to be unique throughout all of the raw object files, though it does need to be unique within the BODY it is in, as well as within the set of body templates used by any given creature.
UPPERBODY The body part is the "core" of the creature; when the upperbody body part is destroyed, the creature is blown apart.

A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these can't be killed*. UPPERBODYs aren't redundant, once one is destroyed the creature dies. Body parts with [CONTYPE:UPPERBODY] will be connected to these.

  • most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
LOWERBODY The body part is another part of the "core" of the creature. When the lowerbody body part is destroyed, the creature is bisected. A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these can't be killed*. LOWERBODYs aren't redundant, once one is destroyed the creature dies. Body parts with [CONTYPE:LOWERBODY] will be connected to these.
  • most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
HEAD Vital bodypart. If severed, creature dies. A creature doesn't die until an UPPERBODY, HEAD, or LOWERBODY is destroyed, so a creature without one or all of these can't be killed*. HEADs aren't redundant, once one is destroyed the creature dies. Body parts with [CONTYPE:HEAD] will be connected to these.
  • most creatures can also be killed indirectly by suffocation or blood loss. (or brain damage?).
CON
  • id
The specific body part object ID to which this body part attaches. This tag is optional. Interesting effects can be created by leaving unconnected body parts. If an invalid ID is given, the body part is unconnected. This can lead to interesting bugs.
CONTYPE
  • type
The body part token type to which this body part attaches - valid values are UPPERBODY, LOWERBODY, HEAD, GRASP, and STANCE. Note that if the creature has more than one body part with that token type each of them will get its own additional body part attached. For example, if a creature has two upper bodies (two torsos) and a lower body, the CONTYPE:UPPERBODY means that the two upper torsos are connected to the lower torso by default. This tag is optional. Interesting effects can be created by leaving unconnected body parts.
LIMB The body part is usable for wrestling (i.e. can grab, lock, choke, etc.).
THROAT Can be strangled with wrestling to cause winding, unconsciousness, and eventual death. Strangely, even creatures with the NOBREATHE token can be rendered unconscious (but not dead) by strangulation.
JOINT Can be broken by wrestling.
SKELETON Prevents game code from removing this bodypart when the creature is converted to skeletal undead.
THOUGHT Necessary for the creature to think. Without a working brain, the creature dies unless it has the NOTHOUGHT Creature Token. Also seems to apply the effects of NERVOUS.
NERVOUS Causes pain when destroyed and appears to stop a part from healing over time. However, it will heal normally if creature is NOTHOUGHT. Other effects?
GRASP The body part can be used to hold items (if the creature has the EQUIPS token) or wrestle. Body parts with [CONTYPE:GRASP] will be connected to these.
FLIER The body part is necessary for the creature to fly, and damage to the body part will ground the creature.
STANCE The body part is used to keep the creature standing; injury to the body part will cause the creature to collapse. It also makes the body part act like a foot, and can be problematic as the body part can be armored by a boot. STANCE body parts that are unconnected to the root (have no CON tag) do not count towards keeping the creature standing (NOTE: if any [STANCE] body parts are unconnected to root, the creature may fall over. Further testing required). Body parts with [CONTYPE:STANCE] will be connected to these.
SIGHT Allows creatures to see; creatures without this tag on any part of their bodies cannot see for the purposes of aiming missile weapons (though apparently can find and kill mad adventurers fairly well with melee attacks). May need more testing.
HEAR Unknown effect. Presumably allows the creature to listen. Also makes earrings equippable.
SMELL Unknown effect. Presumably allows creature to smell.
EMBEDDED The body part is embedded into the body -- it is external and can be gouged out. This does not make a part invisible.
APERTURE An opening in the body. Cannot be destroyed except by destroying the part is attached to.
SMALL Unknown effect. Reduces chance to hit? Also will cloak body parts much like the [INTERNAL] or the [EMBEDDED] tags will. Allows body parts to be pinched. In 40d it appears that body parts are visible unless [SMALL], even if they are [INTERNAL] or [EMBEDDED]. If the root (first BP) of the creature is [SMALL], it will not be targeted until all other parts have been severed or torn off.
INTERNAL The body part is an internal organ and is not visible until injured. In 40d, it appears that the [SMALL] tag is what actually makes organs invisible, and that non-SMALL internal organs are visible even before being damaged.
BREATHE The body part is necessary to breathe. If the body part is destroyed, the creature can suffocate unless it has the NOBREATHE token. The NOBREATHE token also causes the part to heal normally.
CIRCULATION If this body part is destroyed, the creature will bleed to death?
GUTS To be thought of like intestines. Can be disemboweled, causing a slow painful death from heavy bleeding.
RIGHT The body part is on the right side of the creature and is thus vulnerable to attacks from the right side.
LEFT The body part is on the left side of the creature and is thus vulnerable to attacks from the left side.
DIGIT Is a finger/toe. Unknown effect. DIGITs may only be damaged when their connected body part is damaged, they do not appear to be valid targets for damage otherwise.
MOUTH Unknown effect. Does not allow creature to eat. Often tied to a creature's attacks, so this may be the primary use of the tag.

Body Part Types[edit]

Legal token types for use with the Attack Token "BYTYPE" argument:

  • APERTURE
  • BREATHE
  • CIRCULATION
  • DIGIT
  • FLIER
  • GRASP
  • GUTS
  • HEAD
  • HEAR
  • JOINT
  • LIMB
  • LOWERBODY
  • MOUTH
  • NERVOUS
  • SMELL
  • STANCE
  • THOUGHT
  • UPPERBODY

Example[edit]

An elephant is composed of a large number of body parts, but only includes a small list of templates. When an elephant asks for the following 15 templates in its CREATURE:ELEPHANT token:

[BODY:QUADRUPED:TAIL:2EYES:2EARS:TRUNK:2LUNGS:HEART:GUTS:ORGANS:THROAT:NECK:SPINE:BRAIN:MOUTH:2TUSKS]

...it gets all of the following 35 body parts:

QUADRUPED:
  - upper body
  - lower body
  - head
  - right front leg
  - left front leg
  - right front foot
  - left front foot
  - right rear leg
  - left rear leg
  - right rear foot
  - left rear foot
TAIL:
  - tail
2EYES:
  - right eye
  - left eye
2EARS:
  - right ear
  - left ear
TRUNK:
  - trunk
2LUNGS:
  - right lung
  - left lung
HEART:
  - heart
GUTS:
  - guts
ORGANS:
  - liver
  - stomach
  - pancreas
  - spleen
  - right kidney
  - left kidney
THROAT:
  - throat
NECK:
  - neck
SPINE:
  - upper spine
  - lower spine
BRAIN:
  - brain
MOUTH:
  - mouth
2TUSKS:
  - right tusk
  - left tusk

The body part tree of the elephant, after connections are made, is as follows:

+ upper body
  - heart
  - upper spine
  - right lung
  - left lung
  + head
    - brain
    - mouth
    - trunk
    - right tusk
    - left tusk
    - right eye
    - left eye
    - right ear
    - left ear
    - neck
    - throat
  + right front leg
    - right front foot
  + left front leg
    - left front foot
  + lower body
    - lower spine
    - guts
    - tail
    - liver
    - stomach
    - pancreas
    - spleen
    - right kidney
    - left kidney
    + right rear leg
      - right rear foot
    + left rear leg
      - left rear foot

To understand how the above connections are determined (for example, why "lower spine" knows that it goes in "lower body", why "heart" knows that it goes in "upper body", etc.) refer to the CONTYPE tag.