GlobalVariable Script

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Extends: Form Script

Editor: Global

Script for the manipulation of global variable objects.

Definition[edit | edit source]

ScriptName GlobalVariable extends Form Native Hidden

Properties[edit | edit source]

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

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

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

None

Notes[edit | edit source]

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