Spawn Humanlike - KonradHeinser/EBSGFramework GitHub Wiki
This hediff def will cause humanlikes to pop out of the pawn on occasion without having to rely on the standard birthing process. You can set the minimum and maximum hediff severity required for the hediff, along with what developmental stage they will pop out in:
<comps>
<li Class="EBSGFramework.HediffCompProperties_SpawnHumanlike">
</li>
</comps>
One important thing to note is that the hediff will view the carrier as the "mother", regardless of gender. This is to make it easier to standardize stuff (i.e. if only the giver's xenotype should be used, gender won't break the effect), and shouldn't usually have any notable in-game effect.
If you plan on adding this hediff via ability, use Give Multiple Hediffs specifically to make the hediff always use the caster's faction (if available), and to set the "father" to the caster
These are the basic spawn setup options available:
- maxTotalSpawn : Default (1) : The total number of children that can be spawned. If set to -1, it will spawn indefinitely
- spawnPerCompletion : Default (1~1) : How many pawns to try to spawn. This number will be limited by how many total spawns are left
- completionTicks : Default (600~600) : How many ticks there are between spawns. This should probably be set to a number higher than 10 seconds. Only needed if onInterval is left as True
- allowInCaravans : Default (True) : Allow the spawning to occur while the pawn is in a caravan. This will add the pawns directly to the caravan, but will always be treated as False if the faction of the pawn(s) that would be spawned would have a different faction than the caravan owner, delaying the spawn until the caravan has arrived at a map to avoid some weird issues. If this is False and the ticker reaches 0 while the pawn is in a caravan, the spawning happens almost immediately after they arrive at a map destination
- tickInCaravans : Default (True) : Allows the timer to go down while the pawn is in a caravan. If set to False, allowInCaravans probably won't matter due to the fact that the ticker doesn't go down, but there is a much smaller risk of pawns popping out as soon as the caravan arrives at a map destination
- validSeverity : Default (0~99999) : Causes the effect to only activate when in this range. If a single value is entered, then any severity above that number will be considered valid
- onInterval : Default (True) : Causes the spawns to happen when the interval set in completionTicks runs out
- onDeath : Default (False) : Causes spawning to occur when the pawn dies. This is subject to the same maxTotalSpawn limit as onInterval
- onRemoval : Default (False) : Causes spawning to occur when the hediff is removed. This is subject to the same maxTotalSpawn limit as onInterval, and will check to make sure the pawn isn't dead
- spawnRemainingOnRemovalOrDeath : Default (True) : Overrides spawnPerCompletion to ensure all remaining pawns will be spawned
- developmentalStage : Default (Adult) : The developmental state to assign to the child when made via intervals. Options are Baby, Child, and Adult
- devStageForRemovalOrDeath : Default (Child) : The developmental state to assign to the child when made post host death or hediff removal. Options are Baby, Child, and Adult
- removeHediffOnFinalSpawn : Default (True) : When it runs out of the spawns listed in maxTotalSpawn, the hediff is removed
- killHostOnFinalSpawn : Default (False) : When it runs out of the spawns listed in maxTotalSpawn, the pawn is killed
- 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 born as a baseliner
- 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
- miscarriageThought : Default (False) : If the hediff is removed before all children are created, this attempts to apply a mood penalty to known parents. Does not apply to the mother if the child's faction is not the same as theirs
- motherMiscarriageThought : Default (Miscarried) : The ThoughtDef to try to apply to the mother if miscarriageThought is True and the object is destroyed
- fatherMiscarriageThought : Default (PartnerMiscarried) : The ThoughtDef to try to apply to the father if miscarriageThought is True and the object is destroyed
- 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 hediff carrier
- fatherRelation : Default (Parent) : The PawnRelationDef to assign between the created pawn and the hediff applier, if applicable
This example will kill the pawn after up to an hour passes, and spawn 3 adult hussars around the death location. Because allowInCaravans is set to False, the killing and spawning won't happen if the pawn is not on a map, but because tickInCaravans is left as True time will still tick down (probably causing them to die as soon as their caravan enters the destination due to the low completionTicks). A letter is not sent so the game can handle the naming of the hussars automatically. The hussars will be in the player faction unless an ability is made to make it usable in-game
<HediffDef>
<defName>SurpriseMurderPawns</defName>
<label>murder</label>
<description>Ouch.</description>
<everCurableByItem>false</everCurableByItem>
<initialSeverity>0.001</initialSeverity>
<stages />
<hediffClass>HediffWithComps</hediffClass>
<scenarioCanAdd>false</scenarioCanAdd>
<comps>
<li Class="EBSGFramework.HediffCompProperties_SpawnHumanlike">
<staticXenotype>Hussar</staticXenotype>
<maxTotalSpawn>3</maxTotalSpawn>
<spawnPerCompletion>3</spawnPerCompletion>
<completionTicks>2000~2500</completionTicks>
<killHostOnFinalSpawn>True</killHostOnFinalSpawn>
<developmentalStage>Adult</developmentalStage>
<sendLetters>False</sendLetters>
<allowInCaravans>False</allowInCaravans>
</li>
</comps>
</HediffDef>