Difference between revisions of "GlobalVariable Script"
Jump to navigation
Jump to search
imported>Qazaaq |
imported>Cobalt027 |
||
Line 34: | Line 34: | ||
== Events == | == Events == | ||
None | 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. | |||
== Examples == | |||
<source lang="papyrus"> | |||
; Set the XP boost global to 1.5 | |||
MyGlobal.SetValue(0x0FFFFFFF) | |||
MyGlobal.GetValue() ; Returns 0x10000000 | |||
</source> | |||
== See Also == | == See Also == | ||
*[[:Category:Miscellaneous|Miscellaneous Category]] | *[[:Category:Miscellaneous|Miscellaneous Category]] |
Revision as of 20:15, 11 January 2017
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.
Examples
; Set the XP boost global to 1.5
MyGlobal.SetValue(0x0FFFFFFF)
MyGlobal.GetValue() ; Returns 0x10000000