Race Restriction - erdelf/AlienRaces GitHub Wiki

Race Restrictions can be used to allow or prevent the usage of various game mechanics by your race, such as research projects, apparel, weapons, and more.

Race Restrictions can be added by placing a raceRestriction tag inside of alienRace.

<AlienRace.ThingDef_AlienRace>
  <alienRace>
    <raceRestriction>
      <!-- race restrictions are listed here -->
    </raceRestriction>
  </alienRace>
</AlienRace.ThingDef_AlienRace>

Unless otherwise noted, all Race Restrictions are optional.

Apparel

Setting Description
<apparelList>
  <li>Apparel_YourRaceArmor</li>
</apparelList>
Sets apparel that only your race can wear.

Note that multiple races can share restricted apparel; any race with apparel listed in their list can wear it.
<whiteApparelList>
  <li>Apparel_Duster</li>
  <li>Apparel_AlienRaceGear</li>
</whiteApparelList>
Sets apparel that your race can wear without restricting it to only your race.

Usually used in conjunction with onlyUseRaceRestrictedApparel
<blackApparelList>
    <li>Apparel_Tuque</li>
    <li>Apparel_Parka</li>
</blackApparelList>
Sets apparel that your race is not allowed to wear.
<onlyUseRaceRestrictedApparel>
  true
</onlyUseRaceRestrictedApparel>
If set to true, then your race can only wear apparel that is on your apparelList or whiteApparelList.

Weapons

Setting Description
<weaponList>
  <li>Weapon_AlienRaceGun</li>
</weaponList>
Sets weapons that only your race can equip.

Note that multiple races can share restricted weapons; any race with weapons listed in their list can equip it.
<whiteWeaponList>
  <li>MeleeWeapon_BreachAxe</li>
  <li>CustomAlienWeapon</li>
</whiteWeaponList>
Sets weapons that your race can equip without restricting it to only your race.

Usually used in conjunction with onlyUseRaceRestrictedWeapons
<blackWeaponList>
    <li>Gun_ChargeRifle</li>
    <li>MeleeWeapon_LongSword</li>
</blackWeaponList>
Sets weapons that your race is not allowed to equip.
<onlyUseRaceRestrictedWeapons>
  true
</onlyUseRaceRestrictedWeapons>
If set to true, then your race can only equip weapons in your weaponList or whiteWeaponList.

Buildings

Setting Description
<buildingList>
  <li>Building_AlienBuilding</li>
</buildingList>
Sets buildings that only your race can construct.

Buildings restricted by a race will not be shown in the Architect Menu unless a member of that race is in the player's colony. This list is cached and may take 2-3 in-game hours to show up after a member of such a race joins the colony.
<whiteBuildingList>
  <li>SculptureSmall</li>
</whiteBuildingList>
Sets buildings that your race can construct without restricting it to only your race.

Usually used in conjunction with onlyBuildRaceRestrictedBuildings
<blackBuildingList>
    <li>SculptureGrand</li>
</blackBuildingList>
Sets buildings that your race is not allowed to construct.
<onlyBuildRaceRestrictedBuildings>
  true
</onlyBuildRaceRestrictedBuildings>
If set to true, then your race can only construct buildings from your buildingList or whiteBuildingList.

Recipes

Setting Description
<recipeList>
  <li>Refine_AlienMaterial</li>
</recipeList>
Sets recipes that only your race can work on.

Note that any RecipeDef be specified, including surgery recipes.
<whiteRecipeList>
  <li>Make_StoneBlocksAny</li>
</whiteRecipeList>
Sets recipes that your race can work on without restricting it to only your race.

Usually used in conjunction with onlyDoRaceRestrictedRecipes
<blackRecipeList>
    <li>Make_Kibble</li>
</blackRecipeList>
Sets recipes that your race is not allowed to work on.
<onlyDoRaceRestrictedRecipes>
  true
</onlyDoRaceRestrictedRecipes>
If set to true, then your race can only work on recipes in your recipeList or whiteRecipeList.

