lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I know this has been covered before, but I can't seem to find it in the archives.

Is there any way to do a yield (or something like it) from c that has been called from Lua?

In my game, I want to do something like this from lua:

 player.newpath = pathfinder.makepath(pointa,pointb)

I want the Lua code to return only when it has a path.
On the c side, however, I want to add the makepath request to the pathfinder's queue, then "yield". The pathfinder would then complete the request incrementally while the game continues to run. When the path is complete, the c code would then "resume" the Lua code.

Is there a way to do this?