Skip to content

Array tools

A collection of utilities and tools for working with arrays.

Authors and contributors to this community extension: arthuro555.


This extension adds features like:

  • Combining arrays (concatenate into new array, append all children to another array)
  • Finding a value in an array (find index expression, contains condition)
  • Reversing arrays
  • Get a portion of an array (slice)
  • Add and remove lots of children at specific indices at once (fill, splice, shift, pop, add at index)
  • Randomness (shuffle children, get a random child)
  • Mathematical operations using arrays (sum of all numbers, biggest/smallest number, average number, median number)
  • Sort numbers in an array
  • String inter-operation (split string into array, join array array children to string)

Breaking changes from 3.0.0

  • Variables have to be declared

Tip

Learn how to install new extensions by following a step-by-step guide.

Actions

Append all variable to another array
Appends a copy of all variables of one array to another array.

Combine 2 arrays
Combines all elements of 2 scene arrays into one new scene array.

Fill array with number
Fill an element with a number.

Flatten array
Replaces all arrays inside of an array with their children. For example, [[1,2], [3,4]] becomes [1,2,3,4].

Insert variable at
Insert a variable at a specific index of an array.

Append all variable to another array
Appends a copy of all variables of one array to another array.

Combine 2 arrays
Combines all elements of 2 scene arrays into one new scene array.

Fill array with number
Fill an element with a number.

Flatten array
Replaces all arrays inside of an array with their children. For example, [[1,2], [3,4]] becomes [1,2,3,4].

Insert variable at
Insert a variable at a specific index of an array.

Pop array child
Removes the last array child of an array, and stores it in another variable.

Reverse an array
Reverses children of an array. The first array child becomes the last, and the last array child becomes the first.

Shift array child
Removes the first array child of an array, and stores it in another variable.

Shuffle array
Shuffles all children of an array.

Slice an array
Copies a portion of a scene array variable into a new scene array variable.

Sort an array
Sort an array of number from smallest to biggest.

Splice an array
Cuts a portion of an array off.

Split string into array
Split a string into an array of strings via a separator.

Pop array child
Removes the last array child of an array, and stores it in another variable.

Reverse an array
Reverses children of an array. The first array child becomes the last, and the last array child becomes the first.

Shift array child
Removes the first array child of an array, and stores it in another variable.

Shuffle array
Shuffles all children of an array.

Slice an array
Copies a portion of a scene array variable into a new scene array variable.

Sort an array
Sort an array of number from smallest to biggest.

Splice an array
Cuts a portion of an array off.

Split string into array
Split a string into an array of strings via a separator.

Conditions

Array has number
Checks if an array contains a specific number.

Array has string
Checks if an array contains a specific string.

Index of number
Compare The index of the first variable that equals to a specific number in an array.

Index of text
Compare The index of the first variable that equals to a specific text in an array.

Last index of number
Compare The index of the last variable that equals to a specific number in an array.

Last index of text
Compare The index of the last variable that equals to a specific text in an array.

Array has number
Checks if an array contains a specific number.

Array has string
Checks if an array contains a specific string.

Index of number
Compare The index of the first variable that equals to a specific number in an array.

Index of text
Compare The index of the first variable that equals to a specific text in an array.

Last index of number
Compare The index of the last variable that equals to a specific number in an array.

Last index of text
Compare The index of the last variable that equals to a specific text in an array.

Get and remove last variable from array (as number)
Compare Removes the last array child of an array, and return it as a number.

Random number in array
Compare Returns a random number of an array of numbers.

Random string in array
Compare a random string of an array of strings.

Get and remove last variable from array (as number)
Compare Removes the last array child of an array, and return it as a number.

Random number in array
Compare Returns a random number of an array of numbers.

Random string in array
Compare a random string of an array of strings.

Expressions

