Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/encounter_templates/

An encounter template: named entities placed relative to an origin and the I/O links between them, such as a room whose trigger volume fills a spawner whose last death opens a door. Every link is checked when the template loads: its ports exist on the two entities’ components and its value converts. Placed with /ai encounter spawn or from code. Loaded by the server only.

Registrymanifold-ai:encounter-template
Filesdata/encounter_templates/*.ron, *.update.ron, *.final.ron
Sidesserver: only the server loads it
Readsmanifold:archetype, manifold-ai:io-signature
ContractPopulation, data stage

Entry

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

FieldTypeRequiredDefaultDescription
idstringyesThe template’s key, <mod-id>:<name>.
entitiesmap of string to TemplateEntityyesThe entities by name.
linkslist of io-linknononeThe links between them.

Example

No bundled file declares one yet. From the reference’s test fixture, crates/manifold-server-state/tests/data-reference-fixture/data/encounter_templates/relay.ron, which the data stage loads in its tests:

EncounterTemplate(id: "dataref-fixture:enc/relay", entities: {"relay": (archetype: "manifold:logic/relay")})

Types

TemplateEntity

An entity of a template.

A record: TemplateEntity(..) or (..).

FieldTypeRequiredDefaultDescription
archetypestringyesIts archetype (manifold:archetype key); E’s logic archetypes are manifold:logic/relay, counter, timer, trigger_volume, branch and spawner_points. An unknown key fails the data stage (DATA010).
at(f32, f32, f32)no(0, 0, 0)Its position from the template’s origin, (x, y, z).
yawf32no0Its yaw, in degrees.
parentstring or NonenononeAnother entity of the template this one is ChildOf (a director’s spawners).
member_ofstring or NonenononeAnother entity of the template this one is MemberOf.
extramap of string to component-valuenononeValues for E’s logic components by component key, which patch the archetype’s or add them: manifold-ai:spawner, counter, timer, trigger-volume, branch, logic-relay, stat-watch and director ((def: "<director def>")). A spawner’s shape is template-local, and it defaults to the Encounter policy, one creature, disabled, and one point at its entity’s cell.

Value forms used here: component-value, io-link.