Change Faction on Death - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp causes the pawn's faction to change when they die. This means that if they are revived, they will usually have a different faction than what they had before they died, though revival effects which change faction will convert the pawn to the correct faction as normal:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_FactionChangeOnDeath">
                <faction>
                    <li>Pirate</li>
                    <li>PirateWaster</li>
                    <li>PirateYttakin</li>
                </faction>
                <changeIdeoToPrimary>True</changeIdeoToPrimary>
                <changeToKillerFaction>False</changeToKillerFaction>
            </li>
        </comps>

These are the options available:

  • changeToKillerFaction : Default (True) : Causes the pawn to change to their killer's faction when they die. If the game doesn't recognize a specific pawn as the killer (i.e. death by blood loss or disease), then they will stop having a faction
  • changeIdeoToPrimary : Default (False) : If the new faction has an ideology that's different from the pawn's current ideology, they will change to the ideology. This does not apply in the event that the new faction doesn't have an ideology, nor in the event where there is no new faction. If a revival effect changes the pawn's faction again, the ideology will remain as whatever this comp set it to unless the revival effect changes that as well
  • factions : A list of FactionDefs to try to convert the pawn to. This will go in the order of the list, and in the event that changeToKillerFaction is left True and there is no designated killer, this list will be used to try to give them a faction. The killer's faction (or lack of a faction) will always be used if changeToKillerFaction is True. If none of the factions in this list are found in the game, the pawn will just lose their faction instead

This example causes them to change to one of the pirate factions when they die, and take their ideology. If the current world has no pirate faction, then they just lose their faction:

    <HediffDef>
        <defName>YouAreAPirate</defName>
        <label>you are a pirate</label>
        <description>If this pawn dies, they will have the pirate faction if they are revived.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="HediffCompProperties_DisappearsOnDeath"/>
            <li Class="EBSGFramework.HediffCompProperties_FactionChangeOnDeath">
                <factions>
                    <li>Pirate</li>
                    <li>CannibalPirate</li>
                    <li>PirateWaster</li>
                    <li>PirateYttakin</li>
                </factions>
                <changeIdeoToPrimary>True</changeIdeoToPrimary>
                <changeToKillerFaction>False</changeToKillerFaction>
            </li>
        </comps>
    </HediffDef>

This example causes the pawn to change to their killer's faction without changing ideology. If the game doesn't recognize a specific pawn as their killer, they lose their faction instead:

    <HediffDef>
        <defName>FollowTheStrong</defName>
        <label>follow the strong</label>
        <description>If this pawn dies, they will be in their killer's faction if they are revived. If they are killed by something with no faction (including wild animals, disease, infection, lightning strikes, fire, etc), they will have no faction when revived.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="HediffCompProperties_DisappearsOnDeath"/>
            <li Class="EBSGFramework.HediffCompProperties_FactionChangeOnDeath" />
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️