Globals

Revision as of 15:52, 4 March 2011 by imported>JOG
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A global variable is available for any script or condition to reference without being linked to a particular quest or object.

Global variables are declared in the main menu under Gameplay -> Globals


  • EditorID: The name of the variable. No spaces or special characters are allowed.
  • Variable Type: Short and Long are actually the same thing. Both are integer formats. Float is a real number format.
  • Value: The default value for the global variable. This affects the variable only when the plugin was just installed. After that the value is stored in the savegame.
  • Constant: When this box is checked, the variable will be reset to its default value when a savegame is loaded.


Notes:Edit

Internally all types of global variables are stored as floating point. The technical implementation of this variable-format causes inaccuracies at very high or low values. (e.g all numbers from 2000000000 to 2000000064 are stored as 2000000000) and the results of divisions will almost always have decimal places, thus checks like "if global == x" will usually fail after a division.

In most cases, variables defined in quest script are the better choice.

See alsoEdit

List of Global Variables