List Variables are similar to Local Variables in that their scope is limited to the scene they are at. Instead of accessing the Variables by name, you can access them by index.
Items can be inserted and removed at any position. They are very useful when you want to stack a bunch of game objects (or any supported data) and do something with them, without having to worry about how many elements you have stored.
There are multiple ways of accessing and storing data in List Variables and it's a bit more abstract than with Global or Local Variables.
A List Variables can be visualized as a list of items placed one after the other. Each element can be accessed via its index value, starting from 0 and increasing in one unit for each subsequent element.
Game Creator allows accessing the contents of a List Variable through the use of the following shortcuts:
Accesses an element via its index. If the index is negative or overshoots the number of elements in the list, it will return null.
Accesses the first element in the List Variables. If there are no elements, it will return null.
Accesses the last element of the List Variables. If there are no elements, it will return null.
Accesses a random element of the List Variables. If there are no elements, it will return null.
Accesses the current value of the iterator, or null if there are no elements. More information about the Iterator here.
Accesses the previous value of the iterator. If the iterator is the first element, the previous element will be the last one. if there are no elements, it will return null.
Accesses the next value of the iterator. If the iterator is the last element, the next value will return the first element. If there are no values, it will return null.
Storing information in List Variables work very similarly as accessing its content. The only difference is that there's a value that is going to be added.
The iterator is an advanced feature of List Variables. It's an internal index that is updated every time the List Variable is accessed or modified.
So it basically remembers the last accessed or modified element. This is very useful when iterating over elements. You can access the First element and subsequently ask for the Next element, allowing you to iterate all elements of the List Variable.