SetLocalFloat
Contents |
[edit] SetLocalFloat(object, string, float)
Store a float as a local variable within an object.
void SetLocalFloat( object oObject, string sVarName, float fValue );
[edit] Parameters
oObject
Target object to store local variable in.
sVarName
Unique variable name.
fValue
Variable being stored in local object.
[edit] Description
Stores fValue as a local float within oObject using the variable name sVarName. The parameter sVarName is a unique string identifying a single local variable. Using the same value for sVarName in subsequent calls will overwrite the original value.
[edit] Remarks
As with all locals, there seems to be no size limit to sVarName, however, anything over 50 characters is probably a bit extreme.
There is no way to set a local vector, however, vectors are merely a set of 3 floats, defining positions X, Y and Z. To set a local vector position, you can easily set them to local floats, however, SetLocalLocation is probably a quicker and easier method.
[edit] Known Bugs
None.
[edit] Version
1.61
[edit] Example
// demonstrates syntax for SetLocalFloat void main() { object oThis = OBJECT_SELF; string sKey = "foo"; float fValue = 20.0; SetLocalFloat(oThis, sKey, fValue); }
[edit] See Also
functions: |
author: Daniel Beckman, editors: Jasperre, Mistress, additional contributors: Graziano Lenzi, Lilac Soul, Fireboar