Skip to content

Flow actions

24 actions in the Flow category. Each block mirrors how the action appears in the editor's sidebar.

Alternate

Every Frame
Alternate Flow
→ First | → Second

Takes turns between its two branches, First then Second then First again, one per run. On enter it is what makes a footstep state play the left sound and then the right one. The side it stopped on survives leaving and coming back to this state.

Branch Goes to
First Where to go on the first run, then on the third, the fifth and so on.
Second Where to go on the second run, then on the fourth, the sixth and so on.

Phases StartEvery FramePhysics

Break

Every Frame
Break Flow

Leaves the surrounding loop and skips the rest of its passes. Only valid inside a For Each or Repeat.

Phases StartEvery FramePhysics

Chance

Every Frame
Chance Flow
50.0 | → True | → False

Answers a random roll against the chance given, so Chance = 25 comes up true about one time in four. It can branch on the answer or hand it to a field that takes a yes or no.

Input Type Default Description
Chance % float 50.0 Percent chance of taking the True branch, from 0 to 100.
Output Type Description
Yes bool Where to store whether the roll came up inside the chance.
Branch Goes to
True Where to go when the roll succeeds.
False Where to go when it fails.

Phases StartEvery FramePhysics

Continue

Every Frame
Continue Flow

Skips to the next pass of the surrounding loop. Only valid inside a For Each or Repeat.

Phases StartEvery FramePhysics

Cooldown

Every Frame
Cooldown Flow
1.0 | → Ready | → Cooling

Lets something happen at most once every so many seconds, however many frames run through it. With Seconds = 1, holding the fire button gives one shot per second and the frames in between take Cooling. It fires right away on the first frame and only then blocks, unlike Every N Seconds, which waits first. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Seconds float 1.0 How long it stays blocked after firing, in seconds.
Branch Goes to
Ready Where to go when the wait is up. It starts the wait again.
Cooling Where to go while still waiting.

Phases Every FramePhysics

Count To

Every Frame
Count To Flow
3 | → Reached | → Counting

Counts every time it runs and takes Reached on the run number Times, then counts from zero again. With Times = 3 on enter, the first two hits take Counting and the third one kills the enemy. The count survives leaving and coming back to this state. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Times int 3 How many times it has to run before Reached fires.
Branch Goes to
Reached Where to go on the run that hits Times. The count goes back to zero right after.
Counting Where to go while the count is still below Times.

Phases StartEvery FramePhysics

Crossed

Every Frame
Crossed Flow
Value not set | Limit 0 | Direction 'below' | → Crossed | → Other Frames

Fires once on the frame a value passes a limit, then stays quiet until the value comes back and passes it again. With Limit = 20 going down, health dropping from 25 to 15 takes Crossed on that one frame and Other Frames while it stays at 15. A value already past the limit on entry counts as a crossing. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Value Variant - The number to watch, such as health or a combo counter.
Limit Variant 0 The mark the value has to pass.
Direction String 'below' Which side of the limit counts as crossed.
Branch Goes to
Crossed Where to go on the one frame the value passes the limit.
Other Frames Where to go on every other frame, the ones where it stays past the limit included.

Phases Every FramePhysics

Do If

Every Frame
Do If Flow
true

Runs the actions inside it only when the condition is true, staying in the same state. It is the plain if: nothing here jumps to another state.

Input Type Default Description
Condition bool true The test to run, such as a comparison kept in a variable or a Compare action placed right here.

Phases StartEvery FramePhysics Holds nested actions

Do N Times

Every Frame
Do N Times Flow
3 | → First Times | → After That

Does something on the first frames only and then stops. With Times = 3, the first three frames take First Times and every frame after that takes After That. The count restarts each time the state is entered. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Times int 3 How many frames go through the First Times branch.
Branch Goes to
First Times Where to go on the first Times frames.
After That Where to go on every frame once those are used up.

Phases Every FramePhysics

Do Once

Every Frame
Do Once Flow
→ First Time | → After That

Does something on the first frame it runs and never again, so a hit sound plays once instead of every frame. Every frame after that takes After That. It resets each time the state is entered. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Branch Goes to
First Time Where to go on the first frame only.
After That Where to go on every frame after the first.

Phases Every FramePhysics

Every

Every Frame
Every Flow
1.0

Runs the actions inside it once every so many seconds while this state runs. With Seconds = 2, an enemy spawns every two seconds. The timer restarts each time the state is entered. Every N Seconds is the same clock with branches instead of nested actions.

Input Type Default Description
Seconds float 1.0 How often to run the inner actions, in seconds.

Phases Every FramePhysics Holds nested actions

Every N Seconds

Every Frame
Every N Seconds Flow
1.0 | → Time Up | → Waiting

Waits so many seconds, takes Time Up for one frame and starts counting again, over and over. With Seconds = 3, an enemy shoots every three seconds and the frames in between take Waiting. Cooldown is the one that fires right away and blocks afterwards. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Seconds float 1.0 How long each round of the timer lasts, in seconds.
Branch Goes to
Time Up Where to go on the frame the timer reaches Seconds. The timer goes back to zero right after.
Waiting Where to go on the frames while the timer is still running.

Phases Every FramePhysics

Every N Times

Every Frame
Every N Times Flow
5 | → Nth Time | → Other Times

