Dynamic text?

I’m trying to figure out a way to make a text object change dynamically, but setValue doesn’t seem to work as I expect.

Here’s a little example: http://userpages.umbc.edu/~smyth1/blender/TextSettingDebug.blend

getValue does indeed return the value that I assigned it, so setValue is certainly working. And getProperty does indeed return the property I’m trying to assign. So, does that mean dynamic text doesn’t work?

Thanks!

Using this method to set property values is… kinda strange, but you can make it work. A much simpler solution is to directly set the property with something like this:


cont = GameLogic.getCurrentController()
own = cont.getOwner()
own.Text = "Yes"

With your code, you’re only changing the value that the property actuator is setting. You’re not actually changing the property, you’re just telling the actuator “when you’re active, this is what you’ll set that property to.” You have to activate the property actuator with GameLogic.addActiveActuator(propAct, 1), only then will it actually perform the action. Imagine setValue and getValue just like typing in the value and getting the value put in in the value field of the property actuator.

Hope that helps!

-Sam

Ahh, I didn’t realize properties could be directly assigned like that, thanks.