lua-users home
lua-l archive

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

At 15:51 5/26/99 -0300, you wrote:
>screen the next day.  There was still something missing that we'd enjoyed in
>SCUMM however, and that was cooperative multitasking.  In an adventure game,
>it's very nice to have a separate script running that makes pigeons fly
>around, makes another character follow you, or that looks for opportunities
>to change the camera angle.  We could do all that via callbacks, but that

I've been working on a demosystem since 1997 and I also use a cooperative
multitasking system (since it was originally designed for dos and we had to
do the multitasking ourselves - we ported it to Windows in a sunday
afternoon since we used a lot of publicly available (portable) libraries
for both music & gfx). 

We currently have C++ classes that implemented a Run() and a
HandleEvent(..) function. Lua is (at the moment) used to "setup" the
synchronisation between gfx effects & music ( to construct CTasks &
CEffects and call AddEvent functions). So our "main demo-code" is
implemented in C++ and not in Lua (but that is mainly because of
performance issues and the fact that we haven't got that much experience
with lua & creating gfx effects yet - since I implemented my "iterate task"
function in Lua I can also construct Tasks & Effects from Lua (providing a
Run function)).

Can I assume you use a similar form of Run & HandleEvent for your kind of

>function returns, the engine enters it's main loop:  Render the world, then
>call lua_updatetasks().  This was the API function I added that iterates

When using lua this way, do you modify the state & properties (x,y,z pos,
etc) of actors & objects directly from Lua, or do you add them in a list
and have the renderer first update the world from the list? (or another
way?) I'm trying to figure out what consequences it has if you take
different approaches.

>plays animations.  It only calls explicit Lua functions for a few things,
>notably changes in the state of the controls and when actors collide.  It

Does this also mean you have different kind of scripts? scripts bound to an
Actor, or that load a new room,etc?

>Hope you enjoyed reading as much as I enjoyed sharing... 

I did, actually I found it very interesting when I first heared that Lua
was used in GF. I had been experimenting with Lua a few months before and
now that I also heared about Baldur's Gate using Lua, I get the feeling
that Lua is becoming a 'general accepted game scripting language' and that
gives me confidence that I'll also be able to use it for my purposes.

Best regards,

Jeroen Janssen