Level Design / Level Routine Editing / Routine Action Editing / Variable Actions
 
When the Variable Actions item is selected in the Level Routines Window's Actions to Perform column, the following set of controls appears in the panel on the right side of the Level Routines window. These controls are used to configure actions that change the values of variables when the selected routine is performed in the game.


About Variables

Each variable represents a number that can be utilized by certain routine actions. For example, a routine could create a character at a location determined by the variables A and B. If A happened to equal 700 and B equaled 450, then the new character would appear at a horizontal location of 700 and a vertical location of 450.

Besides being used to set the location of new characters, variables may be also be used the set the locations of new contrails, items, and projectiles. Additionally, variables can determine the movement of hot zones, animated scenery, and lighting effects. Moreover, variables are involved in the process of determining whether certain routines are performed in the first place, during the evaluation of Performance Prerequisites.

There are 26 variables in total, represented by the letters A through Z.

Since the values of up to two variables may be changed by a routine, there are two sets of controls for working with variables in the Routines Window. It is also possible to reset every variable to 0.

The Level Routines Window's Variable Action controls are described below:

Change The Value of a Variable Checkbox

Determines whether a new value is assigned to a variable when the selected routine is performed

Variable To Change Pop-Up Menu

Determines which variable will have its value changed when the selected routine is performed

Set Value To Radio Button

Determines whether the variable will be set to a specific number when the selected routine is performed

Increase Value By Radio Button

Determines whether the variable will be increased by a specific number when the selected routine is performed

Multiply Value By Radio Button

Determines whether the variable will be multiplied by a specific number when the selected routine is performed

Divide Value By Radio Button

Determines whether the variable will be divided by a specific number when the selected routine is performed

Object Pop-Up Menu

Determines the source of the number that the variable will be set to, increased by, multiplied by, or divided by when the selected routine is performed. The variable may be set to, increased by, multiplied by, or divided by any of the following:

A Specific Number
The Player's X Position
The Player's Y Position
A Character's X Position
A Character's Y Position
Animated Scenery's X Position
Animated Scenery's Y Position
Distance Scrolled Horizontally
Distance Scrolled Vertically
The Player's Score
Number of Characters in Level
Number of Living Characters
Time Remaining in Level
Ticks Since Level Began
Routine Performance Count
A Random Number (between 0 and 100)

Certain options in this pop-up menu, such as A Character's X Position, require that a specific object (in this case a character) be selected as the object whose location will be referred to as the variable is set.

Value Field

Determines the number that the variable will be set to, increased by, multiplied by, or divided by when the selected routine is performed. This may be an actual number, or a letter variable (A, B, C, etc.) This field is only visible when "A Specific Number" is selected from the Object Pop-Up Menu.

Reset All Variables To 0 Checkbox

Determines whether every variable will be reset to 0 when the selected routine is performed