Spawn Humanlike (Ability) - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp creates humanlike pawns somewhat similar to how Spawn Humanlike works:

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

One important thing to note is that the ability will view the target as the "mother" and the caster as the "father", regardless of gender. This is to make it easier to standardize stuff (i.e. if only the caster's xenotype should be used, gender won't break the effect), and shouldn't usually have any notable in-game effect.


These are the options available:

  • spawnCount : Default (1~1) : A static number of pawns to spawn each time. When a range is given, a random number is picked each cast
  • bodySizeFactor : Replacement for spawnCount that makes the number of pawns spawned scale based on body size times this value, rounded down. If a target would be too small to generate a single pawn, then the ability cannot be used on that target. If the target is neither a pawn nor a corpse, then it will never be valid while this is being used
    • For example, if you target a pawn/corpse with a body size of 2, setting bodySizeFactor to 1 will generate 2 pawns, setting it to 2 will generate 4 pawns, setting it to 0.5 will generate to 1 pawn, and setting it below 0.5 will result in a message about the target being too small
  • targetEffect : Default (None) : Determines what happens to the selected target, with the options being None (nothing happens), Kill (the target is killed/destroyed, and if possible will leave a corpse behind), and Vanish (target is killed without allowing for corpses
  • destination : Default (Selected) : Determines if the pawns will be spawned on the Selected target/location, or the Caster
  • developmentalStage : Default (Adult) : The developmental state to assign to the child when made via intervals. Options are Baby, Child, and Adult
  • linkedHediff : A HediffDef on the caster that points to the "mother". If the target is a pawn or corpse, they will no longer impact things like selected genes or relations (the pawn that linkedHediff points to will be the new target for those), but will be considered the Selected target for things like destination and targetEffect
  • removeLink : Default (False) : Removes the linkedHediff on a successful cast when set to True
  • staticXenotype : XenotypeDef to always apply to the pawn
  • xenotypeSource : Default (Hybrid) : If there is no static xenotype, then this will attempt to inherit genes from the related parent(s). The options are Hybrid, Mother, and Father. If staticXenotype is empty and this fails, the child will be a baseliner
  • staticGenes : A list of GeneDefs that are always given to the resulting pawn. If this ability is given through a gene, this can ensure the resulting pawn will have it, though it can also be used to give genes that neither pawn has
  • xenotypeLabel : A label to replace the name of whatever xenotype is made/picked. This does not change any of the genes given, just changes the label assigned. This is mostly useful for situations like xenotypes that use this ability to multiply
  • staticPawnKind : A static PawnKindDef to use. If not filled in, the game will attempt to use the mother's pawn kind def, followed by the father's, followed by colonist if both of those fail
  • noGear : Default (False) : When True, the pawn will spawn without any gear regardless of what pawn kind is used

Some miscellaneous things that apply post-"birth":

  • sendLetters : Default (False) : Send standard birth letters for each pawn made. Generally speaking, it's better to leave this as False if the pawn will not be a baby on creation, but if it is spawning a baby, it's recommended to use it as the game isn't very good at naming colonist babies unprompted
  • letterLabelNote : Default (born) : The label of the letter is the pawn's name followed by whatever is put here
  • letterTextPawnDescription : Default ("became a healthy baby!) : The end portion of the description text in the letter
  • filthOnCompletion : ThingDef to create for every spawn. If left empty, nothing is made
  • filthPerSpawn : Default (4~7) : The amount of filth to make for each baby made
  • bornThought : Default (True) : Apply a baby born thought to parents when the child is born. Doesn't apply to the mother if the child's faction is not the same as theirs
  • motherBabyBornThought : Default (BabyBorn) : The ThoughtDef to try to apply to the mother if bornThought is True and a child is born
  • fatherBabyBornThought : Default (BabyBorn) : The ThoughtDef to try to apply to the father if bornThought is True and a child is born
  • relations : Default (Both) : Determines who relations should formed with when the pawn is spawned. The options are Both, Mother, Father, and Neither
    • The reason for the default of Both on this and the default relations of Parent is set below is because of the way Ludeon handles generating pawn relations mid-game. Unless mods are used that remove it, pawns generated through this comp are sometimes capable of generating family members randomly, albeit rarely. Only change these relation defaults if you have taken steps to prevent that or are willing to accept the risk
  • motherRelation : Default (Parent) : The PawnRelationDef to assign between the created pawn and the target, if applicable
  • fatherRelation : Default (Parent) : The PawnRelationDef to assign between the created pawn and the caster

This example does mostly the same thing as the example in Spawn Humanlike, with the main exceptions being that the corpse is destroyed and a bunch of blood ends up everywhere. Regardless of the target, it will always generate 3 pawns. If a minimum size needed to be set (so things like squirrels don't generate 3 hussars), the Ability Validator can set static limits:

    <AbilityDef>
        <defName>SurpriseMurderPawns</defName>
        <label>murder</label>
        <description>Ouch.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetBuildings>False</canTargetBuildings>
                <canTargetMechs>False</canTargetMechs>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilitySpawnHumanlike">
                <staticXenotype>Hussar</staticXenotype>
                <spawnCount>3</spawnCount>
                <targetEffect>Vanish</targetEffect>
                <developmentalStage>Adult</developmentalStage>
                <filthOnCompletion>Filth_Blood</filthOnCompletion>
                <filthPerSpawn>12~15</filthPerSpawn>
            </li>
        </comps>
    </AbilityDef>

This example destroys an organic corpse, and generates a number of hussars based on the body size of the target:

    <AbilityDef>
        <defName>SurpriseMurderPawns</defName>
        <label>murder</label>
        <description>Ouch.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetBuildings>False</canTargetBuildings>
                <canTargetMechs>False</canTargetMechs>
                <canTargetCorpses>True</canTargetCorpses>
                <onlyTargetCorpses>True</onlyTargetCorpses>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilitySpawnHumanlike">
                <staticXenotype>Hussar</staticXenotype>
                <bodySizeFactor>1</bodySizeFactor>
                <targetEffect>Vanish</targetEffect>
                <developmentalStage>Adult</developmentalStage>
                <filthOnCompletion>Filth_Blood</filthOnCompletion>
                <filthPerSpawn>12~15</filthPerSpawn>
            </li>
        </comps>
    </AbilityDef>

This example destroys a pawn's corpse, and creates a new hybrid pawn with a mix of the caster's genes and the target's genes. If SurpriseMurderPawns is attached to a gene, it could be added to staticGenes to ensure the resulting pawn is always capable of doing the same to another target later:

    <AbilityDef>
        <defName>SurpriseMurderPawns</defName>
        <label>murder</label>
        <description>Ouch.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
            <targetParams>
                <canTargetBuildings>False</canTargetBuildings>
                <canTargetMechs>False</canTargetMechs>
                <canTargetCorpses>True</canTargetCorpses>
                <onlyTargetCorpses>True</onlyTargetCorpses>
                <canTargetAnimals>False</canTargetAnimals>
                <canTargetEntities>False</canTargetEntities>
            </targetParams>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_AbilitySpawnHumanlike">
                <targetEffect>Vanish</targetEffect>
                <developmentalStage>Adult</developmentalStage>
                <filthOnCompletion>Filth_Blood</filthOnCompletion>
                <filthPerSpawn>12~15</filthPerSpawn>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️