lua-users home
lua-l archive

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



I am currently writing a game engine for Linux that I intend to open source.  I realize that I need some sort of script to go along with a map in it to describe what will happen when.  I decided to turn to Lua as a script because its syntax is simple and not too difficult to learn.  But I need the interpreter to run as a separate thread than the main thread for reasons like this:
while encounter_Living("DemoEncounter") > 0 do
 -- Do something while the encounter is alive --
end
ui_Print("Encounter Killed");

Currently all I have been able to do is have an update function called after every frame is rendered but and waiting would cause the game to lock up.  Is there any way to run the Lua interpreter as a separate thread from the main thread for Windows and Unix?
Nathaniel Lewis