Modding:Pets

From Caves of Qud Wiki
Revision as of 20:34, 11 July 2024 by Kernelmethod (talk | contribs) (Add link to Marmus Mulegus)
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.

Pets are primarily provided to Patreon members for supporting the Caves of Qud community. However, the system used to mod in pets exists within the base game, and it's relatively straightforward to mod in your own pet with just XML.

Modding in a custom pet

Technically, the only thing that you need in order to mod in a custom pet is to add

<tag Name="StartingPet" />

to its blueprint. For example, the following XML is sufficient to add a snapjaw scavenger pet to the game:

<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <object Name="Snapjaw Scavenger Pet" Inherits="Snapjaw Scavenger">
    <tag Name="StartingPet" />
  </object>
</objects>

This will cause a snapjaw scavenger pet to appear in the character customization menu.

In practice, however, you will usually want to give your pet custom skills, mutations, stats, and so on. In addition, pets are usually differentiated from regular creatures in the following ways:

  • They have the Pettable part, and the PetResponse tag.
  • They have a unique tile (see Modding:Tiles).
  • They have the Story property, which points to a unique story written relating to the pet.
  • They have a unique conversational script (see Modding:Conversations).

None of these are strictly necessary; for instance, Hylaeus uses the regular conversational script for dogs. However, these components help to round out your pet and flesh them out as unique characters.

For a complete example of a pet that includes all of these pieces, check out the Marmus Mulegus mod (source code).

Pettable

To make a pet pettable, you will need to give them the Pettable part, as well as the PetResponse tag. The value assigned to PetResponse is a comma-separated list of the different responses that the pet can have. Continuing our snapjaw scavenger pet example from before, here is how you would define some custom pet responses for your snapjaw pet:

<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <object Name="Snapjaw Scavenger Pet" Inherits="Snapjaw Scavenger">
    <part Name="Pettable" />
    <tag Name="PetResponse" Value="licks you,growls" />
    <tag Name="StartingPet" />
  </object>
</objects>

Story

To give your pet its own backstory, you should give them the Story property. For example:

<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <object Name="Snapjaw Scavenger Pet" Inherits="Snapjaw Scavenger">
    <part Name="Pettable" />
    <property Name="Story" Value="My Snapjaw Scavenger Story" />
    <tag Name="PetResponse" Value="licks you,growls" />
    <tag Name="StartingPet" />
  </object>
</objects>

Then in Books.xml, you can define a story under the My Snapjaw Scavenger Story ID:

<?xml version="1.0" encoding="utf-8" ?>
<books>
  <book ID="My Snapjaw Scavenger Story" Title="{{W|My Story Title}}">
    <page>
Write your story for your creature here!
    </page>
  </book>
</books>