runtime gives module error

Hey guys i’m having another problem, my “game” worked fine in blender, but i’ve just exported a runtime and when ir un it it gives this error :
i have imported the blender module in the script
how can i fix this ?


I was under the understanding that the Blender module was for non-Game Engine stuff…

The only modules you can import from Blender are GameLogic, GameKeys, Rasterizer, PhysicsConstraints, and VideoTexture (in the SVN). Other modules you’ll need the .py or .pyc files in the same folder as the runtime.

that is very unforunate, i need acces to object properties and can only do that through the Blender module, do you have any ideea where i can get the py file for Blender module ?

thanks Moguri

What properties are you trying to get ahold of? You may be able to access them through other GameEngine only methods.

i have properties (ints or bools) that belogn to the parts of a car, but the controller script is owned by a camera that i use to view the car, so i can’t acces car parts with getOwner :expressionless:

You can use getObjectList()

objList = GameLogic.getCurrentScene().getObjectList()

obj = objList["OBobjName"]

var = obj.prop

Replace objName with the name of the object whose property you need to access. And all you need for this is the GameLogic module which is automatically imported.

ah thank you so much Moguri, i hope this works :smiley:

it does work :), but unofortunately i can’t change the values of the properties :expressionless: , i can only view them, luckly i’ve found a way around using properties but as the project progresses i will need to use them again :expressionless:

Looking at another thread, it looks like the issue lies in using var = obj.prop.

Just change the property by using

obj.prop = 1

I was assigning obj.prop to a variable to avoid typing more :spin:

ah right thanks again Moguri you’re my saviour :smiley:

No problem, I’m glad I could help :smiley: