I have a celX script which takes a reasonable period of time (a few seconds or more) to execute.... long enough that I have included periodic wait()'s in order to return control to Celestia within the ~ 5 sec limit.
This is all good and works OK if the script is called directly from Celestia,...
... but when there is a Lua-Hook involved (eg. the script is called from LuaEduTools), the wait() appears to cause the following error:
Code: Select all
"attempt to yield across metamethod/C-call boundary"
If I remove the wait(), this error doesn't occur, but instead I get:
Code: Select all
Timeout: script hasn't returned control to celestia (forgot to call wait()?)
Error while executing Lua Hook: Timeout: script hasn't returned control to celestia (forgot to call wait()?)
Is there a way to handle wait()'s when a LuaHook is involved, if so, does anyone know what the trick is to getting this to work?
Or, is it just not possible in the context of a LuaHook?
Cheers
CC