VARIABLES

From AddictHelp
Jump to navigation Jump to search

Variables appear as a name surrounded by '%'s, such as

%actor%

Before a command is processed, the line is scanned and any variables are replaced. First the list of local variables are checked to see if it is there. If not, the global variables are checked. If a match is still not found, a list of 'built in' variables (ones not declared by the script) are checked. If no match is found, the variable is replaced with an empty string (the variable is removed from the line, and nothing added in its place).

Two '%'s in a row will be interpreted as a single '%'.

There are two types of variables, local and global. All local variables are deleted when a script finishes executing, and can only be used by the script. Global variables remain until removed with unset, or the script is removed.

A field of a variable can also retrieved, based on their type. To get a field, a notation of %variable.field% is used. The valid fields for each type of game object are listed below.

Variables are case insensitive.

See also: CHARACTER VARIABLES, ROOM VARIABLES, OBJECT VARIABLES, SPECIAL VARIABLES