Skip to main content

Flow Nodes

GCS · Built-In Node Library

Control when and in what order connected nodes run.

Flow nodes route control connections. Use them to branch, repeat, wait, sequence, or pause execution; they do not replace Operator nodes that calculate data values.

Flow nodes route control connections. Use them to branch, repeat, wait, sequence, or pause execution; they do not replace Operator nodes that calculate data values.


Node Usage

Sequence

Runs each step from top to bottom. Use it when one trigger must start several independent branches in a fixed order, such as applying damage, updating a status, and then playing presentation effects.

Inputs

  • In(Control):Starts the sequence

Outputs

  • Step0StepN(Control):Runs once each, in numeric order; the number of ports follows Outputs

Parameters

  • Outputs(Integer):2;Number of ordered step ports; increasing or decreasing it rebuilds the visible outputs

Steps are started in numeric order. A fully synchronous path finishes before the next step starts, but a path that reaches Wait or Choice returns at that boundary, so later steps can start before the delayed or chosen branch continues. Use Branch or Switch instead when only one of several paths should run.

With Outputs set to 0 or less, the node has no step path to run.

Sequence node with three ordered control outputs

Branch

Chooses one of two control paths from a boolean value. A common connection is Condition.ResultBranch.Condition.

Inputs

  • In(Control):Evaluates the branch
  • Condition(Boolean):true selects True; false or an unconnected input selects False

Outputs

  • True(Control):Runs when Condition is true
  • False(Control):Runs when Condition is false

Parameters: none

Only one output runs per evaluation. If the false case should simply stop, it is valid to leave False unconnected.

Branch node with True and False outputs

Switch

Routes execution by matching an integer or string against a list of cases. Use it for named states such as card types, intent names, or turn modes where a two-way Branch is not enough.

Inputs

  • In(Control):Evaluates the cases
  • On(Integer or String):Value compared with Case Values; its type follows Kind

Outputs

  • Case 1Case N(Control):One visible port per value, using the same order; serialized internally as Case0CaseN-1
  • Default(Control):Runs when no case matches; shown with the case outputs after On is connected

Parameters

  • Kind (internal)Int / String):Int before inference;Set automatically from the data type connected to On; it is not a separate editor selector
  • Cases (Case Values)(Integer or String list):Empty until On is connected;The UI count includes Default; each remaining row stores one case value and creates one visible case output

Matching is exact and case-sensitive for strings. Cases are checked from top to bottom, so the first duplicate wins; an entry that cannot be parsed in Int mode is skipped.

A null string input is treated as an empty string, so it can match an empty string case.

In the editor, connect On before configuring cases or seeing their control outputs. The visible Cases count includes the final Default, so Cases = 3 creates two editable values and the visible outputs Case 1, Case 2, and Default.

Switch node configured with Attack and Defend string cases

Gate

Lets execution continue only while a boolean condition is true. Use it as a compact guard when you do not need a separate false branch.

Inputs

  • In(Control):Tests the gate
  • Allow(Boolean):Opens the gate when true; false stops this path

Outputs

  • Out(Control):Runs only when Allow is true

Parameters: none

An unconnected Allow is false, so the graph stops at the node. Use Branch if both outcomes need behavior.

Gate node with an Allow input

Loop

Runs the same body a fixed number of times. Connect Index when the current zero-based pass number is useful for scaling, selecting, or display.

Inputs

  • In(Control):Starts the loop
  • Count(Integer):Number of body executions; falls back to the Count field

Outputs

  • Body(Control):Runs once per pass
  • Done(Control):Runs after all passes, including when the count is zero or negative
  • Index(Integer):Current pass index, starting at 0

Parameters

  • Count(Integer):1;Inspector fallback when the Count input is not connected

The synchronous part of each Body path completes before the next pass begins. If Body reaches Wait or Choice, the next pass starts after that node returns rather than after its later continuation. Prefer Foreach when you already have a collection and need its actual elements.

Every pass overwrites the same Index result in the shared execution context. If a path waits before consuming Index, its continuation can observe a later pass's value, often the final index; consume or store the value before the asynchronous boundary.

Loop node with Body, Done, and Index outputs

Foreach

Runs once for every item in a unit, card, or status collection. It preserves collection order and exposes both the current item and its zero-based index.

Inputs

  • In(Control):Starts enumeration
  • Collection(Unit, Card, or Status collection):Items to enumerate; its type follows Kind

Outputs

  • Body(Control):Runs once for each item
  • Done(Control):Runs after the last item, or immediately for a null or empty collection
  • Element(Unit, Card, or Status reference):Current item; its type follows Kind
  • Index(Integer):Current item index, starting at 0

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from the collection connected to Collection; it is not edited directly

