Jump to content

About This File

This mod enables the re balancing of genders for non alien races.

 

Features:

  • Adds compProperties to re balance gender probabilities

 

Requirements:

  • none

 

Load order:

 

Installation:

  • Unpack the contents of the zip into "...steam/steamapps/common/rimworld/mods"
  • Activate the mod and put it above the races you want to patch, but below alien races, if you're using it.
  • Wait for the game to restart

 

Regarding alien races:

If you want to change the gender ration of a race using the alien race framework you do not need this mod.

You can use this mod only to change the gender ration of vanilla pawns or creatures added that do not use the alien races framework.

The alien races framework has an option to set the gender ratio already built in.

Spoiler

To re-balance an alien races race, you need to edit the <maleGenderProbability> value in the Alien race settings. Either directly or by creating a patch file.

You should find the settings in the mod folder in Defs/ThingDef_Race/raceName.xml it's possible that the XML is in a different folder, in that case, get searching.

As an example from the dragonian race


<Defs>
	<AlienRace.ThingDef_AlienRace ParentName="DR_PawnBase">
		<defName>Dragonian</defName>
		<label>Dragonian</label>
		<description>...</description>
			<alienRace>
				<generalSettings>
					<maleGenderProbability>0</maleGenderProbability>
					<useOnlyPawnkindBackstories>true</useOnlyPawnkindBackstories>
					<immuneToAge>true</immuneToAge>
					.
					.
					.
 

Change that value to something between 1 and 0 to set the desired ratio.

If the variable is not in the XML, add it.

 

 

 

How to balance a race:

There are 2 ways of re balancing the gender distribution of a race.

You can add the gender balance properties directly to the race you wish to balance or create a patch that automatically adds the properties for you.

 

To balance a race directly, find the race in your mods folder, it should be within the defs/thingDefs_races folder.

Open the file of the race you wish to balance in an editor.

I'll use the Impmother from the more monstergirls pack as an example.

Spoiler

<ThingDef ParentName="AnimalThingBase" ADogSaidBody="LegsArmsTail">
    <defName>Impmother</defName>
    <label>imp mother</label>
    <description>A demonic creature. Imps were developed by larger, more intelligent demons to serve as menial slaves. They have a very unusual lifespan, only reaching adulthood in the last 8 years of their life. However, an adult imp (called an impmother) produces offspring very rapidly and produces enough milk to make a cow blush. Their personalities are mischievous and they love attention, but they can become very attached to their mother or owner. They prefer hot climates.</description>
    <statBases>
      <MoveSpeed>4.70</MoveSpeed>
      <ComfyTemperatureMin>-15</ComfyTemperatureMin>
      <ComfyTemperatureMax>80</ComfyTemperatureMax>
      <MarketValue>300</MarketValue>
    </statBases>
    <comps>
      <li Class="CompProperties_Milkable">
        <milkDef>Milk</milkDef>
        <milkIntervalDays>1</milkIntervalDays>
        <milkAmount>24</milkAmount>
      </li>
    </comps>
    <tools>
      <li>
        <label>horn</label>
        <capacities>
          <li>Scratch</li>
          <li>Stab</li>
        </capacities>
        <power>11</power>
        .
        .
        .
  </ThingDef>

 

 

Check for the <comps> tag within the <ThingDef ParentName="AnimalThingBase"> tag, and insert the first snippet below into it and set the weights the way you want them.

If there is no <comps> tag. insert the second snippet into the ThingDef.

Spoiler

<li Class="GenderBalancer.GenderBalanceSettings">
	<maleGenderWeight>1</maleGenderWeight>
	<femaleGenderWeight>1</femaleGenderWeight>
	<noGenderWeight>0</noGenderWeight>
</li>



<comps>
	<li Class="GenderBalancer.GenderBalanceSettings">
		<maleGenderWeight>1</maleGenderWeight>
		<femaleGenderWeight>1</femaleGenderWeight>
		<noGenderWeight>0</noGenderWeight>
	</li>
