Difference between revisions of "Osiris/API/GetVarInteger"
From Divinity Engine Wiki
m |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
Returns the value of the variable %<'''_Varname'''> of '''_Source''', if it is an integer. | Returns the value of the variable %<'''_Varname'''> of '''_Source''', if it is an integer. | ||
===== Return Values ===== | ===== Return Values ===== | ||
− | * '''Success/Failure''': Fails if '''_Source''' does not exist. | + | * '''Success/Failure''': Fails if '''_Source''' does not exist, or if the variable does not exist (or exists but has the wrong type). |
* '''_VarValue''': The value of the queried integer variable. | * '''_VarValue''': The value of the queried integer variable. | ||
===== Notes ===== | ===== Notes ===== | ||
− | * The variable has to be | + | *The variable has to be global. The '''_Varname''' does not include the prefix % that is used for global variables in behaviourscript. E.g. a variable that is called ''%Variable'' in behaviourscript would simply be '''Variable''' for the purposes of this query. |
− | * | + | * Can also be used to query variables of the SURFACE type. Because Osiris works with string names, however, a conversion with [[Osiris/API/GetSurfaceNameByTypeIndex|GetSurfaceNameByTypeIndex]] is required. |
+ | * Other types stored in Enums can also be queried with this, but there are currently no conversion functions. | ||
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/GetVarObject|GetVarObject]] | * [[Osiris/API/GetVarObject|GetVarObject]] |
Latest revision as of 17:48, 20 December 2017
Full Definition(s)
- query GetVarInteger([in](GUIDSTRING)_Source, [in](String)_Varname, [out](INTEGER)_VarValue)
Description
Returns the value of the variable %<_Varname> of _Source, if it is an integer.
Return Values
- Success/Failure: Fails if _Source does not exist, or if the variable does not exist (or exists but has the wrong type).
- _VarValue: The value of the queried integer variable.
Notes
- The variable has to be global. The _Varname does not include the prefix % that is used for global variables in behaviourscript. E.g. a variable that is called %Variable in behaviourscript would simply be Variable for the purposes of this query.
- Can also be used to query variables of the SURFACE type. Because Osiris works with string names, however, a conversion with GetSurfaceNameByTypeIndex is required.
- Other types stored in Enums can also be queried with this, but there are currently no conversion functions.