Regular API function

simSetScriptVariable / sim.setScriptVariable

Description Deprecated. See sim.callScriptFunction and sim.executeScriptString instead.
C/C++
synopsis
int simSetScriptVariable(int scriptHandleOrType,const char* variableNameAtScriptName,int stackHandle)
C/C++
parameters
scriptHandleOrType: the handle of the script, otherwise the type of the script:
sim.scripttype_mainscript (0): the main script is the target.
sim.scripttype_childscript (1): a child script is the target. In that case, arrayNameAtScriptName should also contain the name of the object associated with the script.
sim.scripttype_customizationscript (6): a customization script is the target. In that case, arrayNameAtScriptName should also contain the name of the object associated with the script.
sim.scripttype_sandboxscript (8): the sandbox script is the target.
sim.scripttype_addonscript (2): an add-on script is the target (the add-on needs to be running). In that case,arrayNameAtScriptNameshould also contain the name of the script
variableNameAtScriptName: the name of the variable. If scriptHandleOrType is sim.scripttype_childscript, or sim.scripttype_customizationscript, then variableNameAtScriptName should also contain the name of the object associated with the script: "variableName@scriptName".
stackHandle: the handle of a stack object. The top stack item represents the variable value. If the handle is 0, then the variable will be assigned the value nil. See also the available stack functions.
C/C++
return value
-1 in case of an error
Lua
synopsis
sim.setScriptVariable(string variableNameAtScriptName,int scriptHandleOrType,variable)
Lua
parameters
Similar to the C-function counterpart, with the difference that a stack object is not required, and the desired variable value can directly be appended to the first two arguments.
Lua
return values