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.
sim.addScriptText seems to not work any more in Version 3.6
Re: sim.addScriptText seems to not work any more in Version 3.6
I can confirm this issue, a simple child script like this:
works in 3.5, not in 3.6. The script is created, but has no contents.
EDIT: fixed in 3.6.0 rev 1
Code: Select all
local hndScript=sim.addScript(sim.scripttype_childscript+sim.scripttype_threaded)
local strScriptText="print('hello world!')"
sim.setScriptText(hndScript,strScriptText)
sim.associateScriptWithObject(hndScript,sim.getObjectHandle('Dummy0'))
EDIT: fixed in 3.6.0 rev 1