Declaring Variables

 

A variable declaration is structured:

	  <access> <type> <name> [ , <name> , … ] ;

<access> is one of public or private. public means that the variable can have a value assigned in the world editor. private means the value is only used within the script and cannot be set in the editor.

<type> is the data type of the variable. There are four default types of variable: INT, BOOL, trigger & event.
INT is a numeric value.
BOOL stores only a TRUE or FALSE value.
trigger stores a reference to a script trigger.
event stores a reference to a script event.
There are also a number of extra user defined types specific to the game.

<name> is the identifier by which the variable is referred to.
If more than one variable of a type is required, additional names separated by commas can be added.