Checking Actuator State

Hey everyone,

I have a question that I hope as a quick and simple answer. I have a .blend file that has a player navigating through an environment. All movement comes from f-curves, which are played by activating the actuator using a python script (see example below.) My problem is that when the player is already moving, another key press starts the movement over. I need the script to disregard any input until the player is done moving (or until actuator finishes playing the f-curve.) Any guidance on how to accomplish this?

import bge
from bge import logic

cont = logic.getCurrentController()
own = cont.owner
play_curve = cont.actuators['moveForward']
play_curve.mode = bge.logic.KX_IPOACT_PLAY #Play mode

#This function will play the move forward f-curve
def moveForward():
    play_curve.frameStart = 665
    play_curve.frameEnd = 840
    cont.activate(play_curve)
    #TODO: Remove this print statement.  Used for testing.
    print("moveForward Logged Successfully")


If you want to know what frame an IPO/Action/Curve actuator is simply set the frameProp property (with a float prop). The property will be filled with the last played frame number (read-only!).

I tried using that, but it seems to me that it is always reset to the first frame value when the curve is done playing. Using the example I had above, once the actuator has finished playing the curve, the frame property always prints out as 665. If I trigger the actuator again during execution, it will print out the correct frame (e.g., if it is half way done, it would print 752.) But when completed, it is back to 665. Am I missing something here?

Thanks again, Monster!

This depends on what mode the actuator is. I usually use the property mode. With that I have absolute control over the animation. But I guess that playmode does not reset too.
Could it be that you have other actuators running?