Temporary Ideology - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp changes the ideology of the pawn to something else, usually until the hediff is removed. The ideology in question can either be from a static FactionDef, or can use another pawn's ideology if the hediff is a HediffWithTarget and factionOfIdeo is not used:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_TemporaryIdeology">
            </li>
        </comps>
  • factionOfIdeo : A FactionDef to pull the ideology from. This may have unexpected results if the faction in question does not have a primary ideology
  • certainty : Default (1~1) : The range to set the new ideology certainty. If set to 0, then certainty is not changed from what the pawn had before conversion. This only applies for static ideologies picked through factionOfIdeo
    • Due to how certainty is handled in the code, the pawn's certainty may not reach the exact value picked but will instead go for a middle point between the initial and the target

Note: Generally speaking, the pawn's certainty will vary from the statically set/the hediff's target's certainty. To avoid having the constant notifications about the certainty updating, the pawn's ideology is only updated at most once every 10 seconds, and certainty will only be updated if it is at least 20 points below the desired level

Note 2: In the event that multiple hediffs with this comp are applied to the same pawn, the last one added will usually be the one that makes the final decision about what the pawn's faction should be until the hediff is removed

Note 3: If you want to make an ability that does the same as this that only makes changes to the pawn when cast, the Change Ideology ability comp serves that purpose


This first example uses Create Linked Hediffs to make the target pawn's ideology the same as their own:

    <AbilityDef>
        <defName>TemporaryConversion</defName>
        <label>test ability</label>
        <description>.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_CreateLinkedHediff">
                <hediffOnTarget>TemporaryConversion</hediffOnTarget>
            </li> 
        </comps>
    </AbilityDef>

    <HediffDef>
        <defName>TemporaryConversion</defName>
        <label>temporary conversion</label>
        <description>.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithTarget</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_TemporaryIdeology" />
        </comps>
    </HediffDef>

This hediff forces the pawn to have the same ideology as the ancients with at least 50% certainty:

    <HediffDef>
        <defName>ForTheAncients</defName>
        <label>for the ancients!</label>
        <description>.</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_TemporaryIdeology">
                <factionOfIdeo>Ancients</factionOfIdeo>
                <certainty>0.5</certainty>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️