Expression Description
ArrayTools::IndexOf(variable, number) Return The index of the first variable that equals to a specific number in an array.
🗄️ Any variable Array to search the value in
🔢 Number Number to search in the array
ArrayTools::IndexOfStr(variable, string) Return The index of the first variable that equals to a specific text in an array.
🗄️ Any variable Array to search the value in
string String to search in the array
ArrayTools::Join(variable, string) Returns a string made from all strings in an array.
🗄️ Any variable The name of the array to join into a string
string Optional separator text between each element
ArrayTools::LastIndexOf(variable, number) Return The index of the last variable that equals to a specific number in an array.
🗄️ Any variable Array to search the value in
🔢 Number Number to search in the array
ArrayTools::LastIndexOfStr(variable, string) Return The index of the last variable that equals to a specific text in an array.
🗄️ Any variable Array to search the value in
string String to search in the array
ArrayTools::Max(variable) Gets the biggest number in an array.
🗄️ Any variable The array
ArrayTools::Mean(variable) Gets the average number in an array.
🗄️ Any variable The array
ArrayTools::Median(variable) Gets the median number in an array.
🗄️ Any variable The array
ArrayTools::Min(variable) Gets the smallest number in an array.
🗄️ Any variable The array
ArrayTools::ObjectIndexOf(object, object variable, number) Return The index of the first variable that equals to a specific number in an array.
👾 Object The object the variable is from
🗄️ Object variable Array to search the value in
🔢 Number Number to search in the array
ArrayTools::ObjectIndexOfStr(object, object variable, string) Return The index of the first variable that equals to a specific text in an array.
👾 Object The object the variable is from
🗄️ Object variable Array to search the value in
string String to search in the array
ArrayTools::ObjectJoin(object, object variable, string) Returns a string made from all strings in an array.
👾 Object The object the variable is from
🗄️ Object variable The name of the array to join into a string
string Optional separator text between each element
ArrayTools::ObjectLastIndexOf(object, object variable, number) Return The index of the last variable that equals to a specific number in an array.
👾 Object The object the variable is from
🗄️ Object variable Array to search the value in
🔢 Number Number to search in the array
ArrayTools::ObjectLastIndexOfStr(object, object variable, string) Return The index of the last variable that equals to a specific text in an array.
👾 Object The object the variable is from
🗄️ Object variable Array to search the value in
string String to search in the array
ArrayTools::ObjectMax(object, object variable) Gets the biggest number in an array.
👾 Object The object the variable is from
🗄️ Object variable The array
ArrayTools::ObjectMean(object, object variable) Gets the average number in an array.
👾 Object The object the variable is from
🗄️ Object variable The array
ArrayTools::ObjectMedian(object, object variable) Gets the median number in an array.
👾 Object The object the variable is from
🗄️ Object variable The array
ArrayTools::ObjectMin(object, object variable) Gets the smallest number in an array.
👾 Object The object the variable is from
🗄️ Object variable The array
ArrayTools::ObjectPopNumber(object, object variable) Return Removes the last array child of an array, and return it as a number.
👾 Object The object the variable is from
🗄️ Object variable Array to pop a child from
ArrayTools::ObjectPopString(object, object variable) Removes the last array child of an array, and return it as a string.
👾 Object The object the variable is from
🗄️ Object variable Array to pop a child from
ArrayTools::ObjectRandomNumberInArray(object, object variable) Return Returns a random number of an array of numbers.
👾 Object The object the variable is from
🗄️ Object variable Array to get a number from
ArrayTools::ObjectRandomStringInArray(object, object variable) Return a random string of an array of strings.
👾 Object The object the variable is from
🗄️ Object variable Array to get a string from
ArrayTools::ObjectShiftNumber(object, object variable) Removes the first array child of an array, and return it as a number.
👾 Object The object the variable is from
🗄️ Object variable Array to shift a child from
ArrayTools::ObjectShiftString(object, object variable) Removes the first array child of an array, and return it as a string.
👾 Object The object the variable is from
🗄️ Object variable Array to shift a child from
ArrayTools::ObjectSum(object, object variable) Get the sum of all numbers in an array.
👾 Object The object the variable is from
🗄️ Object variable The array
ArrayTools::PopNumber(variable) Return Removes the last array child of an array, and return it as a number.
🗄️ Any variable Array to pop a child from
ArrayTools::PopString(variable) Removes the last array child of an array, and return it as a string.
🗄️ Any variable Array to pop a child from
ArrayTools::RandomNumberInArray(variable) Return Returns a random number of an array of numbers.
🗄️ Any variable Array to get a number from
ArrayTools::RandomStringInArray(variable) Return a random string of an array of strings.
🗄️ Any variable Array to get a string from
ArrayTools::ShiftNumber(variable) Removes the first array child of an array, and return it as a number.
🗄️ Any variable Array to shift a child from
ArrayTools::ShiftString(variable) Removes the first array child of an array, and return it as a string.
🗄️ Any variable Array to shift a child from
ArrayTools::Sum(variable) Get the sum of all numbers in an array.
🗄️ Any variable The array

This page is an auto-generated reference page about the Array tools extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.