Plants

Setting Description
<plantList>
  <li>Plant_AlienCrop</li>
</plantList>
Sets plants that only your race can sow or harvest.
<whitePlantList>
  <li>Plant_Potato</li>
</whitePlantList>
Sets plants that your race can sow or harvest without restricting it to only your race.

Usually used in conjunction with onlyDoRaceRestrictedPlants
<blackPlantList>
    <li>Plant_Smokeleaf</li>
</blackPlantList>
Sets plants that your race is not allowed to sow or harvest.
<onlyDoRaceRestrictedPlants>
  true
</onlyDoRaceRestrictedPlants>
If set to true, then your race can only sow or harvest plants in your plantList or whitePlantList.

Traits

Setting Description
<traitList>
  <li>Plant_AlienCrop</li>
</traitList>
Sets traits that only members of your race can generate with.
<whiteTraitList>
  <li>Plant_Potato</li>
</whiteTraitList>
Sets traits that members of your race can generate with without restricting it to only your race.

Usually used in conjunction with onlyGetRaceRestrictedTraits
<blackTraitList>
    <li>Plant_Smokeleaf</li>
</blackTraitList>
Sets traits that members of your race are not allowed to generate with.
<onlyGetRaceRestrictedTraits>
  true
</onlyGetRaceRestrictedTraits>
If set to true, then your race can only generate with traits in your traitList or whiteTraitList.

Food

Setting Description
<foodList>
  <li>MealAlienNutrientPack</li>
</foodList>
Sets food that only your race can eat.
<whiteFoodList>
  <li>MealLavish</li>
</whiteFoodList>
Sets food that your race can eat without restricting it to only your race.

Usually used in conjunction with onlyEatRaceRestrictedFood
<blackFoodList>
    <li>MealNutrientPaste</li>
</blackFoodList>
Sets food that your race is not allowed to eat.
<onlyEatRaceRestrictedFood>
  true
</onlyEatRaceRestrictedFood>
If set to true, then your race can only eat food in your foodList or whiteFoodList.

Animals

Setting Description
<petList>
  <li>MealAlienNutrientPack</li>
</petList>
Sets animals that only your race can tame.
<whitePetList>
  <li>MealLavish</li>
</whitePetList>
Sets animals that your race can tame without restricting it to only your race.

Usually used in conjunction with onlyTameRaceRestrictedPets
<blackPetList>
    <li>MealNutrientPaste</li>
</blackPetList>
Sets animals that your race is not allowed to tame.
<onlyTameRaceRestrictedPets>
  true
</onlyTameRaceRestrictedPets>
If set to true, then your race can only tame animals in your petList or whitePetList.

Xenotypes & Genes (Biotech DLC Only)

Setting Description
<xenotypeList>
  <li>MyCustomXenotype</li>
  <li>AnotherXenotype</li>
</xenotypeList>
Sets xenotypes that only members of your race can have.
<whiteXenotypeList>
  <li>SharedXenotype</li>
  <li>AnotherSharedXenotype</li>
</whiteXenotypeList>
Sets xenotypes that your race can have without restricting it to only your race.

Usually used in conjunction with onlyUseRaceRestrictedXenotypes
<blackXenotypeList>
  <li>UnwantedXenotype</li>
  <li>IncompatibleXenotype</li>
</blackXenotypeList>
Sets xenotypes that your race cannot have.
<onlyUseRaceRestrictedXenotypes>
  true
</onlyUseRaceRestrictedXenotypes>
If set to true, then your race can only have xenotypes in your xenotypeList or whiteXenotypeList.
<geneList>
  <li>MyCustomGene</li>
  <li>AnotherCustomGene</li>
</geneList>
Sets genes that only members of your race can have.
<whiteGeneList>
  <li>Hemogenic</li>
  <li>FacialRidges</li>
</whiteGeneList>
Sets genes that your race can have without restricting it to only your race.