Connect Element to the action inside Body; connecting the whole collection there would repeat the same collection action for every pass.

Null elements are still enumerated: Body runs for that position and Element is null.

As with Loop, reaching Wait or Choice does not hold the enumeration; the next element can begin before that asynchronous continuation resumes.

Foreach iterates the original collection reference rather than a snapshot. Synchronously adding, removing, or moving items in Body can change Count and indexes, causing items to be skipped or newly visited. It also overwrites the shared Element and Index results every pass, so consume or store them before a Wait or Choice boundary.

Foreach node configured for a unit collection

While

Repeats its body while a boolean condition remains true. Use it only when the body changes the value that the condition reads.

Inputs

  • In(Control):Starts condition checking
  • Condition(Boolean):Re-evaluated before every pass

Outputs

  • Body(Control):Runs while Condition is true
  • Done(Control):Runs when Condition becomes false

Parameters: none

While must become false synchronously

If Body does not make Condition false before it returns, the outer iterator keeps running and can lock the game. An unconnected Body with a true condition is an immediate infinite loop; placing Wait or Choice inside the body is not a safe yield because While continues as soon as that node returns. Use Loop, Foreach, or Delayed Trigger when the next pass belongs to a later frame or turn

While node with Body and Done outputs

Wait

Pauses this control path before continuing. Use Seconds for a timed presentation beat, or Animation when another system releases a named animation gate.

Inputs

  • In(Control):Starts the wait
  • Seconds(Float):Shown in Seconds mode; overrides the Inspector duration when connected
  • AnimationId(String):Shown in Animation mode; overrides the Inspector ID when connected

Outputs

  • Out(Control):Runs after the scheduled wait finishes, or immediately if no wait can be scheduled

Parameters

  • ModeSeconds / Animation):Seconds;Chooses the visible input and wait mechanism
  • Seconds(Float):0.5;Time delay used in Seconds mode
  • Animation Id(String):Empty;Gate reason used in Animation mode

Seconds at 0 or less continues immediately. Animation mode does not inspect an Animator clip or trigger automatically: the presentation layer must already have acquired the matching AnimationGate reason before the node runs. If that reason is not held, execution continues immediately; a held reason resumes when released or after the five-second safety timeout. An empty Animation Id uses Flow Wait as the reason.

Wait node configured for a time delay

Delayed Trigger

Schedules a connected body for a later battle phase, while the current graph continues through Done. Use it for countdown effects that belong to a future turn rather than for a short visual pause.

Inputs

  • In(Control):Attempts to register the delayed body

Outputs

  • Body(Control):Entry point saved for later execution; it does not run during the current pass
  • Done(Control):Continues immediately after scheduling

Parameters

  • Delay Turns(Integer):1;Number of turns before the body is eligible to run
  • Fire At (Tick Phase)PlayerTurnEnd / PlayerTurnStart / EnemyPhaseEnd):PlayerTurnStart;Battle phase that advances and fires the trigger
  • Cancel If Source Dies (Cancel On Source Death)(Boolean):Off;Cancels the pending body if its source unit dies

A delayed body is registered only when Body is connected and Delay Turns is greater than zero. With zero or a negative value, the node still follows Done; it does not run Body immediately.

Delayed Trigger node with delayed Body and immediate Done outputs

Choice

Opens the runtime choice presenter with a collection of units, cards, or statuses, then continues through the selected or skipped path. Use it for decisions the player must make, not for random or automatic selection.

Inputs

  • In(Control):Opens the choice
  • Options(Unit, Card, or Status collection):Candidate list; null entries are omitted and the type follows Kind
  • Count(Integer):Declared by the editor, but the current executor does not read this connection

Outputs

  • OnChosen(Control):Runs after the player confirms a valid selection
  • Skipped(Control):Runs when the player skips, or when no presenter or candidate is available
  • Chosen(Unit, Card, or Status collection):Confirmed selection, with type following Kind

Parameters

  • Kind (internal)Unit / Card / Status):Card before inference;Set automatically from the collection connected to Options; it is not edited directly
  • Prompt(String):Empty;Text shown by the choice presenter
  • Count(Integer):1;Maximum picks used by the current runtime
  • ModeExactly / UpTo):Exactly;Requires the capped count, or allows any count up to it
  • Allow Skip(Boolean):Off;Allows confirming no selection in the presenter

The effective maximum is clamped to the available candidate count and never below one when candidates exist. UpTo with skipping disabled still requires at least one pick. If the presenter is missing or the candidate list is empty, GCS follows Skipped even when Allow Skip is off.

Current Count input

The node exposes a Count data input, but Choice currently reads the Inspector field directly. Set Count on the node until the executor is updated to consume the connected value

Choice node configured to select cards