generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Calling Lua_Yield from lua

Previous Thread :: Next Thread 
Profile is not online. Profile
Joined: 27 Dec 2008
Total Posts: 125
12 Dec 2011 08:49 PM
Alrighty so i keep getting this iritating error when i try to call this function:

static in LuaYield(lua_State *L)
{

return lua_yield(L,1);

}

[...] //some where in registration
lua_register(L,"Yield",LuaYield);

basicly its supposed to stop a thread i have going in C++ but when ever i call the function in lua (Yield() ) it gives me this:

attempt to yield across metamethod/C-call boundary

any help?
Report Abuse
Merlin11188 is not online. Merlin11188
Joined: 20 Dec 2007
Total Posts: 4158
12 Dec 2011 08:55 PM
"basicly its supposed to stop a thread i have going in C++ but when ever i call the function in lua (Yield() ) it gives me this:"
You're trying to call a C(++) function after yielding a coroutine. That's illegal.
[/pretendingToKnowThingsAboutCoroutines]
Report Abuse
Profile is not online. Profile
Joined: 27 Dec 2008
Total Posts: 125
12 Dec 2011 08:57 PM
merlin im calling it to yield one.
Report Abuse
Merlin11188 is not online. Merlin11188
Joined: 20 Dec 2007
Total Posts: 4158
12 Dec 2011 09:04 PM
Yes, but do you call a C(++) function before you resume? I remember that being some sort of a reason why it would give that error.
Report Abuse
Profile is not online. Profile
Joined: 27 Dec 2008
Total Posts: 125
12 Dec 2011 09:06 PM
Never mind figured out a better system :3
Report Abuse
Merlin11188 is not online. Merlin11188
Joined: 20 Dec 2007
Total Posts: 4158
12 Dec 2011 09:08 PM
And I was just about to say about how I should stop talking because I don't understand this error (because I don't understand coroutines on the C side.)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image