Variable Modify Rule

From TrainzOnline
Revision as of 00:58, 19 February 2013 by Pw3r (Talk | contribs)

Jump to: navigation, search

The Variable Modify Rule is used to define and modify a custom integer variable within a session. The variable can then be shown to the player via the Variable Show Rule or tested to affect the session outcome via the Variable Check Rule.


Configuration Options


The rule can be run in three different modes:
Add: Adds the amount specified to the variable upon execution
Subtract: Subtracts the amount specified from the variable upon execution
Change: Sets the value of the variable to the specified amount upon execution


Specifies the amount to be added to, subtracted from, or set to for the variable.

Variable Name

Specifies the variable name. Variable names are used to identify the variable between rules. They can be anything you like, but be sure the name is meaningful or you may forget what it does.


In the add and subtract modes it is possible to have the addition/subtraction undone if the rule execution is stopped. This can be handy for performing tests such as whether a train is at a specific location.

Upper/Lower Limits

You can optionally have the rule specify a minimum and maximum value for your defined variable. This option is disabled by default.

Personal tools