GlobalVariable Script

From Creation Kit
Jump to: navigation, search

Extends: Form Script

Editor: Global

Script for the manipulation of global variable objects.

Definition

ScriptName GlobalVariable extends Form Native Hidden

Properties

  • float Value [read-write]: The current value of this global variable object.

Global Functions

None

Member Functions

  • float Function GetValue()
    • Returns this global variable's current value.
  • int Function GetValueInt()
    • Returns this global variable's current value cast as an int.
  • float Function Mod(float afHowMuch)
    • Modifies this global variable's value in a more thread-safe way.
  • Function SetValue(float afNewValue)
    • Sets this global variable's current value.
  • Function SetValueInt(int aiNewValue)
    • Sets this global variable's current value to the specified int.

Events

None

Notes

  • 2 decimal float precision from 0x001FFFFF to -0x001FFFFF
  • int precision from 0x00200000 to 0x00FFFFFF and -0x00200000 to -0x00FFFFFF
  • not reliable outside the range 0x00FFFFFF to -0x00FFFFFF
    • Odd numbers outside range will either shift up or down to the next adjacent even number.
; This is outside the reliable range
MyGlobal.SetValue(0x0FFFFFFF)
MyGlobal.GetValue() ; Returns 0x10000000

See Also