Race Settings - erdelf/AlienRaces GitHub Wiki

RaceSettings are an option used to enable various additional compatibility functions for mod compatibility.

RaceSettings is a custom Def type. All of the following settings must be placed inside an AlienRace.RaceSettings Def object.

<?xml version="1.0" encoding="utf-8" ?>
<Defs>
  
  <AlienRace.RaceSettings>
    <defName>MyRace_RaceSettings</defName>
    
    <!-- options placed here -->
    
  </AlienRace.RaceSettings>

</Defs>

As with all Def types, your defName must be globally unique across all mod content, thus it is strongly recommended that you use a unique prefix to prevent mod collisions.

PawnKind Settings

All of the following settings must be placed inside a pawnKindSettings tag inside of your RaceSettings Def:

<AlienRace.RaceSettings>
  <defName>MyRace_RaceSettings</defName>

  <pawnKindSettings>
    <!-- options placed here -->
  </pawnKindSettings>

</AlienRace.RaceSettings>
Setting Default Description
<startingColonists>
  <li>
    <pawnKindEntries>
      <li>
        <kindDefs>
          <li>MyRace_ColonistPawnKind</li>
        </kindDefs>
        <chance>100.0</chance>
      </li>
    </pawnKindEntries>
    <factionDefs>
      <li>PlayerColony</li> 
    </factionDefs>
  </li>
</startingColonists>
(Optional) Allows your race to be randomly generated as starting members for the specified player FactionDef. Generally used to add your race to vanilla scenarios or scenarios from other mods; if you only want your race to spawn as part of your NPC factions or your own custom starting scenarios, then this is unnecessary.

Chance is a weight value, with the default value for that FactionDef being 100.

PlayerColony is the vanilla FactionDef used for Crashlanded, Rich Explorer, and Naked Brutality. Lost Tribe uses PlayerTribe.

<alienwandererkinds>
  <li>
    <pawnKindEntries>
      <li>
        <kindDefs>
          <li>ExampleAlienKind</li>
        </kindDefs>
        <chance>100.0</chance>
      </li>
    </pawnKindEntries>
    <factionDefs>
      <li>PlayerColony</li> 
    </factionDefs>
  </li>
</alienwandererkinds>
(Optional) Allows your race to be randomly generated in Wanderer Joins events for the specified player FactionDef.

Formatting is otherwise the same as for startingColonists above.

<alienslavekinds>
  <li>
    <kindDefs>
      <li>MyRace_SlavePawnKind</li>
    </kindDefs>
    <chance>100.0</chance>
  </li>
</alienslavekinds>
(Optional) Allows your race to spawn as slaves in NPC faction caravans and settlements.

Chance is a weight value, with vanilla human slaves being 100, thus having a chance of 100 here will make the specified PawnKind(s) the same commonality as vanilla human slaves.

<alienrefugeekinds>
  <li>
    <kindDefs>
      <li>MyRace_RefugeePawnKind</li>
    </kindDefs>
    <chance>100.0</chance>
  </li>
</alienrefugeekinds>
(Optional) Allows your race to spawn as refugees in quest events such as Space Refugee Pods.

Chance is a weight value, with vanilla human refugees being 100, thus having a chance of 100 here will make the specified PawnKind(s) the same commonality as vanilla human refugees.

Universal BodyAddons

RaceSettings can be used to create BodyAddons that are attached to all humanlike races:

<AlienRace.RaceSettings>
  <defName>MyRace_RaceSettings</defName>

  <universalBodyAddons>
    <!-- options placed here -->
  </universalBodyAddons>

</AlienRace.RaceSettings>

This can be used to share BodyAddons between multiple races via Extension Graphics and otherwise works identically to normal BodyAddons.

Please see the BodyAddons page for more details.

Backstory Tag Insertion

(RimWorld v1.3 and earlier only): This feature was obsoleted by the vanilla game's migration of backstories to BackstoryDefs and is no longer available or necessary in RimWorld 1.4. If you want to add custom spawnCategories to external backstories, you can use a regular PatchOperation.

<AlienRace.RaceSettings>
  <defName>MyRace_RaceSettings</defName>
  
  <backstoryTagInsertion>
    <li>
      <backstories>
        <li>SpecificBackstoryName</li>
        <li>AnotherBackstoryName</li>
      </backstories>
      <spawnCategories>
        <li>MyRace_CustomSpawnCategory</li>
      </spawnCategories>
    </li>
  </backstoryTagInsertion>
  
</AlienRace.RaceSettings>
⚠️ **GitHub.com Fallback** ⚠️