Change Faction - KonradHeinser/EBSGFramework GitHub Wiki
This ability comp allows you to change the faction of a pawn into either the caster's current faction or a static one you set:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityChangeFaction">
</li>
</comps>
If you want something more in depth than just basic changing faction to the caster's, these are the options available:
- useStatic : Default (False) : Makes the comp use the static faction you set, or makes them lose their faction if staticFaction is not used
- staticFaction : The FactionDef to use
- successChance : A special item that dictates the chance of success. If you don't add this to the comp, then it will always work
Note : Due to how the game handles pawn ai, pawns may choose to wander off the map if their faction is changed to a non-player faction, though if the caster has a Lord and useStatic is False, the pawn should usually be able to change their actions to whatever that Lord tells them to do
This example puts the pawn into the caster's faction, and if possible, gives the pawn the same Lord as the caster:
<AbilityDef>
<defName>Recruitment</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_AbilityChangeFaction" />
</comps>
</AbilityDef>
This example puts the target into the Empire faction:
<AbilityDef>
<defName>ForTheEmpire</defName>
<label>for the empire!</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_AbilityChangeFaction">
<useStatic>True</useStatic>
<staticFaction>Empire</staticFaction>
</li>
</comps>
</AbilityDef>