Difference between revisions of "Variables"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(Created page with "There are two types of variables in ADRIFT. These are Numeric (Integer) and Text. Both variable types can also be created as arrays (a set of variable values which can be acces...")
 
(system variables)
Line 1: Line 1:
 
There are two types of variables in ADRIFT.  These are Numeric (Integer) and Text.  Both variable types can also be created as arrays (a set of variable values which can be accessed by a unique index).
 
There are two types of variables in ADRIFT.  These are Numeric (Integer) and Text.  Both variable types can also be created as arrays (a set of variable values which can be accessed by a unique index).
 +
 +
Variables can be compared with other values in [[Restrictions]], and altered using [[Actions]].
 +
 +
[[Properties]] and [[Tasks#References|references]] can also be used in a similar way to variables.
 +
 +
== System Variables ==
 +
Certain variable names have been reserved for System variables.
 +
These can be used in any text box to display the indicated value.
 +
Of these only 'Score' can be written to, the others are constants.
 +
* %Score% - This variable is where you keep track of the players score in the game. It can be altered using [[Actions]] or used in [[Restrictions]]. It has a hidden 'run once' functionality built in to it which prevents a particular task from incrementing its value more than once.
 +
* %Turns% - The number of turns elapsed for the game.
 +
* %Version% - Returns the version of the current Runner executable.
 +
 +
Note: As of version 5.00.21 it is not possible to test Turns or Version in a restriction.

Revision as of 06:37, 15 October 2011

There are two types of variables in ADRIFT. These are Numeric (Integer) and Text. Both variable types can also be created as arrays (a set of variable values which can be accessed by a unique index).

Variables can be compared with other values in Restrictions, and altered using Actions.

Properties and references can also be used in a similar way to variables.

System Variables

Certain variable names have been reserved for System variables. These can be used in any text box to display the indicated value. Of these only 'Score' can be written to, the others are constants.

  •  %Score% - This variable is where you keep track of the players score in the game. It can be altered using Actions or used in Restrictions. It has a hidden 'run once' functionality built in to it which prevents a particular task from incrementing its value more than once.
  •  %Turns% - The number of turns elapsed for the game.
  •  %Version% - Returns the version of the current Runner executable.

Note: As of version 5.00.21 it is not possible to test Turns or Version in a restriction.