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
- baseSuccessChance : Default (1) : Chance of the ability to succeed, with 1 being 100%
- casterStatChance : StatDef of the caster that is checked to determine success chance. Normally the higher above 0 this is, the higher the chance of success
- casterStatEffect : Default (Multiply) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide. The OneMinus options mean 1 - Stat Value
- targetStatChance : StatDef of the target that is checked to determine success chance. Normally the higher above 0 this is, the lower the chance of success
- targetStatEffect : Default (Divide) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide. The OneMinus options mean 1 - Stat Value
- successMessage : Optional. Message given if this comp succeeds and the caster is a player pawn
- failureMessage : Optional. Message given if this comp fails and the caster is a player pawn
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>