lua-users home
lua-l archive

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


True, if serialization isn't a problem, setjump/longjump may be a workable
solution.  However, if you want to implement something like what is called a
'latent function' in unrealscript for use in your AI the serialization
issues need to be contended with.  This will come up even if you don't use
lua for your save games.  If you don't need this functionality you'll be in
the clear.  Unfortunately for me, I do want this functionality as it will
simplify level scripting greatly.

Allowing level scripters to write stuff like:

dosomething()
waitforevent( "some game event" )
donextthing()

would be a big win as far as script complexity goes.

Kelvin

----- Original Message -----
From: "Sebby " <beast@interlinx.qc.ca>
To: "Kelvin McDowell" <kelvin_mcdowell@telus.net>
Sent: Thursday, October 19, 2000 18:49
Subject: Re: Cooperative Multitasking


> > I too have been looking into doing this.  The problem with setjump
> is that
> > it isn't maintable across load/save.  If someone saves their game
> while the
> > lua interpreter is waiting and then quits and restores later on.
> You not
> > only need to be able to 'pause' the interpreter you also need to be
> able to
> > serialize its state.
>
> In my case, this wouldn't really matter. For now, i don't have any
> plans to use Lua as a "serialization" method for save games. And
> since the games i work on are mostly sport or platform style games,
> it's probably more efficent to just save out the relevant info
> (current level, inventory, ...) than save the whole state. The
> scrupting i want is mostly to allow to externalize some game behavior
> like : UI, special FX management, some AI, string tables, asset
> management.
>
> Sebastien St-Laurent
> Software Engineer
> sebby@z-axis.com
>
>
>