Skip to content

Spawn pawns on missing body parts

juanosarg edited this page May 29, 2026 · 1 revision

<- Back

CompSpawnPawnsOnMissingBodyPart makes an animal spawn another pawn or pawns every time it loses a body part through damage

        //pawnKindOptions is spawned sequentially, so if you want it to spawn 3 rats just do a list with 3 Rat                 
        public List<PawnKindDef> pawnKindOptions = new List<PawnKindDef>();
        public ThingDef filthCreated;
        public IntRange filthCountRange;
        public SoundDef sound;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag.

<comps>
	<li Class="VEF.AnimalBehaviours.CompProperties_SpawnPawnsOnMissingBodyPart">
		<pawnKindOptions>
			<li>VGE_Exoworm</li>
		</pawnKindOptions>
		<filthCreated>Filth_BloodInsect</filthCreated>
		<filthCountRange>2~5</filthCountRange>
		<sound>Hive_Spawn</sound>
	</li>
</comps>

Clone this wiki locally