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
(fresh coat of paint)
Line 1: Line 1:
[[Category:Modding]]{{Old|0.23.130.23a}}
+
[[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).
 +
 +
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.
 +
 +
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 ==
 +
 +
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.
 +
 +
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==
 
==Basic Syntax==
Line 35: Line 48:
 
* match
 
* match
 
* replacement
 
* 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"?
+
| 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}}
  
 
|-
 
|-
Line 57: Line 70:
 
|
 
|
 
* 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, though it does need to be unique within the BODY template.
+
| 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.
  
 
|-
 
|-
 
| BREATHE
 
| BREATHE
 
|  
 
|  
| The body part is necessary to breathe.  If the body part is destroyed, the creature can suffocate.
+
| The body part is necessary to breathe.  If the body part is destroyed, the creature can suffocate unless it has the NOBREATHE token.
  
 
|-
 
|-
Line 198: Line 211:
 
|-
 
|-
 
|}
 
|}
 +
  
 
==Body Part Types==
 
==Body Part Types==
Line 204: Line 218:
  
 
* APERTURE
 
* APERTURE
* BREATHE?
+
* BREATHE{{verify}}
* CIRCULATION?
+
* CIRCULATION{{verify}}
* DIGIT?
+
* DIGIT{{verify}}
* FLIER?
+
* FLIER{{verify}}
 
* GRASP
 
* GRASP
* GUTS?
+
* GUTS{{verify}}
* HEAD?
+
* HEAD{{verify}}
* HEAR
+
* HEAR{{verify}}
* JOINT?
+
* JOINT{{verify}}
* LIMB?
+
* LIMB{{verify}}
* LOWERBODY?
+
* LOWERBODY{{verify}}
 
* MOUTH
 
* MOUTH
* NERVOUS?
+
* NERVOUS{{verify}}
 
* SMELL
 
* SMELL
 
* STANCE
 
* STANCE
 
* THOUGHT
 
* THOUGHT
* UPPERBODY?
+
* UPPERBODY{{verify}}
 +
 
 +
Entries suffixed with "Verify" have not yet been tested and are included based on reasonable assumption.
 +
 
 +
==Example==
 +
 
 +
An [[elephant]] is comprised 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
  
Entries suffixed with a question mark are untested and should not be considered final.  Entries with no question mark are tested and valid.
 
  
 
[[Category:Modding]]
 
[[Category:Modding]]
 
[[Category:Tokens]]
 
[[Category:Tokens]]

Revision as of 02:16, 30 July 2008


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

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.

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

filename

[OBJECT:BODY]

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

[BODYGLOSS:FOOBAR:foo:bar]


Body

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

Token Arguments Description
APERTURE Unknown effect. An opening in the body, apparently, but no known purpose.
BP
  • 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.
BREATHE The body part is necessary to breathe. If the body part is destroyed, the creature can suffocate unless it has the NOBREATHE token.
CIRCULATION If this body part is destroyed, the creature will bleed to death?
CON
  • id
The specific body part object ID to which this body part attaches.
CONTYPE
  • type
The body part token type to which this body part attaches.
DIGIT Is a finger/toe. Unknown effect.
EMBEDDED The body part is embedded into the body -- it is external, but is not shown until injured. Compare INTERNAL. Can be gouged out?
FLIER The body part is necessary for the creature to fly, and damage to the body part will ground the creature.
GRASP The body part can be used to hold items (if the creature has the EQUIPS token) or wrestle.
GUTS Can be disembowelled?
HEAD Vital bodypart. If severed, creature dies.
HEAR Unknown effect. Presumably allows the creature to listen.
INTERNAL The body part is an internal organ and is not visible until injured.
JOINT Can be broken by wrestling (possibly falling damage in a future version).
LEFT The body part is on the left side of the creature and is thus vulnerable to attacks from the left side.
LIMB The body part is usable for wrestling (i.e. can grab, lock, choke, etc).
LOWERBODY The body part is another part of the "core" of the creature. When the lowerbody body part is destroyed, the creature is bisected.
MOUTH Allows the creature to eat?
NERVOUS Causes pain when destroyed. Other effects?
RIGHT The body part is on the right side of the creature and is thus vulnerable to attacks from the right side.
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.
SKELETON Prevents game code from removing this bodypart when the creature is converted to skeletal undead.
SMALL Unknown effect. Reduces chance to hit?
SMELL Unknown effect. Presumably allows creature to smell.
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 adds toes to the body part. This can be problematic as the body part can be armored by a boot.
THOUGHT Necessary for the creature to think. Without a working brain, the creature dies unless it has the NOTHOUGHT Creature Token.
THROAT Can be strangled with wrestling to cause winding, unconsciousness, and eventual death.
UPPERBODY The body part is the "core" of the creature; when the upperbody body part is destroyed, the creature is blown apart.


Body Part Types

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

Entries suffixed with "Verify" have not yet been tested and are included based on reasonable assumption.

Example

An elephant is comprised 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