Novelty scripting reference > Global and internal variables
Global variables

Global variables is a way for you to store arbitrary variables globally in your game. They are useful for everything from tracking events in your game to keeping score.

Global variables are of type Variant and they are stored in saved games.

To create a global variable use dollar sign ($) followed by the name of the variable.

$MyGlobalVariable = 1;

Internal variables

Internal variables work in a similar way as their global counterparts but can be stored in individual objects. You can only retrieve an internal variable in a scripts and if the handle of the object is known. The recommended use for them is in scripted behaviours, for tracking internal parameters.

Internal variables are of type Variant and they are not stored in saved games.

To create an internal variable, type the object handle then dot-dollar sign (.$) followed by the name of the variable.

Object@ obj = GetObject("Item");
obj.$MyInternalVariable = 1;

Back to index