libload / libnew help

Ive never used the two before so how would I add a mesh from another blend to my current one? I have a list of meshes to use.

you want to import a mesh from another blend?
file append browse to your blend file and enter it you can see the folder structure inside the blend
browse objects and select the one you want and append

if you just want the mesh go to meshes
I believe to get the materials and stuff with the mesh you have to append objects

I want to do it while the game is running

here is the libload code:

import bge.logic as logic

cont = logic.getCurrentController()
own = cont.owner

path = logic.expandPath("//")
file = “mod.blend”

if ‘init’ not in own:
own[‘init’] = 1
logic.LibLoad(path+file,“Scene”)

scene = logic.getCurrentScene()

scene.addObject(scene.objectsInactive[‘Mod’],‘Empty’)

so just put the path to the .blend in path = logic.expandPath("//")
and the name of your .blend in file = “mod.blend”

Sorry, I have problems too with this function and I don’t know how to create a new POST :spin:.
I’m trying to import the actions from other blender file:

bge.logic.LibLoad( PATH , “Scene” , “Bytes” , True)

The problem that I have is that I don’t know what I must put filling the “BYTES” gap :(.

Do you know how I can solve this problem? :slight_smile:

Nothing if you dont need it.

This is enough:


path        = logic.expandPath('//map_name/' + blend_name)
load        = logic.LibLoad(path,'Scene') #scene to load a scene, 'mesh' to load a mesh, 'action' to load animations.

or you can use async:


load        = logic.LibLoad(path, 'Scene', async = True)

did they fix being able to load text objects via libload?