Difference between revisions of "Globals"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>MadCat221
imported>JOG
 
Line 1: Line 1:
Link to TES4 Construction Set Wiki: [http://cs.elderscrolls.com/constwiki/index.php/Globals Globals]
A global variable is available for any script or condition to reference without being linked to a particular quest or object.


In addition, a new checkbox is added for the GECK: "Constant".  Checking this box will make changes to this value not persist through game saves.  If the global is to be used as a hidden mod setting value, this checkbox must be un-checked.
Global variables are declared in the main menu under '''Gameplay -> Globals'''


*[[List of Global Variables]]


*'''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:==
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 also==
[[List of Global Variables]]
[[Category:Gameplay Menu]]
[[Category:Gameplay Menu]]
[[Category:Scripting]]
[[Category:Variables]]

Latest revision as of 15:52, 4 March 2011

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 | edit source]

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 also[edit | edit source]

List of Global Variables