Odds

is there a way to tell if a property is a odd number? oh and is there a way to uv map a scene to a game, or something like that?

In python, you can use what’s called the modulus operator but in reality is the percent symbol:


if object.property % 2 == 0 :
    print "property is even."


The operator gives the remainder of a division.

can i do it in expression controller?

Beats me. I never use them.

is there a script already made?

All you need is the normal introductory stuff for any python script:


import GameLogic
cont = GameLogic.getCurrentController()
act = cont.getActuator("nameOfYourActuator")
owner = cont.getOwner()
if owner.property % 2 == 0:
    GameLogic.addActiveActuator(act,1)

It’s not really owner.property, you would change that to the name of your property, like owner.health. You would probably want to start it with a property sensor set to changed.