Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/spawners/

A spawner placed by content: a region of the world that keeps a number of creatures alive from its spawn rules, checking every few seconds and respawning after deaths. It is created once in its space and then saved like any persistent entity. Loaded by the server only.

Registrymanifold-ai:spawner
Filesdata/spawners/*.ron, *.update.ron, *.final.ron
Sidesserver: only the server loads it
Readsnothing
ContractPopulation, data stage

Entry

A record, written Spawner(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe spawner’s key, <mod-id>:<path>.
shapeSpawnerShapeyesWhere it spawns.
sourceSpawnSourceyesWhat it spawns.
policyPersistencePolicynoAmbientHow its creatures persist. Only Ambient is available.
max_aliveu16no4The most creatures alive at once, at least 1.
cadencedurationno160 ticksHow often it checks, at least 1 tick.
attempts_per_evalu8no4Spawn attempts per check.
respawnRespawnno30 s, catching up 2 at a timeRespawns after deaths.
leashu16 or Nonenohalf the region’s horizontal diagonalHow far a creature may stray, in blocks, before it is led back.
enabledboolnotrueWhether it spawns.

Example

From tools/test-mods/guide-creature/data/spawners/west_meadow.ron:

Spawner(
    id: "guide-creature:spawner/west_meadow",
    shape: Region(min: (-72, 48, 28), max: (-28, 84, 72)),
    source: Rules(["guide-creature:spawn/razorback"]),
    policy: Ambient,
    max_alive: 2,
    cadence: "4s",
    respawn: (delay: "60s", catch_up_max: 1),
    leash: Some(24),
)

Types

SpawnerShape

Where a spawner spawns.

VariantWrittenDescription
RegionRegion(min: .., max: ..)A box of blocks, corners inclusive.

Region fields:

FieldTypeRequiredDefaultDescription
min(i32, i32, i32)yesOne corner, (x, y, z).
max(i32, i32, i32)yesThe other corner.

SpawnSource

What a spawner spawns.

VariantWrittenDescription
RulesRules([string])Spawn rules by key, at least one.

PersistencePolicy

How a spawner’s creatures persist.

VariantWrittenDescription
AmbientAmbientNever saved: gone after a restart and spawned afresh; despawn by distance.
EncounterEncounterNot available yet (Talos E2): refused at load.
PersistentPersistentNot available yet (Talos E4): refused at load.

Respawn

A spawner’s respawns.

A record: Respawn(..) or (..).

FieldTypeRequiredDefaultDescription
delaydurationno"30s"How long after a death before a replacement may spawn.
catch_up_maxu8no2The most spawns one check makes, so a returning player meets a filling area.

Value forms used here: duration.