Coordinated control of actuators with Python in Game Engine

Hi all,

I’m taking a somewhat unusual approach to doing coordinated control of actuators in order to generate a physical simulation.

I have one Always sensor associated with a ground plane in my simulation that creates a dictionary called GameLogic.Objects.

For every object that I want to control in a coordinated manner, I have an associated property called Init and a property sensor that runs whenever Init is set to one. The controller linked to the property sensor is a Python script that puts a reference to the object’s controller into the dictionary.

Now, using the dictionary from a master controller (running off an Always sensor), I can access controllers for any initialized objects and update their actuators. (This approach is from this post:

Fine - I can get a controller for an initialized object, any actuator linked to that controller, and I can even get and set values for, for example, the Y-axis rotation of a motion actuator. My problem comes when I call GameLogic.addActiveActuator with the updated actuator - absolutely nothing happens. The state of the actuator is being preserved because the next time through the loop, the value of rotation is updated, but the body in the animation hasn’t moved. If I do the same thing just from within a Python controller script for a single object (without all the dictionary stuff), it works fine and the object gets rotated.

Anyone seen this problem before with calling addActiveActuator in a “master” controller script? I’d be happy to post my blend file and scripts if anyone thinks it’ll help.