Counterpart to LibLoad

Is there a counterpart to LibLoad?

Just as LibLoad can load objects in realtime, is there a way to export objects in realtime? I’m thinking if you can import into the game engine, there should be a way to export out of the game engine. Following Python’s pickle module, it’d be named LibDump, if you go with LibLoad.

Speaking of pickle, I could possibly implement this in Python or create a patch…(eh, don’t like C++ :p)

If you want to export to another game engine, it should be possible via writing a simple .x exporter (or a similar exporter) for Python.

If you want to basically save another blend file, you should be able to read in the blend file as a binary data string, and then pickle and dump (or just save) the result to a file.

If you want to save the current blend file, you can do so via the method above, but it won’t save the changes made since the blend file was saved.

If you want to save the changes incurred in a game alongside the blend file (basically save the blend file after you edited it by playing the game), that’s a little more difficult.

Which are you thinking of doing?

You can create your blender object in a separate blend. Ftp this file and libload from the other game instance. This way you get the structure data into the other game instance. The object states can be transfered via network similar to the usual saveLoad methods.

As you cant generate new objects in the bge anyway transferring the blend is a good way.

The link I’m missing is getting the realtime BGE object into a file, which could be a blend file. Ofc, if I stop the game engine, everything resets, so I need to do it in realtime, without stopping the BGE. Currently, I’m still trying some stuff out. I think I can copy the mesh, but I’m still not sure about the other stuff. Hmm, if this idea was further extended, it’d almost be like a realtime object properties editor for the game engine.

As you start with the same initial data, you can transfer all changes you did in one game instance to the other game instance.
As you can’t create new mesh data there is no need to transfer mesh data. But you can modify existing meshes. So you simply transfer the changes on the mesh (including identification where the changes belongs to).

A) ensure to start with the same data
B) ensure to transfer all updates
C) ensure you can uniquely identify data.

It is the same technique as used in SaveLoad systems and network synchronization.