The List node holds elements in a specific order. A list can store numbers, vectors, objects or data structures. The size of a list is dynamic, which means it can be changed during gameplay.
📢 Note: It is recommended to use the List Value Inspector node for reading data from a list. This way you don't have to create unnecessary execute links to a list, and you won't e.g. accidentally change the index of the list, push values from the list's outputs, or fire any outgoing executing links. If you need to do batch operations to lists, check out the List Processor node.
Input | Explanation |
---|---|
Add Value / Vector / Object | Add an element to the index of the List |
Operation | Execute an operation of the List through a link. Remove First / Remove Last / Remove All / Shuffle / Reverse. |
Parameter | Explanation | |
---|---|---|
Edit Intial Values | Set what objects or data are in the list when the game starts | |
Execute | Executes the node | |
↳ On Start | Executes the node at the start of the game | |
Enabled | Enable or disable the node. Disabled Nodes cannot be executed | |
Allow Duplicates | Determines if the list allows duplicate values | |
List Type | Determines if the list is one- or two-dimensional. A two-dimentional List is essentially a list of lists and adds the "Index Y” and “Width” options. |
|
Element Type | Select what type of elements can be stored in the List. Options are: numbers, vectors, objects or data structures. | |
Add New Elements To | Position to which new elements are added to. Beginning: New elements are added to the start of the list End: New elements are added to the end of the list Index: New elements are added to the current index of the list |
|
Max Size | Maximum amount of elements in the List | |
Index | Set the Index of the list with a link from an other node. By default, shows the starting Index of the list. Once the Index of the list is set, you can pull the value stored in that index using the Get Value at Index output | |
Run Action | Runs certain action when executed through this link. See below for details |
|
Seed | Set a seed to use when running the “Shuffle” action | |
Execute Get Value at Index | Input an index value to fetch an entry on the List | |
↳ Get Value at Index (output) | Outputs whatever the List is storing in the Input Index. Note: if the element type is set to Object and there is currently no object stored in the index, this output will not put out anything via a push link (grey) or execute link (red). | |
Execute Get Last Index | Executes Get Last Index output | |
↳ Execute Get Last Index (output) | Outputs the index value of the last item on the list (list length) | |
Execute For Each Value | Execute For Each Value output | |
↳ Execute For Each Value (output) | Executes the link as many times as there are values in the list. | |
Contains | Input for checking if the list contains a certain value. | |
↳ Output | Sends out True (1) if the List contains the value that was sent to the Contains input. Sends out False (0) if the value is not in the List. |
Action | Explanation |
---|---|
Remove First | Remove the first item on the list |
Remove Last | Remove the last item on the list |
Remove All | Remove all objects from the list |
Shuffle | Randomize the order of the list |
Reverse | Reverse the order of the list |
Remove Index | Remove the set index. This shifts all items in the list. |
Swapout Index | Replace the item at the set Index with last item in the list |
Insert Index | Insert an item at the set Index |
Sort | Sort the list. Uses Distance Pivot if list type is Vector or Object. |
Clear Index | Clear the set index. The value at index will be set to 0 keeping all other list items on their old indexes. |
Set All Values to Indexed | Sets all values to the value at set index |
Fill From Index | Fills the list from the set index to max size |
Fill Ascending From Index | Fills the list from set index to first index |
Remove Destroyed Objects | Remove items from the list that have been destroyed from the game world |
Here's a link to the hype that shows how to implement and use the List node: