Aging Xenotype - KonradHeinser/EBSGFramework GitHub Wiki

This gene class allows you to make genes that cause a pawn's xenotype to change when they reach certain ages. To use this, you need a special class and extension for the gene:

        <geneClass>EBSGFramework.Gene_AgingXenotype</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.AgingXenotypeExtension">
            </li>
        </modExtensions>

These are the options available in the extension:

  • xenotypes : A special list that uses a Xenotype defName for the tag, and the range of valid ages for the value. If you only put in a singular number, any age at or above that number qualify
  • filth : A ThingDef to create as filth when the change occurs
  • filthAmount : Default (4~7) : The amount of filth to create
  • setXenotype : Default (True) : When True, it replaces all of the pawn's genes, and when False it tries to create a blend between the pawn's current xenotype and the xenotype it retrieved from xenotypes
  • message : The message to send if the pawn is a colonist that is either on a map or in a caravan

Note: This can change a pawn's xenotype immediately after adding, which may impact the initial pawn selection for players


This simplistic example has 3 xenotypes which are set based on age. As the pawn ages, they go from A to B, then B to C, and if they become younger, then they go in the reverse direction:

    <XenotypeDef>
        <defName>XenoA</defName>
        <label>xeno a</label>
        <description>A turns into xeno b when it ages enough.</description>
        <iconPath>UI/Icons/Xenotypes/Baseliner</iconPath>
        <displayPriority>1000</displayPriority>
        <factionlessGenerationWeight>40</factionlessGenerationWeight>
        <genes>
            <li>ChangingXenoA</li>
        </genes>
    </XenotypeDef>

    <GeneDef>
        <defName>ChangingXenoA</defName>
        <label>gene A</label>
        <geneClass>EBSGFramework.Gene_AgingXenotype</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.AgingXenotypeExtension">
                <xenotypes>
                    <XenoB>20~40</XenoB>
                    <XenoC>40</XenoC>
                </xenotypes>
            </li>
        </modExtensions>
    </GeneDef>

    <XenotypeDef>
        <defName>XenoB</defName>
        <label>xeno b</label>
        <description>B turns into xeno c when it ages enough, or into xeno a if it is de-aged.</description>
        <iconPath>UI/Icons/Xenotypes/Baseliner</iconPath>
        <displayPriority>1000</displayPriority>
        <factionlessGenerationWeight>40</factionlessGenerationWeight>
        <genes>
            <li>ChangingXenoB</li>
        </genes>
    </XenotypeDef>

    <GeneDef>
        <defName>ChangingXenoB</defName>
        <label>gene B</label>
        <geneClass>EBSGFramework.Gene_AgingXenotype</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.AgingXenotypeExtension">
                <xenotypes>
                    <XenoA>0~20</XenoA>
                    <XenoC>40</XenoC>
                </xenotypes>
            </li>
        </modExtensions>
    </GeneDef>

    <XenotypeDef>
        <defName>XenoC</defName>
        <label>xeno c</label>
        <description>C turns into xeno b if it is de-aged.</description>
        <iconPath>UI/Icons/Xenotypes/Baseliner</iconPath>
        <displayPriority>1000</displayPriority>
        <factionlessGenerationWeight>40</factionlessGenerationWeight>
        <genes>
            <li>ChangingXenoC</li>
        </genes>
    </XenotypeDef>

    <GeneDef>
        <defName>ChangingXenoC</defName>
        <label>gene C</label>
        <geneClass>EBSGFramework.Gene_AgingXenotype</geneClass>
        <modExtensions>
            <li Class="EBSGFramework.AgingXenotypeExtension">
                <xenotypes>
                    <XenoA>0~20</XenoA>
                    <XenoB>20~40</XenoB>
                </xenotypes>
            </li>
        </modExtensions>
    </GeneDef>
⚠️ **GitHub.com Fallback** ⚠️