PawnBioDef - erdelf/AlienRaces GitHub Wiki

PawnBioDefs can be used to create specific pre-made characters for your race, similar to the "backer pawns" in vanilla RimWorld.

Individual characters are created using AlienRace.PawnBioDef Defs:

<AlienRace.PawnBioDef>
  <!-- pawn bio fields go here -->
</AlienRace.PawnBioDef>

PawnBioDef Fields

Field Description
<defName>MyRace_MyPawnBio</defName>
(Required) As with all Def types, a defName is required and must be globally unique across all mods. However, this is not saved or referenced in any way by code and is completely arbitrary for PawnBioDefs.
<childhood>MyRace_SpecificChildBackstory</childhood>
<adulthood>MyRace_SpecificAdultBackstory</adulthood>
(Required) Specifies the backstories that should be used for this character.
<gender>Male</gender>
(Optional, default: Either) Specifies a gender for this character. Available values are: Either (default), Male, Female
<name>
  <first>John</first>
  <nick>Boogeyman</nick>
  <last>Wick</last>
</name>
(Required) Sets the name for this character.
<validRaces>
  <li>Human</li>
  <li>MyRaceDefName</li>
</validRaces>
(Required) Sets the race(s) that this character can spawn as.
<factionLeader>true</factionLeader>
(Optional) If set to true, then this character can only spawn as a faction leader and has higher priority for use as a faction leader.
<forcedHediffs>
  <li>Malnutrition</li>
</forcedHediffs>
(Optional) Sets HediffDefs that this character should spawn with.
<forcedItems>
  <Gun_Autopistol>1</Gun_Autopistol>
</forcedItems>
(Optional) Adds items to this character's inventory when spawned. Similar to forcedItems on backstories, will bypass possessions limits and will be directly stored in the pawn's inventory rather than placed on the ground.

Complete Samples

<AlienRace.PawnBioDef>
  <defName>MyRace_NanomachinesSon</defName>
  <childhood>MyRace_FootballPlayer</childhood>
  <adulthood>MyRace_StateSenator</adulthood>
  <gender>Male</gender>
  <name>
    <first>Steven</first>
    <nick>Senator</nick>
    <last>Armstrong</last>
  </name>
  <validRaces>
    <li>MyRaceDefName</li>
  </validRaces>
  <factionLeader>true</factionLeader>
  <forcedHediffs>
    <li>LuciferiumHigh</li>
  </forcedHediffs>
</AlienRace.PawnBioDef>
<AlienRace.PawnBioDef>
  <defName>Custom_BabaYaga</defName>
  <childhood>Custom_OrphanRecruit</childhood>
  <adulthood>Custom_LegendaryHitman</adulthood>
  <gender>Male</gender>
  <name>
    <first>John</first>
    <nick>Boogeyman</nick>
    <last>Wick</last>
  </name>
  <validRaces>
    <li>Human</li>
  </validRaces>
  <forcedItems>
    <Gun_Autopistol>1</Gun_Autopistol>
  </forcedItems>
</AlienRace.PawnBioDef>
⚠️ **GitHub.com Fallback** ⚠️