Spawn Pawn Kinds - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allows you to spawn pawns. The basic comp stuff looks like this:

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

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

  • 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 (True) : 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
  • 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
  • severity : Default (1) : The severity to assign the hediff

This example summons 4 to 7 rats who will immediately try finding an enemy of the caster's faction to kill. They die in 4-8 hours, and use the EBSGFramework.HediffCompProperties_PreventDeathNotifications comp to attempt to suppress the death letter:

    <AbilityDef>
        <defName>SpawnMurderRats</defName>
        <label>spawn murder rats</label>
        <description>They'll feast on the corpses of your enemies.</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>
            <targetParams>
                <canTargetLocations>True</canTargetLocations>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilitySpawnPawnKind">
                <pawnKind>Rat</pawnKind>
                <count>4~7</count>
                <mentalStateOnSpawn>EBSG_AggressiveSummon</mentalStateOnSpawn>
                <hediffOnPawns>MurderRat</hediffOnPawns>
            </li>
        </comps>
    </AbilityDef>

    <HediffDef>
        <defName>MurderRat</defName>
        <label>murder rat</label>
        <description>This pawn will vanish soon.</description>
        <everCurableByItem>false</everCurableByItem>
        <stages />
        <hediffClass>HediffWithComps</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="HediffCompProperties_DisappearsAndKills">
                <disappearsAfterTicks>1000~2000</disappearsAfterTicks>
                <showRemainingTime>True</showRemainingTime>
            </li>
            <li Class="EBSGFramework.HediffCompProperties_DestroyOnDeath" />
            <li Class="EBSGFramework.HediffCompProperties_PreventDeathNotifications" />
        </comps>
    </HediffDef>
⚠️ **GitHub.com Fallback** ⚠️