lua-users home
lua-l archive

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


Hello,

When I first started using Lua, I had the same problem, I'm still not
entirely sure how to set up something like that with coroutines. What
I have ended up doing was setting up an event based processing system
for lua objects and players. Basically each ai frame I loop through
the players and handle any events they have pending, then I loop
through non-player entities and handle their events. If I want
something to happen in the future I just put the event in a queue
(table) with a timer that gets counted down. When it reaches 0, I
process and dump it.

If I get around to going over it again, maybe I could write up a
tutorial or something on it.

Ryan.


On Sun, 21 Nov 2004 19:30:39 -0000, Scott <scottn@bigfizz.com> wrote:
> To be honest I've given up and looked at other scripting libraries.  I've
> switched to Angelscript which is a little more obvious on how to set about
> this kind of thing.  Some kind of tutorial or guide on how to do a real
> world implementation for this kind of thing would be really useful.  Getting
> scripts to run and interface with C is not a problem, it's the steps on from
> there which proove to be a bit tricky.
> 
> I'll probably revisit Lua at some point, hopefully the documentation will be
> a bit more user friendly then.
> 
> Until then good luck people!
> 
> scott
> 
> 
> 
> 
> ----- Original Message -----
> From: "Ed Fear" <edfear@gmail.com>
> To: <lua@bazar2.conectiva.com.br>
> Sent: Sunday, November 21, 2004 7:03 PM
> Subject: Re: coroutines
> 
> > >Any ideas on how this is done?
> >
> > I'd quite like to know about this too, but I've noticed that, in my
> > short period on this list, "howto" questions often don't get answered.
> > Which is a shame.
> >
> > --Ed
> >
> >
> >
> 
>