lua-users home
lua-l archive

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


Hello all,

I wonder what would be the best alternative implementing the folowing thing:

Lets consider that I want to use LUA language for scripting behaviour of
game entites.
So far , each entity spwaned into the world can have a LUA script attached
to it. When the entity enters a state for example, a function in the script
is triggered. But lets consider the
player wants to save the game WHILE a scripted charachter is activly running
a script.
What I want to know which is the best way to capture LUA state, serialize it
to disk,
then restore it, and have LUA interpretor resume excution of its the script
from the very same state as it was saved.

I guess it can be done, however beeing a very begginer to LUA, I would
apreciate if somenone can answer this question.

Thank you very much, Dan