sim.addScriptText seems to not work any more in Version 3.6
Posted: 18 Feb 2019, 16:59
Hi,
I have the following function:
addAndAttachScript = function(inInts, inFloats, inStrings, inBuffer)
sim.addStatusbarMessage("about to attach script")
local objectHandle = inInts[1]
local scriptType = inInts[2]
local scriptContent = inStrings[1]
local scriptHandle = sim.addScript(scriptType + sim_scripttype_threaded)
errVal = sim.setScriptText(scriptHandle, scriptContent)
sim.addStatusbarMessage(scriptContent)
sim.addStatusbarMessage("call to sim.setScriptText returned")
sim.addStatusbarMessage(errVal)
sim.associateScriptWithObject(scriptHandle, objectHandle)
return {scriptHandle}, {}, {}, ""
end
When I call this function via remote API, the status bar messages report the correct content of the script (variable scriptContent) and the return value is 1 and there is no other error reported on the status bar. The addition of the script works but the script remains empty when I open it. Accordingly calls to script functions fail.
This used to work in Version 3.5.
I have the following function:
addAndAttachScript = function(inInts, inFloats, inStrings, inBuffer)
sim.addStatusbarMessage("about to attach script")
local objectHandle = inInts[1]
local scriptType = inInts[2]
local scriptContent = inStrings[1]
local scriptHandle = sim.addScript(scriptType + sim_scripttype_threaded)
errVal = sim.setScriptText(scriptHandle, scriptContent)
sim.addStatusbarMessage(scriptContent)
sim.addStatusbarMessage("call to sim.setScriptText returned")
sim.addStatusbarMessage(errVal)
sim.associateScriptWithObject(scriptHandle, objectHandle)
return {scriptHandle}, {}, {}, ""
end
When I call this function via remote API, the status bar messages report the correct content of the script (variable scriptContent) and the return value is 1 and there is no other error reported on the status bar. The addition of the script works but the script remains empty when I open it. Accordingly calls to script functions fail.
This used to work in Version 3.5.