Skip to main content

Operator Nodes

GCS · Built-In Node Library

Transform values and collections without changing battle state.

Operator nodes calculate data. Feed them with Get nodes or previous outputs, then connect the result to the node that needs the calculated value or narrowed collection.

Operator nodes calculate data. Feed them with Get nodes or previous outputs, then connect the result to the node that needs the calculated value or narrowed collection.


Node Usage

Math Binary

Combines two numeric values with arithmetic, minimum/maximum, or exponentiation. Use it to calculate a value before feeding an Action, Hook write, comparison, or another operator.

Inputs

  • A(Integer or Float):Left operand; falls back to the A field
  • B(Integer or Float):Right operand; falls back to the B field

Outputs

  • Result(Integer or Float):Calculated value; its type follows Kind

Parameters

  • Number Type (Kind)Int / Float):Int;Sets both input and result types
  • A(Number):0;Inspector fallback for A
  • B(Number):0;Inspector fallback for B
  • Operation (Op)Add, Sub, Mul, Div, Mod, Min, Max, Pow):Add;Operation applied to A and B

Division or modulo by zero returns 0. Integer division truncates its remainder, and integer Pow rounds the floating-point power result back to an integer.

Math Binary node configured for integer addition

Math Unary

Transforms one number. Use it for signs, absolute values, square roots, or rounding without creating a second operand.

Inputs

  • A(Integer or Float):Value to transform; falls back to the A field

Outputs

  • Result(Integer or Float):Int mode always returns Integer; Float mode returns Integer for Sign, Floor, Ceil, and Round, otherwise Float

Parameters

  • Number Type (Kind)Int / Float):Int;Sets the numeric mode
  • A(Number):0;Inspector fallback for the input
  • Operation (Op)Neg, Abs, Sign, Sqrt, Floor, Ceil, Round):Neg;Transformation to apply

Sqrt clamps negative values to zero before calculating. In Int mode, Floor, Ceil, and Round leave the already-integer input unchanged; in Float mode Sign, Floor, Ceil, and Round expose an Integer result port.

Math Unary node configured for negation

Clamp

Restricts a number to an inclusive range. Use it to keep costs, percentages, scaling values, or hook results inside an allowed minimum and maximum.

Inputs

  • Value(Integer or Float):Number to restrict
  • Min(Integer or Float):Inclusive lower bound
  • Max(Integer or Float):Inclusive upper bound

Outputs

  • Result(Integer or Float):Clamped value; its type follows Kind

Parameters

  • Number Type (Kind)Int / Float):Int;Sets all port types
  • Value(Number):0;Inspector fallback for Value
  • Min(Number):0;Inspector fallback for Min
  • Max(Number):1;Inspector fallback for Max

Connect dynamic bounds when another effect controls the allowed range; otherwise the three Inspector values are enough.

Set Min less than or equal to Max. The node passes the values directly to Mathf.Clamp and does not swap or normalize reversed bounds.

Clamp node with Value, Min, and Max inputs

Condition

Compares two values and returns a boolean. Feed Result to Branch, Gate, Select, or a hook rule.

Inputs

  • A(Any):Left value
  • B(Any):Right value

Outputs

  • Result(Boolean):Result of the selected comparison

Parameters

  • Operation (Op)> (Greater), (GreaterEqual), < (Less), (LessEqual), = (Equal), (NotEqual), (In)):=;Comparison rule as it appears in the editor

Numeric comparisons accept integers, floats, booleans (false = 0, true = 1), and numeric text; text that cannot be parsed compares as 0. Numeric equality uses Mathf.Approximately, while strings compare exactly and case-sensitively. If either side is null, both sides are compared as text, making null equal to an empty string; two unconnected inputs therefore produce true for Equal. Other values use normal value equality. In converts each side to a list of strings and returns true when the lists share at least one exact item; comma- or semicolon-separated text is split into items, and two empty lists do not overlap.

Condition node configured for equality

Logic

Combines or negates boolean values. Use it when a branch depends on several conditions, such as “target is alive and HP is below 50%.”

Inputs

  • A(Boolean):First operand; falls back to the A field
  • B(Boolean):Second operand for And, Or, and Xor; hidden for Not

Outputs

  • Result(Boolean):Combined or inverted result

