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 the variable
is there. If not, the global variables are checked. A proper global match must
have a zero context or the current context of the trigger. (When a trigger starts
running, its context is 0. The trigger context command may be used to change
context.) If a match is still not found, a list of 'built in' variables (ones
not declared by the trigger) 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).
There are two types of variables, local and global. All local variables are
deleted when a trigger finishes executing, and can only be used by the trigger.
Global variables remain until removed with unset, the MUD is rebooted, or the
trigger is removed.
Global variables also have a context associated with them. By default, the
context is 0. Any global being referenced with a context of zero will be seen.
Through the 'context <value>' command, a trigger may set its context to any
integer; Globals created are always assigned the current trigger context. When a
global is referenced, if its context is not 0 or the current context of the
trigger, it will not be seen. This technique allows, among other things, arrays
of globals to be created by using a series of contexts as indexes. Also, it
allows globals to be associated with a specific character, room, or object in
the game, by using the id of the target as the context.
Variable Fields
A field of a variable can also be retrieved, based on their type. To get a
field, a notation of %variable.field% is used. The valid fields are listed in
the help files below.
CHAR-VAR - Variables for characters. TSTAT 27OBJ-VAR - Variables for objects. TSTAT 28ROOM-VAR - Variables for rooms. TSTAT 29TEXT-VAR - Variables for text. TSTAT 30SPEC-VAR - variables for special stuff. tstat 31
See also:: GLOBAL