Variables overview popularité : 89
Global Variables popularité : 91
Local Variables popularité : 91
List Variables popularité : 92
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
Slide 10
IMAGE OR CARROUSEL for section header You successfully read this important alert message.

TEXTE AVANT FILTRAGE
(List Variables example with 3 elements)
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.

For example, you can have a SIM game where your village has multiple characters doing chores around the town.

Each of these villagers could be assigned a position inside a List Variable called "citizens".

This List Variable could be used to query information such as getting the citizen that is nearest to the forest and start collecting wood, and giving birth to new citizens would be as easy as adding a new Game Object at the end of the "citizens" List Variable.

Managing List Variables

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.

Accessing List 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.

(Concept of List Variables indexed from left to right)
Game Creator allows accessing the contents of a List Variable through the use of the following shortcuts:

Index

Accesses an element via its index. If the index is negative or overshoots the number of elements in the list, it will return null.

First

Accesses the first element in the List Variables. If there are no elements, it will return null.

Last

Accesses the last element of the List Variables. If there are no elements, it will return null.

Random

TEXTE APRES FILTRAGE
-  : liste tous les intertitres de l’article
-  : liste tous les documents de l’article sous forme de mini-vignette non cliquables. Avec deux paramètres :

width : largeur de la vignette en px,
raz : nombre de vignette sur une seule ligne. Juste après la Nième(raz) vignette, un
est inséré.

>