Parameters

  • A(Boolean):Off;Inspector fallback for A
  • B(Boolean):Off;Inspector fallback for B when used
  • Operation (Op)And, Or, Xor, Not):And;Boolean operation; Not reads only A

Xor is true only when exactly one input is true.

Logic node configured for And

Ref Equal

Checks whether two ports point to the exact same runtime object. Use it for questions such as “is this collection element the card that triggered the hook?”

Inputs

  • A(Any reference):First object reference
  • B(Any reference):Second object reference

Outputs

  • Result(Boolean):Identity comparison result

Parameters

  • Operation (Op)Equal / NotEqual):Equal;Returns identity equality or its inverse

This node does not compare names, IDs, field values, tags, or collection contents. Use Condition for value comparisons.

When both inputs are unconnected they are both null, so Equal returns true and NotEqual returns false.

Ref Equal node with two reference inputs

Select

Returns one of two values without splitting control flow. Use it when only the data changes and both outcomes feed the same downstream node.

Inputs

  • Condition(Boolean):Chooses IfTrue when true, otherwise IfFalse
  • IfTrue(Selected kind):Value returned for true
  • IfFalse(Selected kind):Value returned for false

Outputs

  • Result(Selected kind):Chosen input value

Parameters

  • Value Type (Kind)Int, Float, Bool, String, Unit, Card, Status):Int;Sets both candidate ports and the result type

Use Branch instead if the two outcomes need different actions or presentation paths.

An unconnected Condition is false. If the selected candidate input is unconnected, Result is null.

Select node configured for integer values

Constant

Provides a fixed scalar or a database-backed text choice. It is useful when the same literal feeds several nodes or when you want a visible, reusable label in the graph.

Inputs: none

Outputs

  • Value(Integer, Float, Boolean, String, or String list):Fixed result selected by Kind; a database Tags/Keywords field returns a string list through an Any port, never an asset reference

Parameters

  • Value Type (Kind)Int, Float, Bool, String, Card, Status, Player, Enemy):Int;Chooses the visible value editor and output contract
  • Int Value(Integer):0;Used only for Int
  • Float Value(Float):0;Used only for Float
  • Bool Value(Boolean):Off;Used only for Bool
  • String Value(String):Empty;Used for String and single-value database fields
  • Field(Database field):Empty;For Card, Status, Player, or Enemy, selects a field such as Type, Rarity, Tier, Tags, or Keywords
  • String Values(String list):Empty;Used when the chosen database field is multi-value, currently Tags or Keywords

Card, Status, Player, and Enemy modes expose editor dropdowns, but the runtime result is the selected string or string list—not a CardRef, StatusRef, or unit reference. Use a Get node when an action needs the actual runtime object.

Constant node configured with an integer value

Convert

Converts a scalar to an integer, float, boolean, or string. Use it only at a real type boundary; keeping ports in their native type makes a graph easier to read.

Inputs

  • A(Any scalar):Value to convert

Outputs

  • Result(Integer, Float, Boolean, or String):Converted value; type follows To

Parameters

  • To Type (To)Int, Float, Bool, String):Float;Target type

Float-to-integer conversion rounds to the nearest integer. Invalid numeric text becomes 0; booleans become 0 or 1. A string is true when it is non-empty, numeric values are true when non-zero, and unsupported object types convert to the target type's empty value.

Convert node configured to produce a float

Random

Generates a random integer, float, or boolean. Use it for chance-based values or feed the boolean result into a Branch.

Inputs

  • Min(Integer or Float):Shown for Int and Float; lower range bound
  • Max(Integer or Float):Shown for Int and Float; upper range bound
  • Probability(Float):Shown for Bool; chance of returning true

Outputs

  • Result(Integer, Float, or Boolean):Random result; type follows Kind

Parameters

  • Roll Type (Kind)Int, Float, Bool):Int;Chooses range or probability mode
  • Min(Number):0;Range fallback for Int and Float
  • Max(Number):1;Range fallback for Int and Float
  • Probability(Float):0.5;Boolean chance, normally expressed from 0 to 1

Use Random Elements when the result should be one or more items from a collection rather than a scalar.

Both numeric range ends are included. In Bool mode, values at or below 0 are always false and values above 1 are always true.

Random node configured for an integer range

Count

