Change Gender - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp changes the gender of the caster and/or the target:

        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityChangeGender">
            </li>
        </comps>

These are the options available:

  • target : The options are None (no static gender, flip between male and female), Female, and Male. If the caster is the target, this will apply to them
  • caster : The options are None (no static gender, flip between male and female), Female, and Male
  • keepName : Default (False) : When the pawn's gender changes, they normally gain a new first name and sometimes a new nickname. Setting this to True will ensure that name changes only happen if the player specifically makes the change themselves. If this is False, then their initial name will be lost even if the gender change is reverted later due to limitations in the ability to keep track of names after a pawn loses it

This example just flips the caster's gender:

    <AbilityDef>
        <defName>Clownfish</defName>
        <label>clownfish</label>
        <description>A clownfish can change its gender when no female is present. This ability is more flexible than that.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <targetRequired>False</targetRequired>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>-1</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetSelf>True</canTargetSelf>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilityChangeGender">
                <caster>None</caster> <!--None just means no static gender, instead flip between male and female-->
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️