Does something once every so many frames instead of every frame. With Times = 5, the first four frames take Other Times and the fifth takes Nth Time, then it starts over. The count restarts each time the state is entered. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Times int 5 How many frames one cycle lasts. 5 means the fifth frame is the one that fires.
Branch Goes to
Nth Time Where to go on every Times-th frame, so once per cycle.
Other Times Where to go on the frames in between.

Phases Every FramePhysics

Every Random

Every Frame
Every Random Flow
Min 0.5 | Max 2.0

Runs the actions inside it on a random interval, drawing a new wait between Min and Max after each run. With Min = 1 and Max = 4, an idle grunt plays somewhere between one and four seconds apart instead of on a metronome.

Input Type Default Description
Min float 0.5 The shortest wait between two runs, in seconds.
Max float 2.0 The longest wait between two runs, in seconds.

Phases Every FramePhysics Holds nested actions

For Each

Every Frame
For Each Flow
not set

Runs the actions inside it once for every item of a list, all in the same frame. A list of ten enemies runs the inside ten times, with Item holding one enemy each pass. A timer nested inside it ticks once per item, not once per frame.

Input Type Default Description
Collection Variant - The array or collection to walk through.
Output Type Description
Item Variant The current element, for the nested actions to read.
Index int The position of the current element, starting at 0.

Phases StartEvery FramePhysics Holds nested actions

For N Seconds

Every Frame
For N Seconds Flow
1.0 | → During | → After That

Does something for the first seconds only and then stops. With Seconds = 2, the first two seconds take During and every frame after that takes After That, which is how a dash or an invincibility window ends itself. The timer restarts each time the state is entered. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Seconds float 1.0 How long the During branch lasts, in seconds.
Branch Goes to
During Where to go while the time is not up yet.
After That Where to go on every frame once the time is up.

Phases Every FramePhysics

Go Back

Start
Go Back Flow

Returns control to whichever state was running before this one took over.

Phases StartEvery FramePhysics

Held For

Every Frame
Held For Flow
Condition true | Seconds 1.0 | → Held | → Waiting

Takes Held once the condition has stayed true for the whole time asked. With Seconds = 2, holding the button for two seconds charges the shot, and letting go before that puts the count back to zero. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Condition bool true The test that has to stay true, such as a Compare action placed right here.
Seconds float 1.0 How long the condition has to hold without breaking, in seconds.
Branch Goes to
Held Where to go once the condition has held long enough. It keeps firing while the condition stays true.
Waiting Where to go while the time is not complete.

Phases Every FramePhysics

Hold Charge

Every Frame
Hold Charge Flow
Condition true | Seconds 1.0 | → Full | → Charging

Fills a value from 0 to 1 while the condition stays true, and drops it back to 0 the moment it breaks. With Seconds = 2, holding the button for one second stores 0.5, which is the width a charge bar draws. Held For answers whether the time is complete; this one answers how far along it is.

Input Type Default Description
Condition bool true The test that has to stay true, such as a Compare action placed right here.
Seconds float 1.0 How long holding takes to reach a full charge, in seconds.
Output Type Description
Charge float Where to store how full the charge is, from 0 to 1.
Branch Goes to
Full Where to go once the charge reached 1. It keeps firing while the condition stays true.
Charging Where to go while the charge is still filling or empty.

Phases Every FramePhysics

If

Every Frame
If Flow
true | → True | → False

Branches to one of two targets based on a condition. Each branch transitions to a state or sub-state set per action.

Input Type Default Description
Condition bool true The test that decides which branch runs.
Branch Goes to
True Where to go when the condition is true.
False Where to go when it is false.

Phases StartEvery FramePhysics

Just Became True

Every Frame
Just Became True Flow
false | → Became True | → Other Frames

Fires only on the frame the condition turns true, and stays quiet while it keeps being true. Holding a button takes Became True on the frame it goes down and Other Frames while it stays down. A condition already true on entry counts as turning true. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Condition bool false The test to watch, such as a comparison kept in a variable or a Compare action placed right here.
Branch Goes to
Became True Where to go on the one frame the condition turns true.
Other Frames Where to go on every other frame, the ones where it stays true included.

Phases Every FramePhysics

Repeat

Every Frame
Repeat Flow
3

Runs the actions inside it a fixed number of times, all in the same frame. With Times = 10, ten bullets go out on the same frame and Index counts from 0 to 9. A timer nested inside it ticks once per pass, so ten passes in one frame move it ten steps.

Input Type Default Description
Times int 3 How many times to run the nested actions.
Output Type Description
Index int The current pass number, starting at 0.

Phases StartEvery FramePhysics Holds nested actions

Transition

Every Frame
Transition Flow
→ To

Immediately transitions to another state, sub-state, or a state of another script.

Branch Goes to
To Where to transition to.

Phases StartEvery FramePhysics

When It Changes

Every Frame
When It Changes Flow
not set | → Changed | → Same

Fires on the frame a value stops being what it was, and reports the value it held before. Swapping the weapon from sword to bow takes Changed on that frame, with Previous holding the sword. The first frame after entering only records the value, so it never fires on entry. Either branch can run actions of its own, so a small bit of behaviour needs no state of its own.

Input Type Default Description
Value Variant - The value to watch, such as the current weapon or the phase name.
Output Type Description
Previous Variant The value held until this change.
Branch Goes to
Changed Where to go on the one frame the value is different.
Same Where to go while the value stays the same.

Phases Every FramePhysics