A machine, as defineMachine takes it: XState’s config, with id the
name its trait dumps and streams under.
| Type Parameter |
Default type |
Context extends MachineContext |
- |
States extends Record<string, StateConfig<Context>> |
- |
On extends Record<string, TransitionTarget<Context>> |
- |
Tagged extends boolean |
boolean |
Id extends string |
string |
| Property |
Type |
Description |
context? |
Context |
Each field’s value on a fresh trait. |
description? |
string |
- |
heldBy? |
readonly (Trait | CoreTrait<any>)[] |
Traits that hold this machine alone where it is, as MachinePausedTrait holds every machine: on an entity with one of them, its wait counts no seconds and its when rules go untested, while the entity’s other machines run on. An NPC’s routine names TalkingTrait and SuspendedTrait. |
id |
Id |
The machine’s name: its trait dumps, streams and checkpoints under it, the devtools list it by it, and a target names a state from the top by it, as #id.state. |
initial |
Extract<keyof States, string> |
- |
on? |
On |
Events every state takes. Its targets name a state from the machine’s top, as XState’s do there: after a dot, .state.child, or by the machine’s id, #id.state.child. |
reach? |
StreamedReach |
Which pages a room streams its trait to, as a trait’s reach names them: Reach.Everyone where left out; Reach.Owner for a machine that is the player’s own alone, such as a conversation’s, as Unreal’s COND_OwnerOnly does. The dump shows it either way. |
states |
States |
- |
tags? |
Tagged |
false leaves the states’ tags off, so is is empty and the machine writes its record alone: for a machine many kinds of entity each declare their own of, such as an NPC’s routines, whose systems read the state from read. Each tag is a koota trait, and the dump tests each entity for every one. |