runtime (can't set properties)


(corban) #1

hi there,

it is annoying, i run into a very simple problem, which i know no solution for: when i set an object’s property via python it works well in blender publisher. but when i make a runtime (exe) version, it doesn’t work.

my very simple test script:


import GameLogic

controller = GameLogic.getCurrentController()
owner = controller.getOwner()
setattr(owner, "Text", "hullo")

the owner is a text object (meaning it has a bitmap font and it’s face is of type ‘text’)

is it (i hope so) a common prob?

thanx in advance, corban


(wiseman303) #2

Why are you using setattr()?

I’ve never seen anyone else do it that way, so I’m not sure if that’s your problem or not.

Just write it like this:

owner.Text = “hullo”


(corban) #3

i know that using obj.name = value is the same as setattr(obj, value). :wink: but using setattr allows you to customize the property name. but it does not matter how the property is beeing set,. it does not work when i make a runtime.

corban


(corban) #4

ok, i made the runtime on a different system (xp) as usual(win98se), now it works. what is going on there?

corban