Modding:Bodies: Difference between revisions
Kernelmethod (talk | contribs) Start adding more content to the bodies article |
BinaryDoubts (talk | contribs) No edit summary |
||
(8 intermediate revisions by one other user not shown) | |||
Line 10: | Line 10: | ||
* and <code>anatomies</code>, which are actual structures of body parts. These are assigned to objects in ObjectBlueprints.xml. | * and <code>anatomies</code>, 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. | Caves of Qud provides support for defining custom body part types, variants, and anatomies. To have a creature use a specific anatomy, you set the <code>Body</code> part in that creature's object blueprint definition. For example: | ||
<syntaxhighlight lang="xml"> | |||
<part Name="Body" Anatomy="Spider" /> | |||
</syntaxhighlight> | |||
This tells the game that you want to use the <code>Spider</code> anatomy for a given creature. | |||
== Body part types == | == Body part types == | ||
Body part types are defined under the <code><bodypartytypes | Body part types are defined under the <code><bodypartytypes></code> tag in <code>Bodies.xml</code>. For example, the <code>Head</code> part type is defined as follows: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 29: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
A body part type defines a | A body part type defines a abstracted category of possible features in a creature's anatomy. The <code>Hand</code> body part type encompasses a human hand, a plant's tendril, and a robotic manipulator; the <code>Face</code> 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. | ||
Here are the attributes supported by the <code><bodyparttype></code> tag: | You can mod in your own body part variants by defining your own <code>Bodies.xml</code>. Here are the attributes supported by the <code><bodyparttype></code> tag: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 49: | Line 45: | ||
|- | |- | ||
| Abstract | | Abstract | ||
| | | Marks a body part type as abstract. This is used to provide equipment slots that don't actually map to physical limbs, e.g. floating nearby slots, thrown weapon, and missile weapon slots. An abstract body part cannot be chosen as a primary limb. | ||
|- | |- | ||
| Appendage | | Appendage | ||
| | | Marks a limb type as an appendage, allowing it to be severed{{Code Reference|namespace=XRL.World.Anatomy|class=BodyPart|method=IsSeverable}} (note that abstract body part types are non-severable by default). | ||
|- | |- | ||
| Branching | | Branching | ||
Line 70: | Line 66: | ||
|- | |- | ||
| Description | | Description | ||
| | | Overrides the name of the body slot as it appears in the inventory menu. | ||
|- | |- | ||
| DescriptionPrefix | | DescriptionPrefix | ||
| Adds a prefix to the name of the body slot as it appears in the inventory menu. For example, the <code>Back</code> slot has a <code>DescriptionPrefix</code> of <code>Worn on</code>, so the slot appears as "worn on back" in the inventory screen. | |||
|- | |||
| Extrinsic | |||
| Marks a body part type as being extrinsic to a creature's body; for example, the robo-hands and robo-arms granted by {{favilink|helping hands}}. This has a few minor effects; for example, it ensures that the body part doesn't get copied when creating a copy of your anatomy. It also prevents that body part from being set as a primary limb and prevents it from dropping an object when severed. | |||
|- | |||
| ImpliedBy | |||
| | | | ||
|- | |- | ||
Line 99: | Line 101: | ||
|- | |- | ||
| Mobility | | Mobility | ||
| | | Marks the limb as providing mobility, and gives a weight to how much that limb contributes to the creature's overall mobility. In the case where the limb is severed, its mobility score influences the creature's resultant loss in movement speed. For example, a limb with <code>Mobility="10"</code> contributes ten times as much to a creature's overall mobility as a limb with <code>Mobility="1"</code>. | ||
|- | |- | ||
| Mortal | | Mortal | ||
| | | Marks a body part as mortal, which has implications for skills like [[Amputate Limb]] and [[Decapitate]]. Heads are the most common example of mortal body party. | ||
|- | |- | ||
| Name | | Name | ||
Line 108: | Line 110: | ||
|- | |- | ||
| NoArmorAveraging | | NoArmorAveraging | ||
| Disable averaging of [[AV]] across body parts of this type. | |||
|- | |||
| Plural | |||
| | |||
|- | |||
| UsuallyOn | |||
| | |||
|- | |||
|} | |||
== Body part type variants == | |||
In addition to specifying broad categories of body part types, you can also specify ''variants''. Outside of any properties that you explicitly define for a variant, these are functionally equivalent to their original type. | |||
Here is how <code>Bodies.xml</code> defines the <code>Tentacle</code> part type: | |||
<syntaxhighlight lang="xml"> | |||
<bodies> | |||
<!-- ... --> | |||
<bodyparttypevariants> | |||
<!-- ... --> | |||
<bodyparttypevariant VariantOf="Hand" Type="Tentacle" DefaultBehavior="SoftManipulator" Mobility="1" UsuallyOn="Body" /> | |||
<!-- ... --> | |||
</bodyparttypevariants> | |||
<!-- ... --> | |||
</bodies> | |||
</syntaxhighlight> | |||
<code>VariantOf</code> specifies the original part type that this variant belongs to; <code>Type</code> is the unique name of the variant. A type variant can define any of the properties that would normally be defined by a <code>bodyparttype</code>. | |||
== Anatomies == | |||
An <code>anatomy</code> is a collection of body parts. An anatomy is defined in XML as a nested collection of <code><part></code> tags. As an example, here is the default anatomy of a bird: | |||
<syntaxhighlight lang="xml"> | |||
<bodies> | |||
<!-- ... --> | |||
<anatomies> | |||
<!-- ... --> | |||
<anatomy Name="Bird"> | |||
<part Type="Head"> | |||
<part Type="Face" DefaultBehavior="Beak" /> | |||
</part> | |||
<part Type="Back" /> | |||
<part Type="Foot" Laterality="Right" SupportsDependent="Feet" /> | |||
<part Type="Foot" Laterality="Left" SupportsDependent="Feet" /> | |||
<part Type="Missile Weapon" Laterality="Right" /> | |||
<part Type="Missile Weapon" Laterality="Left" /> | |||
<part Type="Feet" DependsOn="Feet" /> | |||
<part Type="Tail" /> | |||
</anatomy> | |||
<!-- ... --> | |||
</anatomies> | |||
</bodies> | |||
</syntaxhighlight> | |||
The <code>anatomy</code> tag supports the following attributes: | |||
{| class="wikitable" | |||
|- | |||
! Attribute | |||
! Description | |||
|- | |||
| BodyCategory | |||
| | |||
|- | |||
| BodyMobility | |||
| Weighs the creature's body slot when computing the total mobility of the creature. This is used by some creatures, such as creatures with the <code>Snake</code> or <code>Slug</code> anatomies, that don't have any foot slots by default. | |||
|- | |||
| BodyType | |||
| The type of <code>Body</code> (the body part type) that should be used for the creature. You can use this to replace the default <code>Body</code> slot for a creature with a custom type variant. | |||
|- | |||
| Category | |||
| | |||
|- | |||
| FloatingNearby | |||
| The type of <code>FloatingNearby</code> body part type that should be used for the creature. This allows you to use a type variant for floating nearby slots. | |||
|- | |||
| ThrownWeapon | |||
| The type of <code>Thrown Weapon</code> body part type that should be used for the creature. This allows you to use a type variant for thrown weapon slots. For example, the <code>BipedalRobot</code> anatomy adds a thrown weapon slot using a <code>Middle Hardpoint</code>: | |||
<syntaxhighlight lang="xml"> | |||
<anatomy Name="BipedalRobot" Category="Mechanical" ThrownWeapon="Middle Hardpoint"> | |||
<part Type="Control Unit"> | |||
<part Type="Sensor Array" /> | |||
</part> | |||
<part Type="Chassis" /> | |||
<part Type="Hardpoint" Laterality="Right" /> | |||
<part Type="Hardpoint" Laterality="Left" /> | |||
<part Type="Feet" /> | |||
</anatomy> | |||
</syntaxhighlight> | |||
|} | |||
Meanwhile, the <code><part></code> tag in <code>Bodies.xml</code> supports: | |||
{| class="wikitable" | |||
|- | |||
! Attribute | |||
! Description | |||
|- | |||
| Abstract | |||
| Marks the body part as abstract. | |||
|- | |||
| Category | |||
| Alter the category of the limb. | |||
|- | |||
| Contact | |||
| | |||
|- | |||
| DefaultBehavior | |||
| | |||
|- | |||
| DependsOn | |||
| | |||
|- | |||
| Extrinsic | |||
| | | | ||
|- | |||
| IgnorePosition | |||
| | |||
|- | |||
| Integral | |||
| Alter the integrality of the limb. | |||
|- | |||
| Laterality | |||
| Used to set the position / orientation of the limb. <code>Laterality</code> allows players to distinguish limbs of the same type from one another. For example, humanoids have a left and right arm; fish have a left and right fin; frogs have left fore, right fore, left hind, and right hind feet. | |||
|- | |||
| Mass | |||
| | |||
|- | |||
| Mobility | |||
| Alter the mobility contribution of the limb. | |||
|- | |||
| Mortal | |||
| Alter the mortality of the limb. | |||
|- | |- | ||
| Plural | | Plural | ||
| | | | ||
|- | |- | ||
| | | RequiresLaterality | ||
| | |||
|- | |||
| RequiresType | |||
| | |||
|- | |||
| SupportsDependent | |||
| | | | ||
|- | |- | ||
| Type | |||
| The name of the body part type or type variant that should be added (for example: <code>Hand</code>, <code>Smooth Face</code>, etc.) | |||
|} | |} | ||
= References = | |||
<references /> | |||
{{Modding Navbox}} | {{Modding Navbox}} | ||
[[Category:Modding]] | [[Category:Modding]] | ||
[[Category:Modding - Creatures and Objects]] |