to preface, sorry about all the issues 😅 i'm trying to put together a game extensively using lua but these issues are very problematic (except the pull_variant one which i've learned to work around fortunately)
this one's pretty self-explanatory, if I load a string into a thread reading
_ENV = game
print(9000)
wait_timer(2.0)
print(2000)
it never prints 2000, only 9000 (i've tried a myriad of different ways, including just calling yield, waiting in gdscript, then resuming the thread. nothing)
all relevant functions are exposed to the table/environment of course.
evidently, execution does stop, so i think it's an issue with LuaThread.resume? i'd guess it's only resuming execution of the global environment. i think that some method of assigning a thread an environment from GDScript would be ideal and circumvent this issue, but there's probably some better way... idk
(there's also no equivalent of push_variant/pull_variant for a sub-environment but that's not a big deal just requires a bit of extra code haha)
to preface, sorry about all the issues 😅 i'm trying to put together a game extensively using lua but these issues are very problematic (except the pull_variant one which i've learned to work around fortunately) this one's pretty self-explanatory, if I load a string into a thread reading
it never prints 2000, only 9000 (i've tried a myriad of different ways, including just calling yield, waiting in gdscript, then resuming the thread. nothing) all relevant functions are exposed to the table/environment of course.
evidently, execution does stop, so i think it's an issue with
LuaThread.resume
? i'd guess it's only resuming execution of the global environment. i think that some method of assigning a thread an environment from GDScript would be ideal and circumvent this issue, but there's probably some better way... idk (there's also no equivalent of push_variant/pull_variant for a sub-environment but that's not a big deal just requires a bit of extra code haha)