Hello!
I am trying to implement a function for the scriptable part of my engine that would allow to make a Lua procedure wait a given amount of seconds before it can proceed with further execution. The function should only block the Lua code (running in its own thread) and not the main game loop.
An example usage would be as follows:
Any ideas how such function could be implemented? So far I've been playing around with Windows' Sleep() function but couldn't make it execute on the Lua thread, thus it was blocking my entire program.
Any advice will be appreciated.
I am trying to implement a function for the scriptable part of my engine that would allow to make a Lua procedure wait a given amount of seconds before it can proceed with further execution. The function should only block the Lua code (running in its own thread) and not the main game loop.
An example usage would be as follows:
Any ideas how such function could be implemented? So far I've been playing around with Windows' Sleep() function but couldn't make it execute on the Lua thread, thus it was blocking my entire program.
Any advice will be appreciated.
The post was edited 3 times, last by xor ().