Returns the number of items in a unit, card, or status collection. Use it for hand-size checks, scaling, or a comparison that depends on how many targets remain.

Inputs

  • Collection(Unit, Card, or Status collection):Collection to count; type follows Kind

Outputs

  • Result(Integer):Item count; null collections return 0

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from the connected collection type; not shown as an editable parameter

The node returns the collection's stored length, so null elements inside a non-null collection still count.

Count node configured for a unit collection

Is Empty

Checks whether a collection contains no items. It is clearer than comparing Count with zero when emptiness is the only question.

Inputs

  • Collection(Unit, Card, or Status collection):Collection to inspect; type follows Kind

Outputs

  • Result(Boolean):True for null or zero-item collections

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from the connected collection type; not shown as an editable parameter

A collection containing one null element is not empty; only the collection reference and its item count are checked.

Is Empty node configured for a unit collection

Contains

Checks whether a collection contains one exact runtime object. Use it to test membership after a selector or choice.

Inputs

  • Collection(Unit, Card, or Status collection):Collection to search
  • Value(Unit, Card, or Status reference):Object to find; type follows Kind

Outputs

  • Result(Boolean):True only when the same object reference occurs in the collection

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; also changes the Value reference type

This is an identity test, not an asset-name, GUID, tag, or value comparison. A null collection or null Value returns false.

Contains node with collection and value inputs

Filter

Keeps only the units, cards, or statuses that meet the selected criteria. Use it between a broad Get node and a target, collection action, sort, or pick operation.

Inputs

  • Collection(Unit, Card, or Status collection):Source collection; type follows Kind

Outputs

  • Result(Unit, Card, or Status collection):New collection containing matching non-null items, in source order

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the visible inline criteria and result type
  • Filter By (By Unit)(Multi-select: Team, Tags, Tier, HasStatus, HPBelow, HPAbove, Alive):Alive;Unit criteria shown after a Unit collection is connected
  • Filter By (By Card)(Multi-select: Type, Rarity, Keywords, Tags, CostBelow, CostAbove):Type;Card criteria shown after a Card collection is connected
  • Filter By (By Status)(Multi-select: Type, Tags):Type;Status criteria shown after a Status collection is connected
  • Status (Status Id)(Status identifier):None;Required by unit HasStatus
  • TeamPlayer / Enemy):None;Required by unit Team
  • Tier(Enemy tier):None;Required by unit Tier; player units do not match
  • Keyword(Card keyword):None;Required by card Keywords
  • Tags(String list):Empty;Used by unit, card, or status Tags
  • Type(Card type):None;Required by card Type
  • Rarity(Card rarity):None;Required by card Rarity
  • Status TypeBuff / Debuff):Buff;Used by status Type
  • Cost(Integer):0;Threshold for card cost criteria
  • HP% (Percent)(Float):50;HP percentage threshold for unit HP criteria

All selected criteria are combined with AND. Within the Tags list, one exact shared tag is enough. HPBelow and HPAbove are strict comparisons; CostBelow means effective cost ≤ threshold, while CostAbove means effective cost ≥ threshold. An empty criterion list keeps every valid item, but a required text field left empty makes that criterion fail.

Only Collection is a data socket. Status Id, Team, Percent, Cost, and the other criteria are edited inline on this node and cannot currently be wired from another node.

Filter node configured for alive units

Sort

Returns a reordered copy of a collection. Use it before Pick Element or Take to select lowest-HP units, highest-cost cards, or statuses by stack count.

Inputs

  • Collection(Unit, Card, or Status collection):Items to copy and sort; type follows Kind

Outputs

  • Result(Unit, Card, or Status collection):Sorted copy; the original collection is not modified

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the visible sort field and result type
  • Sort By (By Unit)HP / Armor):HP;Unit sort key
  • Sort By (By Card)Cost):Cost;Uses effective energy cost
  • Sort By (By Status)Stacks):Stacks;Uses the current graph host's stack count for each status definition
  • OrderAscending / Descending):Ascending;Sort direction

For status collections, stack counts are looked up on the current host. The node does not accept a separate target unit for that lookup.

Null elements are retained and compare with a sort value of 0.

Sort node configured by unit HP in ascending order

Pick Element

Returns one item from a collection. Pair it with Sort for lowest/highest selection, or use AtIndex for a position you already calculated.

