The LibLoad Information thread

LibLoad is a brilliant tool for blender games, and can be used for thing such as LOD, switching levels, and all manner of other things.

What Is LibLoad:
LibLoad is a python function that allows you to load scenes or meshes from one blend file into another while the game is running. This allows distributed storage of models, essential for large games, for dynamic loading screens, and for easier level switching, and is often more flexible than linked blends.

Using LibLoad:
LibLoad is one of the most simple python functions to use.
To load a blend you can use the following code:

path = bge.logic.expandPath('//')+'blendname.blend'
bge.logic.LibLoad(path, 'Scene', load_actions=True)

What that will do is to load the scene ‘Scene’ from the blend file ‘blendname.blend’ in the same folder as the blend file it’s running from. It will load all actions, meshes, and most other information types, and put them into the scene that the script ran from.
It will load anything on visible layers onto visible layers, and anything on invisible layers onto invisible layers.

Let’s say we’ve finished with that blend, say, we’ve reached the end of the level and wish to remove it. For this we simply use:

path = bge.logic.expandPath('//')+'blendname.blend'
bge.logic.LibFree(path)

Simple eh?

Limitations:
Like any tool LibLoad has some limitations. The most significant ones are:

  • All objects must have proper materials and textures. ‘Face Textures’ isn’t good enough, you need to specify the image.
  • LibLoaded objects go to the scene that the script was run from.
  • Scripts attached to objects in a libloaded blend will be loaded, but modules will not.

interesting

reading, I understood where wrong (modules and layers)

I noticed one thing, with GLSL, the lights do not work (the lights imported)
this is a bad thing: (

while the other does not seem too serious limitations (for modules just use an external module, scenes do not even know what they are)

I had imagined that there could be problems with the lights …

(maybe I find a workaround light)
a part that, is really easy to use.

anyway i’m a total noob on that.

this is my test , some suggestion? is correct as design the main.blend?
(the file is a rar)

Attachments

bigGame.rar.blend (163 KB)

I’ll look at your blend in a minute, but I suspect that the lights are on different layers. In Multi-texture lights work.