lua-users home
lua-l archive

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


>Perhaps it's easier to reorganize your code so that you can restart
from
>the beginning of a function...

I wish it were so easy. The script we are thinking about serializing is
a script that runs for the entire duration of a level as an overhead
polling script. It tracks level wide goals and may have many internal
counters or other state to track player progress. We thought about
trying to design the game in such a way that the player wouldn't have to
save mid level, but that turned out to be unrealistic.

j

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Luiz Henrique
de Figueiredo
Sent: Saturday, November 01, 2003 3:28 AM
To: lua@bazar2.conectiva.com.br
Subject: Re: Serializing a running lua state to disk

>Is there anyway in the current LUA framework to take a running (but
>yielded) lua state and serialize it to disk then load it back up and
>resume execution where it was before the dump to file?

Try lper at http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/ .
It's experimental but seems to work...

>If not, and I wanted to some how do this where should I start digging?
>Thinking about this, I really only need a way of grabbing the current
PC
>pos and the execution stack.

Perhaps it's easier to reorganize your code so that you can restart from
the beginning of a function...
--lhf