Usually used in conjunction with onlyHaveRaceRestrictedGenes
<whiteGeneTags>
  <li>HairStyle</li>
  <li>BeardStyle</li>
  <li>Voice</li>
</whiteGeneTags>
Similar to whiteGeneList, but used to specify exclusionTags instead of specific GeneDef entries.
<blackGeneList>
  <li>UnwantedGene</li>
  <li>AnotherUnwantedGene</li>
</blackGeneList>
Sets genes that your race cannot have.
<blackGeneTags>
  <li>Tail</li>
  <li>PsychicAbility</li>
</blackGeneTags>
Similar to blackGeneList, but used to specify exclusionTags instead of specific GeneDef entries.
<blackEndoCategories>
  <li>HairColor</li>
  <li>BodyType</li>
</blackEndoCategories>
Sets endogene categories that your race cannot have.

Valid options are: None, Melanin, HairColor, Ears, Nose, Jaw, Hands, Headbone, Head, BodyType, Voice
<onlyHaveRaceRestrictedGenes>
  true
</onlyHaveRaceRestrictedGenes>
If set to true, then your race can only have genes in your geneList or whiteGeneList.

Reproduction (Biotech DLC Only)

Unless otherwise specified, all reproduction restrictions are from the perspective of the mother.

See also General Settings for additional reproduction and children-related settings.

Setting Description
<reproductionList>
  <li>UniqueSubRace</li>
  <li>AnotherSubRace</li>
</reproductionList>
Sets races that only members of your race can reproduce with.
<whiteReproductionList>
  <li>AnotherRace</li>
  <li>YetAnotherRace</li>
</whiteReproductionList>
Sets races that your race can reproduce with without restricting it to only your race.

Usually used in conjunction with onlyReproduceWithRestrictedRaces
<blackReproductionList>
  <li>UnwantedXenotype</li>
  <li>IncompatibleXenotype</li>
</blackReproductionList>
Sets races that your race cannot reproduce with.
<canReproduce>true</canReproduce>
If set to false, then your race cannot become pregnant.

Generally used for races that do not give live birth but still have reproductive fertility, such as those that lay eggs.

Note: This was changed from canGetPregnant in an early dev version of HAR for RimWorld 1.4.
<canReproduceWithSelf>true</canReproduceWithSelf>
If set to false, then female members of your race cannot be impregnated by male members of your race.

Can be used for races that can only crossbreed with other races.
<onlyReproduceWithRestrictedRaces>
  true
</onlyReproduceWithRestrictedRaces>
If set to false, then your race can only reproduce with races in your reproductionList or whiteReproductionList.

By default, all humanlike races can crossbreed.

Additional Settings

Setting Description
<researchList>
  <li>
    <projects>
      <li>CustomResearchDef</li>
      <li>AnotherResearchDef</li>
    </projects>
  </li>
</researchList>

or

<researchList>
  <li>
    <projects>
      <li>RestrictedResearch</li>
    </projects>
    <apparelList>
       <li>Apparel_AlienGoggles</li>
       <li>Apparel_AlienLabCoat</li>
    </apparelList>
  </li>
</researchList>
Can be used to restrict research projects so that they can only be researched by your race.

You can optionally set apparel that must be worn in order to research those projects, and separate list items can be used to set different apparel requirements for different research projects.
<conceptList>
  <li>AlienRace_Abilities</li>
  <li>AlienRace_SpecialFood</li>
</conceptList>
Sets ConceptDef entries that are automatically triggered when a member of your race joins the player's colony.

These populate the Learning Helper in the top-right corner of the game UI and can be used provide helpful information or tutorials for your race.
<workGiverList>
  <li>WorkGiver_AlienRaceWork</li>
  <li>WorkGiver_AlienRaceMaintenance</li>
</workGiverList>
Sets WorkGiverDef entries that only members of your race can be assigned to.

This can be used to restrict work options, such as being able to use specific workbenches.
⚠️ **GitHub.com Fallback** ⚠️