[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: stage management in games
- From: "Adam D. Moss" <adam@...>
- Date: Sun, 10 Aug 2003 03:10:11 +0100
I would like to be able to write a script for my game to stage manage the
characters. Something like:
ogre = monster("Eric")
The trouble is, with something like this the rest of my game will pause
until Eric's said his line. Is there a way each agent can call a script like
this, which will do a frame's worth of logic and then hand back control so
that everything else in the game can be updated too?
You probably want to look into Lua5's (possible-underdocumented)
With these you can manually yield a thread of control at
particular points (say within your Ogre logic) and resume
at a later time (say, the next frame). Coroutines are useful
for 'hand-scheduling' stuff as well as funky things like
marvellous iterators and the ever-popular state machines
(along the lines of your requirements).
Adam D. Moss . ,,^^ email@example.com http://www.foxbox.org/ co:3
'Fox News and all the other right-wing pundits thrive by assuring
their audiences that they are the real unfortunates, oppressed by
problems as varied as big government, liberal media, taxes and the
bottom-feeders they serve, car-pool lanes, and France.'