Variables

From ADRIFT 5 Manual Wiki
Revision as of 08:08, 21 October 2011 by Anonymous (Talk)

Jump to: navigation, search

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.

Displaying Variables

Variables can be displayed in any output text with the following syntax.

Your text here %variable% more text here.

For example, let's say you have a variable that tracks the number of some visible object. If it can change throughout the game, you can use a variable in the description of a room or whatever else to reflect that number.

You see %numberOfDucks% ducks.
You see 4 ducks.

You can also specify for integer values to be displayed as words:

You see %NumberAsText[%numberOfDucks%]% ducks.
You see four ducks.