[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Serializing Lua State in use with Luabind
- From: Ben Sunshine-Hill <sneftel@...>
- Date: Sat, 14 May 2005 18:38:27 -0700
Ahh, I think I know what's going on.
LuaBind is trying to store a metatable for a table, and the metatable
contains an __eq metamethod which is a C-function. Pluto, which has no
way of serializing C functions, thus fails.
Have you tried adding the metatable to the permanents table? Assuming
there's only one metatable per class, this shouldn't be much overhead,
and should work fine. Tell me if you need help with this; I'd very
much like to be aware of interactions between Pluto and binding
libraries like LuaBind.
Ben
On 5/14/05, Stefan Schwarzbach <Schwarzbach@silentdreams.de> wrote:
> Well, when I serialize a Lua State with Luabind classes inside, the
> following happens:
>
> When I come to the point to serialize the Lua Class Pluto first
> serializes the name of the class which function properly. At next he
> wants to store some Userdata, no problem. But then he continues storing
> the lua table (which represents the lua class, I think), and there he
> wants to store a function called __eq (the first element he wants to
> store in the table). I get an error in Pluto, because this function
> seems to be a C/C++ function from luabind.
>
> I don't know how to solve that problem. Any ideas?
>
> Thanks,
> Stefan
>
>
> Ben Sunshine-Hill wrote:
> > Stefan,
> >
> > That's very interesting. While I've barely ever used luabind, on the
> > face of it it doesn't seem like Lua tables created by luabind should
> > be any different than Lua tables created by the Lua API. Would you
> > mind providing info on how the table was created, and what happened
> > when you tried to serialize it with Pluto?
> >
> > Thanks,
> >
> > Ben Sunshine-Hill
> >
> > On 5/14/05, Stefan Schwarzbach <Schwarzbach@silentdreams.de> wrote:
> >
> >>Hello,
> >>
> >>I'm using Lua and Luabind for a game development project and therefore I
> >>must be able to serialize the actual "lua world" in my savegame to later
> >>load it and resume at the same position in game as I saved.
> >>
> >>I tried to use the Pluto Library, because it should excactly do what I
> >>needed. This library seems to work perfecly, but it has a major missing
> >>feature or problem. The tables luabind creates for storing the lua
> >>classes can't be serialized by pluto. So I cannot save lua instances of
> >>lua classes ( and also instances of c++ classes, but that's another
> >>problem).
> >>
> >>So here is my question: Does anyone of you ever tried to serialize a lua
> >>states in combination with luabind? Did you get Pluto working or did you
> >>use another library?
> >>
> >>I hope you can help me!
> >>
> >>Thanks in advance,
> >>Stefan Schwarzbach
> >>
> >>
> >
> >
> >
>
>