</comps>

 

 

When you're done it should look like this.

Spoiler

<ThingDef ParentName="AnimalThingBase" ADogSaidBody="LegsArmsTail">
    <defName>Impmother</defName>
    <label>imp mother</label>
    <description>A demonic creature. Imps were developed by larger, more intelligent demons to serve as menial slaves. They have a very unusual lifespan, only reaching adulthood in the last 8 years of their life. However, an adult imp (called an impmother) produces offspring very rapidly and produces enough milk to make a cow blush. Their personalities are mischievous and they love attention, but they can become very attached to their mother or owner. They prefer hot climates.</description>
    <statBases>
      <MoveSpeed>4.70</MoveSpeed>
      <ComfyTemperatureMin>-15</ComfyTemperatureMin>
      <ComfyTemperatureMax>80</ComfyTemperatureMax>
      <MarketValue>300</MarketValue>
    </statBases>
    <comps>
      <li Class="CompProperties_Milkable">
        <milkDef>Milk</milkDef>
        <milkIntervalDays>1</milkIntervalDays>
        <milkAmount>24</milkAmount>
      </li>
	  <li Class="GenderBalancer.GenderBalanceSettings">
		<maleGenderWeight>1</maleGenderWeight>
		<femaleGenderWeight>1</femaleGenderWeight>
		<noGenderWeight>0</noGenderWeight>
	  </li>
    </comps>
    <tools>
      <li>
        <label>horn</label>
        <capacities>
          <li>Scratch</li>
          <li>Stab</li>
        </capacities>
        <power>11</power>
        .
        .
        .
  </ThingDef>

 

 

 

If you want to create a patch, you'll have to create a simple mod to enable it.

If you don't know how here is a quick and dirty way.

Simply create a copy of the GenderBalancer mod, give it a new name, go into the About folder and edit the About XML with your infos.

Move one folder up, delete the Assemblies folder and create a new folder called Patches.

folders.PNG.bff3107792157ee90926f679265e99c3.PNG

Open the patchExample.xml, copy and paste the entire operation block until you have enough for all species you wish to patch, and replace PATCH_SPECIES_DEF_NAME with the defName of the species you wish to patch, in this case it would be Impmother. It should look like this.

Spoiler

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<!-- Adds comps if not already part of that species, followed by the genderbalance comps class -->
	<Operation Class="PatchOperationConditional">
		<xpath>/Defs/ThingDef[defName="Impmother"]/comps</xpath>
		<nomatch Class="PatchOperationAdd">
			<xpath>/Defs/ThingDef[defName="Impmother"]</xpath>
			<value>
				<comps>
					<li Class="GenderBalancer.GenderBalanceSettings">
						<maleGenderWeight>1</maleGenderWeight>
						<femaleGenderWeight>1</femaleGenderWeight>
						<noGenderWeight>0</noGenderWeight>
					</li>
				</comps>
			</value>
		</nomatch>
		<match Class="PatchOperationAdd">
			<xpath>/Defs/ThingDef[defName="Impmother"]/comps</xpath>
			<value>
				<li Class="GenderBalancer.GenderBalanceSettings">
					<maleGenderWeight>1</maleGenderWeight>
					<femaleGenderWeight>1</femaleGenderWeight>
					<noGenderWeight>0</noGenderWeight>
				</li>
			</value>
		</match>
	</Operation>
</Patch>

 

 

Save it, rename it to your liking and move it into the patches folder.

Start Rimworld and enable your newly created patch.

 

 

Patches using this mod:

Genital support patch for lost forest

 

If you created your own patch comment or pm me and I'll add you to the list.

 

 

Known issues:

  • Does not work if placed above alien races in the load order

 

Error reporting/Suggestions:

Please let me know if you experience issues with this patch and feel free to suggest improvements/changes.


What's New in Version 1.1.0

Released

Added support for Rimworld 1.1



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use