lua-users home
lua-l archive

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


I've looked around and can't find much information on coroutines besides the light doco in man.

>From what I can gather:

In my game:

------------
lua_State* Thread = lua_newthread(m_LuaState);
int ReturnCode=lua_dobuffer(Thread, File, File.GetSize(), a_Name); 
//Execution return immediatly
------------

My mission script can sit in a loop: (Excuse bad use of Lua Syntax and obvious errors, I've only been looking at the language for a few hours and the really lame use of Lua for a one sided CTF script)

------------
FlagID = GetFlagID("DefaultFlag.Model");
CaptureZoneID = GetCaptureZoneID(10,10,10,0,0,0); --Size, Position
while Collision(FlagID, CaptureZoneID)==false do
	Sleep(100) --Milliseconds
End
DisplayScoreBoard()
------------

Do I need to use the lua language constructs in something like this?

Many Thanks,

Chris


NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank.