Having trouble getting python scripting to work

okay so im using 2.49 and I followed socials tutorial but for some reason it wont work… Probably my bad


Control_LBVER.blend (212 KB)

okay so if i understand from what I’ve read… The syntax in 2.49 is different or something? Anyone care to elaborate on this?

Yes the syntax is different. Instead of “cont.getOwner()”, it is cont.owner. Instead of “cont.getSensor(“name”)” and “cont.getActuator(“name”)”, it is “cont.sensors[‘name’]” and “cont.actuators[‘name’]”

There are lots of other syntax changes. Also, instead of “own.prop”, it is own['prop

is there any tutorials similair to socials that use the 2.49 syntax? because ive searched but haven’t been able to find any

Im not sure about any tutorials like that. And I’m not even sure about a good place to learn the new syntax. I did it myself by looking at all of the depreciation warnings in the console.

But I fixed all of the syntax and it works fine. Also, you needed an actuator called “motion”. Just download it and you’re good to go. :slight_smile:


fixed_syntax.blend (42.2 KB)

For 2.49 you can ignore the deprecation warnings. It does not harm as long the script runs in 2.49.

Your error from the top post is quite simple. You refer to an actuator called “motion”, but such actuator is not connected with the Python controller.