[oolua] Saving OOLua State

  • From: "apscience" <apscience@xxxxxxxx>
  • To: <oolua@xxxxxxxxxxxxx>
  • Date: Sun, 27 Oct 2013 22:44:14 -0700

Hello again,

As part of the project I’m working on I want to be able to stop, save the 
program state, and then load it at another time. Saving the program state 
includes the Lua state. 

However with OOLua I’m a little stumped on how to do this. Saving the C++ 
objects themselves is easy enough. I can save the Lua state using eris [1]. 
However I’m not sure how I’d re-link the lua objects to the C++ objects after 
loading the state. My other thought would be to only share a string id of 
objects with lua and then export c++ functions with OOLua as static functions 
which take the string id and then look up the correct c++ object. However that 
sounds like I’m remaking a lot of OOLua’s functionality there (like 
inheritance/type safety/etc.)

Any thoughts would be appreciated. Thank you again for the help you’ve already 
provided.

[1] https://github.com/fnuecke/eris

Other related posts: