RimWorld - How to Add Custom Xenotypes and Factions (2024)

RimWorld - How to Add Custom Xenotypes and Factions (1)

  • Title: RimWorld
  • Release Date: October 17, 2018
  • Developer: Ludeon Studios
  • Publisher: Ludeon Studios

So you’ve gone and created a Catgirl, Dwarf, or something totally different, but you want an in game faction for them to appear in, instead of getting lucky if one appears in a random drop pod or as a slave. This guide aims to walk you through how to mod in your Xenotype, and create a faction for the Xenotype to appear in. You don’t need any programming knowledge for this, you just need to know the XML format the game uses for this, and I plan to walk you through it.

Preamble

If you’ve been frustrated about being unable to encounter the custom Xenotype you created in world unless you get lucky with a drop pod, or find one as a slave, this guide aims to help you fix that. I plan to walk you through the basics of creating a simple mod that will add in your Xenotype as part of the game, then create a faction, and tell it to use that Xenotype for its people.

How to start your mod

Before you begin anything else, you will need to find your mods directory for RimWorld. Right click the game, select Properties, then go to Local Files and click Browse. This will take you to RimWorld’s directory. From here, open the Mods folder, or if it doesn’t exist yet, create the Mods folder, then open the folder.

Now create a folder for your Mod, name it what ever you feel like, but it will be easier to remember what it is if you choose a name that matches what the mod does.

Inside that folder, you will need to create the About folder and Defs folder. If you plan to update this mod to work in new versions of RimWorld when ever it updates, instead of a Defs folder, create a 1.4 folder (or what ever version the game is currently on), and put the Defs folder inside of that. If you want to create your own icons for factions and Xenotypes, you’ll also want a Textures folder next to that About folder.

Creating your Mod Metadata

Now we need to create a set of definitions that explain what the mod is, and what it does, when viewing it in your mod list. First, open Notepad, or a text editor of your choice. I don’t recommend Microsoft Office or a similar product for this, as you want an editor that will save only the text. Notepad++ is my favorite, but there are plenty of others that will suffice for this. Now copy this into your text editor:

<?xml version="1.0" encoding="utf-8"?><ModMetaData><name>Mod Name</name><author>Username</author><packageId>username.modcategory.modname</packageId><supportedVersions><li>1.4</li></supportedVersions><modDependencies><li><packageId>Ludeon.RimWorld.Biotech</packageId><displayName>Biotech</displayName></li></modDependencies><loadAfter><li>Ludeon.RimWorld.Biotech</li></loadAfter><description>A description to explain what your mod does when checking it in game.</description></ModMetaData>

Now, update the data in this file to match your new mod. Inside of <name></name> you want the name some one looking at your file will see.

Inside of <author></author> you want your username, or what ever name you feel like putting in there.

Now <packageId></packageId> is a bit different. This one you set up a special name that is designed to make sure that even if 2 people create a mod with the same name, RimWorld will recognize that the mods are different. That is, if you have 2 mods with the same name, and you use one of them in a game, when RimWorld checks to see which mods are loaded and sees one with the same name, but isn’t the samde mod, this tag is how it verifies that, and lets you know that the mod you were using before is not the same as the one that was used on that save. You can put in what ever you want, but username.modname or username.modCategory.modName do the best job for this.

<supportedVersions></supportedVersions> should be a list of version numbers supported by your mod, with each version inside of <li></li> tags. At the time of writing, the current version was 1.4, so that’s what I have put in there, but it can be just one version, or a list of supported versions.

<modDependencies></modDependencies> is to list out anything other than the core game that this mod needs to function. Since we’re playing with Xenotypes, this means we need the BioTech DLC. The text I had you copy already has the DLC listed, so no changes need to be made here.

<loadAfter></loadAfter> is for telling RimWorld where your mod should show up in the list of active mods and DLC, that way if the mod is in the wrong place, RimWorld will highlight it and let you know it needs to be fixed. There is also a <loadBefore></loadBefore> but you shouldn’t need it for this. This is another you won’t need to change for this mod.

<description></description> is where you describe your mod. When looking through your mod list, if you select a mod, what you write in the description tag will be displayed to explain the mod’s purpose.

Now that you’ve created your mod metadata, it’s time to save it. You want to save into the About folder of your mod as About.xml. If you’re using Notepad, you will need to click the Text Documents (*.txt) dropdown and change it to All Files (*.*). If you don’t make this change, you will end up saving a file called About.xml.txt. It needs to be About.xml with .xml as the extension and not .txt

Creating your Xenotype

Now that we’ve defined what the mod is, it’s time to actually get to making it. There are basically 2 things we need to define for the mod to work. One is your Xenotype and the appropriate genetics it will use, and the other is the faction for your Xenotype. As before, it’s time for a new text document. Here’s the template you’ll want to copy.

<?xml version="1.0" encoding="utf-8" ?><Defs><XenotypeDef><defName>Name</defName><label>name</label><description>A detailed description of your Xenotype</description><descriptionShort>A short description of your Xenotype</descriptionShort><iconPath>texture/path/to/icon</iconPath><inheritable>true</inheritable><nameMaker>CustomXenotypeNameGenerator</nameMaker><nameMakerFemale>CustomXenotypeNameGenerator_Female</nameMakerFemale><chanceToUseNameMaker>1</chanceToUseNameMaker><combatPowerFactor>1.0</combatPowerFactor><genes><li>gene1</li><li>gene2</li><li>gene3</li>...</genes></XenotypeDef></Defs>

Before we begin, I will say that the <nameMaker>, <nameMakerFemale>, and <chanceToUseNameMaker> tags should probably be deleted. I’m not going to go into rulePackDefs these use and how they work in this tutorial. The purpose of those tags is to let you define how a name for your Xenotype should be generated, and reference the name generator you defined. I’m leaving them in the XML template simply to let you know it’s an option, in case you get the itch to look into how name generation is handled by RimWorld.

<defName></defName> is a name for your Xenotype, but it is one that must not match an existing Xenotype, otherwise you end up overwriting that Xenotype, deleting it from the game, and replacing it with yours. So make sure you pick something unique, that the game isn’t using, and something another mod is unlikely to be using as well.

<label></label> is the name you will see in the game. Usually the defName and label can be the same, but that isn’t always be the case, even in the game data. The label can be what ever you want, this is what you’ll see in game.

<description></description> is intended to have a full lore-filled description of what the Xenotype is about. You can talk about how your Xenotype came to be, the things they excel in, what kinds of problems they have, what they like to do, etc.

<descriptionShort></descriptionShort> is a shorter description of your Xenotype, usually just a quick summary of the advantages and disadvantages it has compared to a Baseliner.

<iconPath></iconPath> is where you list your custom icon in the Textures folder. You don’t need a full path to it. For example, if the Textures folder doesn’t have any subfolder, and just has your icon files, you’ll put in the name of the icon file, and that’s it. <iconPath>dwarfIcon</iconPath> would work fine. If you have subfolders though, you’ll need to list those subfolders. If you created a XenotypeIcon folder inside of Textures, and put your icon in there, you’ll use something like <iconPath>XenotypeIcon/Dwarf</iconPath> instead. You don’t need to include .jpg, .png, or anything like that.

<inheritable></inheritable> is a flag for determining whether the genes for this Xenotype are Germline genes (inherited by children) or Xenogenes (can’t be inherited by children and adding new genes replaces the existing genes). If the genes aren’t inheritable (That is to say Xenogenes) this flag can be deleted. This flag is only needed if you want children of this Xenotype to inherit the traits of their parents.

