Modding:Bodies

From Caves of Qud Wiki
Revision as of 02:47, 6 July 2024 by Kernelmethod (talk | contribs) (Start adding more content to the bodies article)
Jump to navigation Jump to search
This page is about modding. See the modding overview for an abstract on modding.
This page is about modding. See the modding overview for an abstract on modding.
This article is a stub. You can help Caves of Qud Wiki by expanding it.
This article is a stub. You can help Caves of Qud Wiki by expanding it.

Bodies are how the game conceptually organizes creatures, primarily for purposes of equipment slots. Through modding, the body of any creature is completely customizable.

Bodies.xml

The data file for body information is Bodies.xml. It's organized into three main sections:

  • bodyparttypes (or types for short), the core kinds of body parts;
  • bodyparttypevariants (or variants for short), body part sub-types that are more or less interchangeable with other parts of the same main type;
  • and anatomies, which are actual structures of body parts. These are assigned to objects in ObjectBlueprints.xml.

Caves of Qud provides support for defining custom body part types, variants, and anatomies.

Body part types

Body part types are defined under the <bodypartytypes /> tag in Bodies.xml. For example, the Head part type is defined as follows:

<bodies>
  <bodyparttypes>
    <!-- ... -->
    <bodyparttype Type="Head" LimbBlueprintProperty="SeveredHeadBlueprint" LimbBlueprintDefault="GenericHead" Mortal="true" Appendage="true" UsuallyOn="Body" Branching="Lateral,Longitudinal,Vertical,Stratal" ChimeraWeight="3" />
    <!-- ... -->
  </bodyparttypes>

  <!-- Variants and anatomies are defined below -->
  <!-- ... -->
</bodies>

A body part type defines a large, abstracted category of features in a creature's anatomy. The Hand body part type encompasses a human hand, a plant's tendril, and a robotic manipulator; the Face body part type encompasses a human's face, a fungus's sensory frills, and an ooze's sensory ganglion. In practice, the variant of a body part type affects what kinds of items can be equipped into its resulting inventory slot.

You can mod in your own body part variants by defining your own Bodies.xml. For example, here is how someone might hypothetically define an Ear part type:

<bodies>
  <bodyparttypes>
    <bodyparttype Type="Ear" LimbBlueprintProperty="SeveredEarBlueprint" Appendage="true" UsuallyOn="Head" Branching="Lateral,Longitudinal,Vertical,Stratal" ChimeraWeight="1" />
  </bodyparttypes>
</bodies>

Here are the attributes supported by the <bodyparttype> tag:

Attribute Description
Abstract
Appendage
Branching
Category
ChimeraWeight Weight affecting the probability that the limb type is selected when generating a new limb via the Chimera morphotype.
Contact
DefaultBehavior
Description
DescriptionPrefix
ImpliedPer
Integral
LimbBlueprintProperty The tag to look for to determine the object blueprint that should be used when this limb is severed. For example, the Hand part type specifies the SeveredHandBlueprint limb blueprint. This is used by robots to define the default hand type they should drop:
<objects>
  <!-- ... -->
  <object Name="Robot" Inherits="Creature">
    <!-- ... -->
    <tag Name="SeveredHandBlueprint" Value="RobotHand" />
    <!-- ... -->
  </object>
  <!-- ... -->
</objects>
LimbBlueprintDefault The default blueprint that should be used for a severed version of the limb when one isn't explicitly specified.
Mobility
Mortal
Name The name of the part type. Should be unique.
NoArmorAveraging
Plural
UsuallyOn