Skip to content

Array actions

23 actions in the Array category. Each block mirrors how the action appears in the editor's sidebar.

Array Add

Every Frame
Array Add Array
Array not set | Value 0

Appends a value to the end of an array.

Input Type Default Description
Array Array - The array to append to. Must be bound to a variable or property.
Value Variant 0 The value to add to the array.

Phases StartEvery FramePhysicsEnd

Array Clear

Every Frame
Array Clear Array
not set

Removes every item from an array, leaving it empty.

Input Type Default Description
Array Array - The array to empty. Must be bound to a variable or property.

Phases StartEvery FramePhysicsEnd

Array Contains

Every Frame
Array Contains Array
Array not set | Value 0 | → True | → False

Answers whether an array holds a given value. It can branch on the answer or hand it to a field that takes a yes or no.

Input Type Default Description
Array Array - The array to search.
Value Variant 0 The value to look for.
Output Type Description
Yes bool Where to store whether the value is in the array.
Branch Goes to
True Where to go when the value is found.
False Where to go when the value is missing.

Phases StartEvery FramePhysics

Array Find

Every Frame
Array Find Array
Array not set | Value 0 | → Found | → Not Found

Finds the position of the first matching item in an array and stores it. Stores -1 when the item is not present.

Input Type Default Description
Array Array - The array to search.
Value Variant 0 The item to look for.
Output Type Description
Index int The position of the item, or -1 when not found.
Branch Goes to
Found Where to go when the item is in the array.
Not Found Where to go when the item is missing, which is when -1 is stored.

Phases StartEvery FramePhysicsEnd

Array Get

Every Frame
Array Get Array
Array not set | Index 0

Reads the item at a given position in an array. An index outside the array fails at runtime.

Input Type Default Description
Array Array - The array to read from.
Index int 0 Position of the item to read, starting at 0.
Output Type Description
Result Variant Where to store the item found at the index.

Phases StartEvery FramePhysicsEnd

Array Get Random

Every Frame
Array Get Random Array
not set

Picks one item at random from an array. An empty array returns null.

Input Type Default Description
Array Array - The array to pick from.
Output Type Description
Result Variant Where to store the randomly picked item.

Phases StartEvery FramePhysicsEnd

Array Insert

Every Frame
Array Insert Array
Array not set | Index 0 | Value 0

Inserts a value at a given position in an array, shifting later items to the right.

Input Type Default Description
Array Array - The array to insert into. Must be bound to a variable or property.
Index int 0 Position where the value is inserted, starting at 0.
Value Variant 0 The value to insert into the array.

Phases StartEvery FramePhysicsEnd

Array Length

Every Frame
Array Length Array
not set

Counts how many items an array holds.

Input Type Default Description
Array Array - The array to measure.
Output Type Description
Length int Where to store the number of items.

Phases StartEvery FramePhysicsEnd

Array Pop

Every Frame
Array Pop Array
Array not set | End 'back' | → Got One | → Empty

Removes and returns the last or first item of an array. An empty array returns null.

Input Type Default Description
Array Array - The array to pop from. Must be bound to a variable or property.
End String 'back' Which end of the array the item is removed from.
Output Type Description
Result Variant Where to store the removed item.
Branch Goes to
Got One Where to go when an item came out of the array.
Empty Where to go when the array had nothing left, which is when null is stored.

Phases StartEvery FramePhysicsEnd

Array Remove

Every Frame
Array Remove Array
Array not set | Value 0

Removes the first item equal to a value from an array. Does nothing when the value is not found.

Input Type Default Description
Array Array - The array to remove from. Must be bound to a variable or property.
Value Variant 0 The value to remove. Only the first match is removed.

Phases StartEvery FramePhysicsEnd

Array Remove At

Every Frame
Array Remove At Array
Array not set | Index 0

Removes the item at a given position in an array. An index outside the array fails at runtime.

Input Type Default Description
Array Array - The array to remove from. Must be bound to a variable or property.
Index int 0 Position of the item to remove, starting at 0.

Phases StartEvery FramePhysicsEnd

Array Reverse

Every Frame
Array Reverse Array
not set

Flips the order of the items in an array in place, so the last becomes the first.

Input Type Default Description
Array Array - The array to reverse. Must be bound to a variable or property.

Phases StartEvery FramePhysicsEnd