<combatPowerFactor></combatPowerFactor> is for defining how tough a Xenotype is. RimWorld doesn’t automatically know, so here is where you tell it. If a particular Xenotype is unusually tough, setting a higher number will make their appearance cost more raid points compared to a baseliner, thus raids by that Xenotype will be smaller. A lower number will do the opposite. For reference, Genies are 0.8 and Hussars are 1.5.

Now we get to <genes></genes>, and this is where you get to define what traits make up your Xenotype. You’ll list each gene using the format <li>gene_name</li>, one per line until you have the full list inside of the <genes></genes> tag. I’ll include a full list of the genes you can use, but I strongly recommend you go in game, and create your custom Xenotype there. That will let you create a xenotype that is within the -5 – +5 metabolic efficiency scale the game uses, and you’ll be able to see how much food your Xenotype will need, and if it’s in a range you’re comfortable with. After that, screenshot your genes so you can copy them into the <genes></genes> tag.

If you want more than one Xenotype, copy and paste the template again, starting from <XenotypeDef> to </XenotypeDef>. You don’t need the first line, or the <Defs></Defs> tags. Those aren’t part of the definition, they just hold the definition inside of it. The <XenotypeDef> opening and closing tags are the actual definition. Once you’ve copied the appropriate section, paste it after </XenotypeDef> and before </Defs> in your text document. Double spacing the lines helps visually separate each Xenotype, so you can see fairly quickly where one ends, and the next begins.

Now that you’ve created your Xenotype (or maybe you created several, what ever floats your boat), you’ll need to save your document to the Defs folder (inside the 1.4 folder if you created that) as Xenotypes.xml. Note that the name doesn’t have to be Xenotypes.xml, but it does need to be saved with .xml as the file type. You could call it Dwarf.xml if you wanted, for example. Also, a quick reminder, make sure you’re not saving as a .txt file, so that it doesn’t append that to the end of the file name.

A list of all the vanilla genes

Hair_BaldOnly
Hair_ShortOnly
Hair_LongOnly
Hair_Grayless

Beard_BushyOnly
Beard_NoBeardOnly
Beard_Always (Unisex beards)

Skin_InkBlack
Skin_SlateGray
Skin_LightGray
Skin_SheerWhite
Skin_Blue
Skin_Purple
Skin_PaleRed
Skin_DeepRed
Skin_PaleYellow
Skin_DeepYellow
Skin_Orange
Skin_Green

Hair_SnowWhite
Hair_InkBlack
Hair_Gray
Hair_DarkBlack
Hair_MidBlack
Hair_DarkReddish
Hair_DarkSaturatedReddish
Hair_DarkBrown
Hair_ReddishBrown
Hair_SandyBlonde
Hair_Blonde
Hair_Pink
Hair_LightPurple
Hair_LightBlue
Hair_LightTeal
Hair_LightGreen
Hair_LightOrange
Hair_BrightRed

Furskin

Eyes_Red
Eyes_Gray

Brow_Heavy

Tail_Furry
Tail_Smooth

FacialRidges

Body_Fat
Body_Thin
Body_Hulk
Body_Standard

Ears_Human
Ears_Pig
Ears_Floppy
Ears_Cat
Ears_Pointed

Nose_Human
Nose_Pig

Jaw_Baseline (Human jaw)
Jaw_Heavy

Head_Gaunt

Headbone_Human
Headbone_MiniHorns
Headbone_CenterHorn

Voice_Human
VoicePig
VoiceRoar

AptitudeTerrible_(skillname) example: AptitudeTerrible_Cooking, AptitudeTerrible_Intellectual, etc.
AptitudePoor_(skillname)
AptitudeStrong_(skillname)
AptitudeRemarkable_(skillname)

ChemicalDependency_(drug) example: ChemicalDependency_GoJuice, ChemicalDependency_Alcohol
AddictionResistant_(drug)
AddictionImmune_(drug)

FireSpew
FoamSpray
LongjumpLegs
AnimalWarcall
PiercingSpine
AcidSpray

Hemogenic
Bloodfeeder
Coagulate
XenogermReimplanter
HemogenDrain
Deathless

