2.41 python bugs on win XP ?

hy all,

do you also have serious problems with the python game-engine api?

I use a winXP computer at work with an Nvidia GeForce4 MX 440 AGP8x.

My Problem: the python API semms to work only partially which means imporant functionality does not work.

Two examples in one script:


import Blender
import GameLogic

contr = GameLogic.getCurrentController()
owner = contr.getOwner()
joystick = contr.getSensor(‘stick1’) # gives an AttributeError: Unable to find requested sensor - the joystick works and the sensor is there

own = GameLogic.getCurrentController().getOwner()
Target = GameLogic.getCurrentScene().getObjectList()[“tracker”] #gives a KeyError: “’‘tracker’’ not in list” - the object tracker exists

print own.getDistanceToTarget


Is the 2.41 version really so buggy or do I miss something? All the code above is from blender-related pages and seemed to work for other people on other systems.

The “tracker” not in list for example comes from an empty list - my scene is full of objects but the list is emty.

Any ideas?

THX in advance

No, I don’t have this problems. But I had similar issues while developing my game. It is not XP and is not Python.

Check the name of your sensor (upper/lower case). Is it connected to your controller? If not the controller can not find it. (Check all controllers running this script)

The name of your tracker is “OBtracker”. You need to add the OB to your string. The Editor adds it automatically in the input fields (e.g. OB:“Cube” results in “OBCube”). In Python you have to do it by yourself.

I don’t think you will be able to load module Blender in blenderplayer (the exe file).

I hope this helps

…a lot for your immediate help - works fine :slight_smile: