lua-users home
lua-l archive

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

No, it's much simpler than that.  There's a multitasking primitive called
"break_here()" that simply sleeps the task until the next frame.  They look
something like the following... the "is_----ing()" functions call a C
function on the actor's engine handle to query some flags:

function Actor:wait_for_actor()
	while (self:is_moving() or self:is_turning() 
			or self:is_choring(nil, TRUE) or self:is_speaking()
) do

(Yes, this is effectively polling the engine for state rather than more
efficiently calling explicitly back to Lua, but it works fine and the
overhead of Lua in the game itself is pretty miniscule anyway.)

> -----Original Message-----
> From: Dave Bollinger []
> Sent: Friday, May 28, 1999 8:41 PM
> To: Multiple recipients of list
> Subject: RE: Game oriented usage of Lua?
>  >> wait_for_actor(manny)
>    I wasn't exactly clear what you were doing with your 
> multitasking mods,
> but that call clears it up.  "Who" actually flipped the wait/busy-flag
> back?  Was it the host animation engine when some form of 
> sprite sequence
> file ran out, or were your animations sequenced explicity 
> with Lua code so
> it was simply another Lua task did the state change when done?