PerfectImmunity
DiseaseFree (Non-senescent)
TotalHealing (Scarless)
Deathrest
Ageless
ArchiteMetabolism

Hands_Human
Hands_Pig (trotter hands)
ElongatedFingers

WoundHealing_Slow
WoundHealing_Fast
WoundHealing_SuperFast

Immunity_Weak
Immunity_Strong
Immunity_SuperStrong

ToxicEnvironmentResistance_Partial (Partial Antitoxic Lungs)
ToxicEnvironmentResistance_Total (Total Antitoxic Lungs)

ToxResist_Partial
ToxResist_Total

PollutionRush (Pollution stimulus)

Sterile
Fertile

Libido_Low
Libido_High

Superclotting

MinTemp_SmallIncrease (Cold weakness)
MinTemp_SmallDecrease (Cold tolerant)
MinTemp_LargeDecrease (Cold super tolerant)

MaxTemp_LargeIncrease (Heat super tolerant)
MaxTemp_SmallIncrease (Heat tolerant)
MaxTemp_SmallDecrease (Heat weakness)

FireResistant
FireWeakness (Tinderskin)
FireTerror (Pyrophobia)

PsychicAbility_Deaf
PsychicAbility_Dull
PsychicAbility_Enhanced
PsychicAbility_Extreme

PsychicBonding

MoveSpeed_Slow
MoveSpeed_Quick
MoveSpeed_VeryQuick

Beauty_VeryUgly
Beauty_Ugly
Beauty_Pretty
Beauty_Beautiful

Learning_Slow
Learning_Fast

Mood_Depressive (Very unhappy)
Mood_Pessimist (Unhappy)
Mood_Optimist (Happy)
Mood_Sanguine (Very Happy)

Delicate
Robust

Pain_Reduced
Pain_Extra

Aggression_DeadCalm
Aggression_Aggressive
Aggression_HyperAggressive

VerySleepy
Sleepy
LowSleep
Neversleep

MeleeDamage_Weak
MeleeDamage_Strong

UVSensitivity_Mild
UVSensitivity_Intense

KindInstinct
ViolenceDisabled

Instability_Mild (Mild cell instability)
Instability_Major

StrongStomach
RobustDigestion

Nearsighted
DarkVision
KillThirst
Unstoppable
NakedSpeed

Inbred (You should probably not be using this one, it’s intended as a penalty for children of people who are related to each other)

Creating your faction

Ok, the last big step is creating your faction with your Xenotype. Once again, time to create a new text document, and copy and paste a template in. Now, there are a few templates depending on what type of faction you want to create. You can go very in depth on these factions if you want, but I’m just covering how to create a basic faction. There are friendly, initially hostile, and permanently hostile factions, then there are 2 tech levels, industrial and tribal. A fully custom definition will let you create a far more varied set of factions, using custom levels of technology, but for the sake of this guide, we’re going to use a preset that was defined by Ludeon.

<?xml version="1.0" encoding="utf-8" ?><Defs><FactionDef ParentName="OutlanderFactionBase"><defName>Name</defName><label>name</label><description>A description of the faction goes here.</description><colorSpectrum><li>(red, green, blue)</li><li>(red, green, blue)</li></colorSpectrum><maxConfigurableAtWorldCreation>9999</maxConfigurableAtWorldCreation><configurationListOrderPriority>30</configurationListOrderPriority><factionIconPath>Path/To/Icon</factionIconPath><xenotypeSet Inherit="False"><xenotypeChances><XenotypeDefName>999</XenotypeDefName></xenotypeChances></xenotypeSet></FactionDef></Defs>

The first thing we want to look at is <FactionDef ParentName=””> The part in parenthesis allows you to select an already created template that RimWorld uses for factions. The options are OutlanderFactionBase, OutlanderRoughBase, TribeBase, TribeRoughBase, TribeSavageBase, and PirateBandBase.

