Scripting-wait function causing crash

When using the wait function outside of onNote or onRelease I get this error message:
error.PNG
Happens when I try this:

t=getTime()

defineParameter("Timer",nil,false,function()timeChanged()end)

function timeChanged()
  if Timer then
    t1=getTime()
    print(math.ceil(t1/1000))
    wait(1000)
    Timer=false
  end
end

or this

defineParameter("Octave",nil,0,-3,3,1,function()onPitchChanged()end)

function onPitchChanged()
  wait(1000)
  this.parent:setParameter("Octave",Octave)
end

Crash dumps:
HALion 6.zip (2.63 KB)

I’ve had the same problem.

It’s a pretty massive crash too. Sometimes I have to restart the computer to get rid of the subsequent bugs.

Hi misohoza,
I’m able to reproduce it here. Its now in our Defect-Tracking-System and listed as Bug-ID “HALLY-7023”.
I hope we can provide a fix for it soon.

ps: Perhaps the use of “spawn” might be a workaround as long this problem is not fixed:

defineParameter(“Timer”,nil,false,function()spawn(timeChanged)end)

Thanks for your report and please accept my apologies for any inconvenience caused.
Gerrit Junge