State Machine State
8 nodes
On this page 8
Make State Machine State
FunctionThis node carries no documentation.
StateMachineState() -> State Machine State
StateMachineState StateMachineState()
Returns
| State Machine State | State Machine State |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Machine
FunctionThe machine this instance is running in. Set by the runtime when the state is constructed; null
only for an instance constructed outside a machine run.
Machine(State Machine State: State Machine State) -> State Machine
StateMachineApplication Machine(StateMachineState State Machine State)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine State | State Machine State | — |
Returns
| result | State Machine |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Update Frequency
FunctionHow often the machine ticks this state's Update, in HERTZ (ticks per second). Default 60.
Settable at any time - the loop re-reads it every iteration - though "set it during Enter" is the
documented idiom. Values that are not positive finite numbers are read as the 60 Hz default.
UpdateFrequency(State Machine State: State Machine State) -> Number
double UpdateFrequency(StateMachineState State Machine State)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine State | State Machine State | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Set Update Frequency
FunctionSets how often this state's Update ticks, in hertz. The loop re-reads the frequency every tick, so
the change takes effect from the next tick on.
SetUpdateFrequency
State Machine State: State Machine State
hertz: Numbervoid SetUpdateFrequency(
StateMachineState State Machine State,
double hertz)Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine State | State Machine State | — | |
| hertz | Number | — | Ticks per second. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Stop
FunctionEnds the machine: the loop stops after the callback that called this returns. No further state is
entered and the active state is not exited - stopping is an end, not a transition.
Stop(State Machine State: State Machine State)
void Stop(StateMachineState State Machine State)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine State | State Machine State | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Enter
EventThe state has just been entered. Runs once per entry, on a freshly constructed instance - a
self-transition exits, constructs anew, and enters again, so nothing survives from the previous
visit. The documented place to set StateMachineState.UpdateFrequency.
Enter()
void Enter()
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Exit
EventA transition is leaving this state. Runs as part of a transition only - a machine that ends (a
final state's Update returned, or StateMachineState.Stop was called) does not exit its active state,
because ending is not leaving to anywhere. See the loop for the full sequence.
Exit()
void Exit()
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host
Update
EventOne tick of the active state, at the state's StateMachineState.UpdateFrequency.
Update(delta: Number)
void Update(double delta)
Parameters
| name | type | default | description |
|---|---|---|---|
| delta | Number | — | Time this tick stands for, in SECONDS - at frequency f this is 1/f. The loop is fixed-rate, so the delta is the tick duration rather than a wall-clock measurement. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events StateMachineState
- Declared by
- State Machine State
- Package
- State Machine Host