i have 2 blend in the same folders
demoPlayer.blend
and
explosion.blend
from demoPlayer.blend i have this script:
import bge
def player(cn):
if cn.sensors["Mouse"].positive:
if 'explosion.blend' not in bge.logic.LibList():
bge.logic.LibLoad('explosion.blend', 'Scene')
but say Value Error: could not opend blendfile “explosion.blend”
whats is wrong?
edit:
this make the same error: (triggering by a sensor brick)
Excuse me for my lack at script experience, but I try to follow and maybe even help by making dumb comments.
if 'explosion.blend' <b><i>not</i></b> in bge.logic.LibList(): bge.logic.LibLoad('explosion.blend', 'Scene')
You check if it isn’t in bge.logic.LibList, then to send it to bge.logic.LibLoad,… right?
Then the file doesn’t seem to be available at the location it is looking?
(Either location, or the name incorrect, or the parameter “Scene” is not available (miss spelled)?)
But I guess you already tried to walk over these a couple of times…
If it is a list of imported blends, and you check if it isn’t on this list,…
then if it isn’t on there (because it isn’t loaded yet), then you need to load it (/add to it to that list).