Spawn Pawn Kind on Removal - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp allows you to spawn pawns when it is removed. The basic comp stuff looks like this:

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

These are the options you have available to you within the comp:

  • activation : Default (Always) : Determines what situations can trigger the comp. The options are Always, OnDeathOnly, and OnRemovalOnly. OnDeathOnly only works if the hediff is removed on death
  • validSeverity : Can be either a single value or a range (i.e. 0~1.5). If a single value, then the severity must be at or above that value for the comp to activate. If using a range, then the hediff's severity must be in that range for the comp to activate
  • pawnKind : The PawnKindDef to spawn
  • count : Default (1~1) : The number of pawns to spawn. If you want a specific number, you don't need to put a range
  • stage : Default (Adult) : The developmental state to assign to each pawn when made. Options are Newborn, Baby, Child, and Adult
  • effecter : The EffecterDef to use on the pawn that had the hediff
  • spawnEffecter : The EffecterDef to use on each spawned pawn
  • attachEffecterToPawn : Default (False) : When true, it attaches the spawnEffecter to each spawned pawn instead of the spawn location
  • inCreatorFaction : Default (False) : When true, the comp will attempt to give each spawned pawn the same faction as the pawn the hediff is attached to. If they are a mechanoid that can have an overseer, it will also attempt to make the pawn with the hediff the overseer. If the hediff is applied through damage or an ability comp from this framework like Give Multiple Hediffs or Create Linked Hediffs then the one applying the hediff will be treated as the Creator
  • staticFaction : If this is set to something while inCreatorFaction is false, then the pawn will try to spawn with the FactionDef listed here instead of the one listed for their pawn kind
  • mentalStateOnSpawn : The MentalStateDef to apply to each spawned pawn. If you want a berserk-like effect while inCreatorFaction is True (the pawn blindly attacks all enemies of the faction), I recommend using EBSG_AggressiveSummon
  • hediffOnPawns : A HediffDef to apply to each spawned pawn. If the hediff kills the pawn in under a day and they are in the player's faction, I recommend adding the EBSGFramework.HediffCompProperties_PreventDeathNotifications comp, which doesn't have its own wiki page because it has no options and is of limited use. The example from Spawn Pawn Kinds uses this comp
  • severity : Default (1) : The severity to assign the hediff

This example creates 4 to 7 rats that are permanently in manhunter mode when spawned, which occurs after a little over an hour:

    <HediffDef>
        <defName>SurpriseMurderRats</defName>
        <label>surprise murder rats</label>
        <description>Where will they come from?</description>
        <everCurableByItem>false</everCurableByItem>
        <hediffClass>HediffWithComps</hediffClass>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_SpawnPawnKindOnRemoval">
                <pawnKind>Rat</pawnKind>
                <count>4~7</count>
                <mentalStateOnSpawn>ManhunterPermanent</mentalStateOnSpawn>
            </li>
            <li Class="HediffCompProperties_SeverityPerDay">
                <severityPerDay>-10</severityPerDay>
            </li>
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️