User Tools

Site Tools


array

This is an old revision of the document!


Array


An array is a scripting data type consisting of a collection or list of values. You can iterate through the values in an array using a “For” loop, or check if an array contains a certain value using the “contains” operator in a conditional expression.

Examples:

array["ITEM_0001", "ITEM_0005", "ITEM_0008"]

User-defined list of item IDs (e.g. from which to randomly pick an item for the player).

group["room_01"]

List of all entities in the current map that belong to the group named “room_01”. The values in this kind of array are of data type Entity.

entity["xyz"].groups

List of all group names to which the entity belongs, as assigned in the Map Editor. The values in this kind of array are of data type String.

entity["xyz"].tags

List of all tags for the entity's model, as assigned in the Voxel Editor. The values in this kind of array are of data type String.

range(5)

List of integers from 0 to, but not including, 5 (i.e. 0, 1, 2, 3, 4).

range(12, 15)

List of integers from 12 to, but not including, 15 (i.e. 12, 13, 14).

range(0, 9, 2)

List of integers from 0 to, but not including, 9, with an increment of 2 (i.e. 0, 2, 4, 6, 8).

range(5, 0, -1)

List of integers from 5 to, but not including, 0, with an increment of -1 (i.e. 5, 4, 3, 2, 1).

array.1581916141.txt.gz · Last modified: 2020/02/16 21:09 by justin