Adding support for mods?

Hello everyone,
I have made a simulator in the BGE and I have run into a problem. I would love to add modding support, which would allow the users to create an object in blender, place the .blend file into a certain folder(i.e. “mygame/data/mods/”) and then the game would recognize that it has a new object to use. For now I would simply like to import a single object from the main scene in that .blend. I have tried using bge.logic.LibLoad, but I was only able to import the scene, and could not control any objects after that.

Any suggestions are greatly appreciated,
Have a wonderful day and an awesome thanksgiving!

-Kendrick

One word: libLoad

Use python to get a directory listing of all the blends in a directory
Import the blends.
Use whatever method you like to select and add an object. You can get a list of all the objects in inactive layers, which will be where you want to store your new objects.

Be aware that when you libLoad the objects will show up if they are on an active layer in the blend.

Oh, and you can’t import single models, only whole blends or scenes.

For

you should be able to use the getBlendFileList() Python function.

The actual object probably won’t be available after LibLoading the main scene in from the mod blend file. You might have to add it as an Overlay or Background scene to load the game object into memory. From there, you should be able to add it into the main game scene (if it’s in a hidden layer), and then (optionally) end the ‘data’ scene.

You could ensure that the game object’s hidden in the mod blend file by detaching the active 3D view from the active camera (which would be, for example, in layer 1) with the chain button in the 3D view header. Then, place a template in a hidden layer (layer 9, for example) by default. The user would load up the blend file with the template and hidden layer showing and would start working on their own object with that view. When the blend file’s loaded, it should use the camera view, which is in layer 1. This is untested, by the way, but might work fine. You could also just tell them to ensure the object’s present in any layer other than 1.

In addition, you must have a practical foundation

Oh yeah, I forgot about that function.

Ok after downloading a fresh install of blender I got LibLoad working, Thanks guys!