Python and Ipo Actuator

I’ve been tring to use python to change the start and end frame of an Ipo actuator…

 
if(condition):
      actuator.setStart(10)
      actuator.setEnd(20)
else:
      actuator.setStart(30)
      actuator.setEnd(40)

GameLogic.addActiveActuator(actuator,1)


when the script runs, all sorts of weird things happen. For example, the animation ends up playing from frame 10 to 40 instead of 30 to 40 like its supposed to. It seems like its just a bug…but maybe somebody out there has encountered this problem and knows a solution. Any help would be appreciated.

Sounds like there’s a fault with your condition, it’s returning true when it should be returning false. Check it and see if its wrong. Or tell us what your condition is so we can advise you further.

Keith. 8)

My conditions are working perfectly, so I know that thats not the problem. My code is a little more complicated than what I posted. I figured I’d just post the part that I knew was giving me the problem. Because I’ve checked everything else and it is working fine…

It looks like the condition is always returning false.

I have done this before on many different situations (like and ipo for a health bar) and it has worked fine for me so there is no bug.

Here is an example of what is happening: example.blend

My conditions are working the way they are supposed to!!!

(edited a misunderstanding away, didn’t find the reason)