Modding:Genotypes and Subtypes

From Caves of Qud Wiki
Revision as of 07:24, 27 June 2024 by Kernelmethod (talk | contribs) (Start genotypes and subtypes rewrite)
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.

Genotypes and subtypes can be created with only some basic XML files. No scripting is required.

Creating a new genotype

Genotypes are defined in Genotypes.xml. This file is structured as follows:

XML tag Description
<genotype> Defines top-level properties of a genotype, including
  • the name of the genotype;
  • stats granted to players upon starting the game;
  • stats granted to players upon leveling up;
  • screens that the player must go through during character creation (adding custom screens usually requires scripting);

and so on.

<stat> The starting value for a particular statistic for the genotype.
<skills> The skills that should be granted to the player by default upon starting the game.
<reputations> Starting reputations with different factions for starting the game as the given genotype. Note that <reputations> is preferred over specifying a Reputation="..." attribute in the <genotype> tag (which used to be the main way to set starting reputations).
<extrainfo> Additional info that should appear underneath the genotype when the player is choosing a genotype.

Creating a new subtype

Custom naming conventions

You can define custom names for subtypes by writing a Naming.xml with namestyles assigned to those subtypes (naming is assigned on a subtype level rather than by genotype).

Example: a snapjaw genotype =

Generally you'll want to include a Genotypes.xml, a Subtypes.xml, and a PopulationTables.xml (the latter defines starting gear for your subtypes). You can also add naming schemes to subtypes by making a Naming.xml with a namestyle assigned to those subtypes. (Naming is assigned on a subtype level rather than by genotypes.)

Additional files may be included depending on what exactly you want to do. For instance, you might include custom tiles or custom items defined in an ObjectBlueprints.xml.

For reference, you can see the game's default files for reference at File locations. You can also refer to some of the example mods that are available to see how to set them up.