Array Set

Every Frame
Array Set Array
Array not set | Index 0 | Value 0

Overwrites the item at a given position in an array. An index outside the array fails at runtime.

Input Type Default Description
Array Array - The array to write into. Must be bound to a variable or property.
Index int 0 Position of the item to overwrite, starting at 0.
Value Variant 0 The value written at the index.

Phases StartEvery FramePhysicsEnd

Array Shuffle

Every Frame
Array Shuffle Array
not set

Randomizes the order of the items in an array.

Input Type Default Description
Array Array - The array to shuffle. Must be bound to a variable or property.

Phases StartEvery FramePhysicsEnd

Array Slice

Every Frame
Array Slice Array
Array not set | From 0 | To 1

Copies a range of an array from one position up to another into a new array. The original array is left untouched.

Input Type Default Description
Array Array - The array to copy from.
From int 0 Position to start at, starting at 0.
To int 1 Position to stop before. Negative counts from the end.
Output Type Description
Result Array Where to store the copied range.

Phases StartEvery FramePhysicsEnd

Array Sort

Every Frame
Array Sort Array
not set

Sorts the items of an array in place, smallest first. Numbers and text sort in their natural order.

Input Type Default Description
Array Array - The array to sort. Must be bound to a variable or property.

Phases StartEvery FramePhysicsEnd

Array Sum

Every Frame
Array Sum Array
not set

Adds up every number in an array and stores the total. An empty array totals zero.

Input Type Default Description
Array Array - The array of numbers to add up.
Output Type Description
Total float Where to store the sum of the numbers.

Phases StartEvery FramePhysicsEnd

Best In List

Every Frame
Best In List Array
List not set | Pick 'lowest' | Near 0.0

Picks one number out of a list: the smallest, the biggest, or the one nearest to a target.

Input Type Default Description
List Array - The list of numbers to choose from.
Pick String 'lowest' Which one to take.
Near float 0.0 The number to be near, used only by nearest.
Output Type Description
Result Variant The chosen number, or null when the list is empty.

Phases StartEvery FramePhysicsEnd

Collect Property

Every Frame
Collect Property Array
List not set | Property 'name'

Reads one property from every item of a list and stores the values as a new list, such as turning a list of nodes into a list of their scores.

Input Type Default Description
List Array - The list to read from.
Property String 'name' The property read from each item, with a colon to reach a part of it, as in position:x.
Output Type Description
Result Array One value per item, in the same order.

Phases StartEvery FramePhysicsEnd

Filter List

Every Frame
Filter List Array
List not set | Property '' | Operator '==' | Value 0 | → Any | → None

Keeps only the items of a list that pass a test, and stores the shorter list. Chaining two of them is how a filter with two conditions is written.

Input Type Default Description
List Array - The list to walk through.
Property String '' The property tested on each item, with a colon to reach a part of it, as in position:y. Leave it empty to test the item itself.
Operator String '==' How the value is compared.
Value Variant 0 What each item is compared against.
Output Type Description
Result Array The items that passed the test.
Branch Goes to
Any Where to go when at least one item passed the test.
None Where to go when no item passed, which is when an empty list is stored.

Phases StartEvery FramePhysicsEnd

Join Lists

Every Frame
Join Lists Array
First not set | Second not set

Puts two lists together into a new one, such as pouring a discard pile back into a deck.

Input Type Default Description
First Array - The list that comes first.
Second Array - The list added after it.
Output Type Description
Result Array The two lists, one after the other.

Phases StartEvery FramePhysicsEnd

Number List

Every Frame
Number List Array
From 0 | To 10 | Step 1

Builds a list of numbers, ready to walk with For Each or to use as indexes.

Input Type Default Description
From int 0 The first number of the list.
To int 10 The number to stop before, so it is never part of the list.
Step int 1 How much to advance between numbers. Negative counts down.
Output Type Description
Result Array The built list of numbers.

Phases StartEvery FramePhysicsEnd

Subtract List

Every Frame
Subtract List Array
List not set | Without not set

Stores the items of a list that are not in a second one, such as the cards of a deck that are not in the hand.

Input Type Default Description
List Array - The list to take items from.
Without Array - The items to leave out.
Output Type Description
Result Array What is left of the first list.

Phases StartEvery FramePhysicsEnd