Jump to content

Recommended Posts

Posted

Josh, are you using lua_newthread(L) in the editor or engine when calling the Lua script? I ran into an issue where coroutines are failing in Lua possibly because you are using lua_newthread(L) instead of lua_newcthread(). I guess in LuaJIT if you use lua_newcthread() it will allow coroutines to work in the situation where the Lua script is going back and forth from Lua to DLL.

 

My Question on the issue and others response

http://stackoverflow.com/questions/8459459/lua-coroutine-error-tempt-to-yield-across-metamethod-c-call-boundary/8463031#comment10471100_8463031

 

A response related to the issue

http://lua-users.org/lists/lua-l/2011-10/msg00461.html

 

 

Note that before you switched to LuaJIT I was able to get coroutines to work in Lua. Coroutines can be very valuable as it basically gives us a form of threading via Lua. I was trying to use it to split up pathfinding between game cycles when I encountered the error I describe in the stackoverflow question.

Posted

I'll see if I can find out more information around this, but coroutines are a built-in feature of Lua and pretty powerful stuff so it would be nice if we were able to use them within LE's Lua implementation.

Posted

I agree, they are useful. Just make sure none of the elements in your loop change.

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...