7
1
|
http://stackoverflow.com/questions/7206411/lua-co-routines I'm trying to get an understanding of how I can use co-routines to "pause" a script and wait until some processing is done before resuming. Perhaps I'm looking at co-routines in the wrong way. But my attempt is structured similar to the example given in this answer. The loop in main.cpp
loop.lua
EDIT: Added a bounty, to hopefully get some help on how to accomplish this.
|
|||
add a comment
|
2
accepted
+50
|
Return code 2 from A similar pattern has worked for me, though I did use On your resume call, it's not clear if you're over simplifying for an example, but I'd make the following changes in your while loop:
Edit 2: For debugging, add the following before you run your resume. You've got a string getting pushed on the stack somewhere:
Edit 3: Oh good grief, I can't believe I didn't see this already, you don't want to run
|
||||||||||||||||||||
|
0
|
Last time i was messing with Lua coroutines I ended with such code
It seems you could not load file as coroutine? but use function instead And it should be selected to the top of the stack.
|
||||||||||||
|