Editing Modding Tutorials/Xenotypes

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[Xenotypes]] offer a wide range of possibilities for modders.
+
{{Recode|reason=Sanguophage uses a bunch of special options - add these}}
 
+
The following is the template for assembling xenotypes from the [[genes]] in the game. Under each heading the existing genes are listed. Simply delete or comment out the genes you do not wish to include. This is best done by editing or viewing the source of this page and copy and pasting from there.  
== Xenotype template ==
 
{{Recode|reason=1) Make collapsible 2) Sanguophage uses a bunch of special options - add these}}
 
The following is the template for assembling xenotypes from the [[genes]] in the game. Under each heading the existing genes are listed. Simply delete or comment out the genes you do not wish to include. This is best done by editing or viewing the source of this page and copy and pasting from there. Do not include the <nowiki><pre> and </pre> tags</nowiki>
 
  
 
It is accurate as of the 1st of November 2022. It is originally provided by Ryflamer but has since been modified.
 
It is accurate as of the 1st of November 2022. It is originally provided by Ryflamer but has since been modified.
Line 298: Line 295:
 
</pre>
 
</pre>
  
== Adding xenotypes to generated pawns ==
+
[[Category: Modding Tutorials]]
{{Stub|section=1|reason=More details on how pawnkind and ideoligion generation affects xenotype selection. Information on <code>MustBeCapableOfViolence</code> flag on pawn generation request.}}
 
[[Factions]] have their distribution of xenotypes set in their faction def at the top level by the following:
 
<pre>
 
    <xenotypeSet>
 
      <xenotypeChances>
 
        <Neanderthal MayRequire="Ludeon.RimWorld.Biotech">0.05</Neanderthal>
 
        <Hussar MayRequire="Ludeon.RimWorld.Biotech">0.15</Hussar>
 
        <Genie MayRequire="Ludeon.RimWorld.Biotech">0.10</Genie>
 
      </xenotypeChances>
 
    </xenotypeSet>
 
</pre>
 
<small>Note: The above is for a faction that is not defined by the [[Biotech DLC]], hence the may require. This difference is irrelevant to the interpretation method chosen.</small>
 
These values are then interpreted one of two ways.
 
First:
 
If the values add up to less than 1.0, then they are interpreted as percentage chances for a pawn, absent any other xenotype selections, to be that xenotype, with the remainder being the chance to be a baseliner. In the above example, as the sum of 0.05, 0.15, and 0.10 is only 0.30. As this is less than 1.0, there is a 5% chance for a pawn from that faction to be a [[neanderthal]], a 15% chance to be a [[hussar]], a 10% chance to be a genie, and a 70% chance to be baseliner.
 
 
 
Second:
 
If the values exceed 1.0, then the values are instead interpreted as a weight, where the chance is equal to the value for that xenotype divided by the sum of all the weights given. If baseliners are not included as a weight, they are excluded
 
 
 
For example:
 
<pre>
 
    <xenotypeSet>
 
      <xenotypeChances>
 
        <Neanderthal>999</Neanderthal>
 
      </xenotypeChances>
 
    </xenotypeSet>
 
</pre>
 
<small>Note: The above is for a faction that is defined by the [[Biotech DLC]], hence the lack of may require. This difference is irrelevant to the interpretation method chosen.</small>
 
Neanderthals have a (999/999)*100%, or a 100% chance to be selected.
 
 
 
Additional xenotypeSet definitions can be made in [[memes]]{{Hover title|link=no|At the time of writing (version 1.4.3704), no memes in the official content contain xenotypeSet definitions.|<sup>[Note]</sup>}} and PawnKinds. Whenever a pawn generation request is made, the generator sums the xenotype chances from the faction, the PawnKind, and each meme of the faction's primary ideoligion. The totals are then interpreted as either probabilities or weights, as described above.
 
 
 
For example, suppose a pawn is generated using the faction at the top of this section and a PawnKind with the following configuration:
 
<pre>
 
    <xenotypeSet>
 
      <xenotypeChances>
 
        <Highmate>0.25</Highmate>
 
        <Genie>0.15</Genie>
 
      </xenotypeChances>
 
    </xenotypeSet>
 
</pre>
 
The chances will be added together, resulting in Neaderthal=0.05, Hussar=0.15, Genie=0.25 (from adding 0.10 and 0.15), and Highmate=0.25. The total of all of these is 0.7, leaving baseliners with a chance of 0.3.
 
 
 
Note that a PawnKind may have <code><useFactionXenotypes>false</useFactionXenotypes></code>, which causes the faction's xenotypeSet to be ignored.
 
 
 
[[Category: Modding tutorials]]
 

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)