What I’ve said before for <defName>, <label>, and <description> tags remains true. <defName> is a name the game uses to reference what we’re creating, and needs to be unique so you don’t overwrite something that was already created. <label> is the name that will be shown to you in game. <description> is a where you describe the faction and will be seen in game.

<colorSpectrum></colorSpectrum> lets you define the color of the icon that will be used by the faction. The range of each color is from 0.0 to 1.0, so yellow is <li>(1.0, 1.0, 0.0)</li>, while brown would be (0.4, 0.17, 0.0). The reason for two color definitions is to set a range of colors. If red has 0.3 in the first <li> tag, and 0.4 in the second, then each time a faction is generated, a random level of red will be chosen between 0.3 and 0.4, then it will do the same for what was defined for green, then for blue.

<maxConfigurableAtWorldCreation></maxConfigurableAtWorldCreation> lets you specify the maximum number of the faction you can have in a world. There’s no reason to edit the number here, but if you wanted only 1 of your custom faction, you could change that number from 9999 to 1. Most of the templates have this already defined, but TribeBase and OutlanderFactionBase don’t, so you’ll need these tags if you are creating either of these types of factions. Otherwise, delete the line.

<configurationListOrderPriority></configurationListOrderPriority> This one is just to organize the order of the factions. Lower numbers show up first, higher numbers show later. OutlanderFactionBase uses 10, TribeBase uses 30. The other faction types have this already defined, so if you’re using one of the others, delete this line too.

<factionIconPath></factionIconPath> lets you reference an image that you put into textures, similar to the <iconPath> tag from the Xenotype definitions. It is optional, as the faction definitions we’re pulling from already have icons defined. With that said, if you want to create your own icons, make sure you put them in the Textures folder, and also the icons should be colored white, with a transparent background.

<xenotypeSet></xenotypeSet> is where we define what Xenotypes can exist in the faction. Now you finally get to insert the Xenotype you created into the faction. Just change both instances of XenotypeDefName to the defName of your Xenotype. It might be <Dwarf>999</Dwarf>, or maybe <Catgirl>999</Catgirl>, or even <PointyEaredLeafLover>999</PointyEaredLeafLover>.
You can also list multiple Xenotypes, and set the odds of each Xenotype appearing as a member of that faction.

<xenotypeSet Inherit="False"><xenotypeChances><Dwarf>0.2</Dwarf><Elf>0.05</Elf><Goblin>0.1</Goblin></xenotypeChances></xenotypeSet>

When done this way, you’re setting a percentage chance of each Xenotype appearing. 0.2 = 20%, 0.05 = 5%, etc. If you don’t specify enough to add up to 1.0 (or 100%), the extra percentage that didn’t have a defined Xenotype will be Baseliners. In my example above, you have 20% dwarves, 5% elves, 10% goblins, and 65% baseliners.

As with Xenotypes, you can create more than one faction this way by copying the template from <FactionDef> to </FactionDef>, and pasting an extra copy for you to edit.

Once this document is ready, save as Factions.xml (or a name of your choice ending with .xml) into the Defs folder, once again making sure not to save as a .txt by accident.

The mod is complete

Now you are finished. You have a completed mod. Verify everything saved correctly, that the files are .xml and not a normal text document, and assuming everything did as expected, you will now be able to open RimWorld, check your modlist, and see your mod. If you want to see a completed mod as an example, I have one here:My Custom Xenotype and Faction mod]. It adds an elven tribe, a dwarven race, and a friendly cat person tribe. You can download the mod, and explore the xenotypes and factions to see how I set them up.

That's everything we are sharing today for this RimWorld guide. This guide was originally created and written by {GFG} Kage. In case we fail to update this guide, you can find the latest update by following this link.

If you believe that any of the content on this site violates your rights, including your intellectual property rights, please contact us immediately using our contact form.
RimWorld - How to Add Custom Xenotypes and Factions (2024)

References

Top Articles
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 5971

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.