sim.addScriptText seems to not work any more in Version 3.6

Report crashes, strange behaviour, or apparent bugs
Post Reply
streets
Posts: 12
Joined: 18 Dec 2017, 17:25

sim.addScriptText seems to not work any more in Version 3.6

Post by streets »

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.

Justus
Posts: 42
Joined: 24 Jan 2017, 07:37

Re: sim.addScriptText seems to not work any more in Version 3.6

Post by Justus »

I can confirm this issue, a simple child script like this:

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'))
works in 3.5, not in 3.6. The script is created, but has no contents.

EDIT: fixed in 3.6.0 rev 1

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: sim.addScriptText seems to not work any more in Version 3.6

Post by coppelia »

Thanks Justus!

Post Reply