-
Notifications
You must be signed in to change notification settings - Fork 59
ObjectSpawnsDef
juanosarg edited this page Jun 24, 2025
·
1 revision
ObjectSpawnsDef is a custom def class that allows the modder to spawn some things on the map at map creation
public ThingDef thingDef;
public List<ThingOption> thingDefs;
public ThingCategoryDef category;
public PawnKindDef pawnKindDef;
public FactionDef factionDef;
public bool allowOnWater;
public bool allowOnChunks;
public IntRange numberToSpawn;
public List<string> allowedTerrains;
public List<string> disallowedTerrainTags;
public List<BiomeDef> allowedBiomes;
public List<RoadDef> allowedRoads;
public bool findCellsOutsideColony = false;
public bool spawnOnlyInPlayerMaps = false;
public bool randomRotation;
public bool allowSpawningOnPocketMaps = false;It is a custom def class, so you just add it in an xml file. For example, this spawns vehicle wrecks in Vanilla Vehicles Expanded:
<?xml version="1.0" encoding="UTF-8"?>
<Defs>
<VEF.Maps.ObjectSpawnsDef>
<defName>VVE_AncientAsphaltHighway_VehicleWrecks</defName>
<thingDefs>
</thingDefs>
<numberToSpawn>4</numberToSpawn>
<allowedRoads>
<li>AncientAsphaltHighway</li>
</allowedRoads>
<allowOnWater>false</allowOnWater>
</VEF.Maps.ObjectSpawnsDef>
</Defs>- Abilities
- Aesthetic scaling
- Animal Behaviours
- Apparels
- Buildings
- Cooking
- Factions
- Genes
- Global
- Graphics
- Hediffs
- Maps
- Memes
- OptionalFeatures
- Pawns
- Planet
- Plants
- Storyteller
- Things
- Weapons
- Weathers
- PipeSystem basics
- Resource
- Resource storage
- Resource processor
- Resource to thing
- Resource to power
- Thing to resource
- Resource trader
- Refill building with pipes
- Pipe valve
- Advanced Resource Processor
- Update to KCSG 2.0
- Exporting buildings
- Customizing symbols
- Debug helpers options
- Custom faction settlement
- Custom structure and scenarios
- Custom structure in quests
- Custom structure in WorldObjects
- Biome based structures
- Spawning world object(s) at world generation
- Prevent settlement spawning for nomadic factions