Inputs

  • Collection(Unit, Card, or Status collection):Collection to read
  • Index(Integer):Shown only for AtIndex; zero-based and falls back to the Index field

Outputs

  • Element(Unit, Card, or Status reference):Selected item, or null when the collection is empty, the index is outside its bounds, or the selected slot itself contains null

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the element result type
  • Pick By (By)First / Last / AtIndex):First;Selection rule
  • Index(Integer):0;Inspector fallback used only by AtIndex

Pick Element node configured to pick the first item

Take

Copies up to a requested number of items from the start or end of a collection. It preserves the selected items' original order.

Inputs

  • Collection(Unit, Card, or Status collection):Source collection
  • Count(Integer):Maximum items to keep; falls back to the Count field

Outputs

  • Result(Unit, Card, or Status collection):New collection with the selected range

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the result collection type
  • Count(Integer):1;Inspector fallback for requested item count
  • FromTop / Bottom):Top;Reads from the start or end of the collection

A count larger than the collection returns all items. A zero or negative count returns an empty collection.

Null elements inside the selected range are preserved.

Take node configured to take from the top

Exclude

Removes every item found in a second collection. Use it for shapes such as “all enemies except the primary target.”

Inputs

  • Collection(Unit, Card, or Status collection):Source items
  • Exclude(Matching collection type):Items to remove

Outputs

  • Result(Unit, Card, or Status collection):New collection with exclusions removed; source order is preserved

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; applies to both collection inputs and the result

Membership uses runtime object identity. Null items are omitted from the result, a null source collection returns an empty collection, and a null exclusion collection removes nothing.

Exclude node with source and exclusion collections

Merge Collections

Concatenates two collections. Use it when one downstream action should receive targets assembled from two sources.

Inputs

  • A(Unit, Card, or Status collection):Items placed first
  • B(Matching collection type):Items appended after A

Outputs

  • Result(Unit, Card, or Status collection):New concatenated collection

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from the first collection input connection; applies to both inputs and the result

Duplicates are preserved. If the same object appears in both inputs, it also appears twice in Result.

A null input collection is treated as empty; null elements already stored inside either collection are preserved.

Merge Collections node with A and B inputs

Make Collection

Builds a collection from individually connected references. Use it when the graph has a small, explicit set of targets rather than an existing collection.

Inputs

  • Slot0SlotN(Unit, Card, or Status reference):One item per visible slot; null inputs are skipped

Outputs

  • Result(Unit, Card, or Status collection):New collection in slot order

Parameters

  • Element Type (Kind)Unit / Card / Status):Unit;User-editable selector shown because this node has no source collection from which to infer the type
  • Slots (Slot Count)(Integer):2;Number of generated slot ports

Changing Slot Count rebuilds the dynamic inputs. Existing non-null items retain slot order; repeated references are allowed.

Runtime clamps Slot Count to at least 1.

Make Collection node with three unit slots

Random Elements

Selects random list positions from a collection without reusing the same position. Use it for a random subset of the supplied collection.

Inputs

  • Collection(Unit, Card, or Status collection):Candidate pool
  • Count(Integer):Requested number of results; falls back to the Count field

Outputs

  • Result(Unit, Card, or Status collection):Random subset, in pick order

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the result collection type
  • Count(Integer):1;Inspector fallback for requested picks

The result count is capped to the pool size. A null or empty collection, or a count of zero or less, returns an empty collection.

Null elements in a non-empty source remain candidates and can therefore appear as null entries in the result.

If the source contains the same object reference in more than one position, those positions are separate candidates and the same object can appear more than once in Result.

Random Elements node configured to pick one unit

Shuffle

Returns a randomly reordered copy of a collection. It does not mutate a battle pile or the source list.

Inputs

  • Collection(Unit, Card, or Status collection):Items to copy and reorder

Outputs

  • Result(Unit, Card, or Status collection):Shuffled copy; null input produces an empty collection

Parameters

  • Kind (internal)Unit / Card / Status):Unit before inference;Set automatically from Collection; changes the result collection type

To shuffle the actual draw pile and send its battle event, use the Shuffle Draw Pile Action instead.

Null elements in the input are preserved and shuffled with the other items.

Shuffle node configured for a unit collection