Okay, I have 32 objects each with an action actuator attached to a controller with the following initialization code, (fired by a run-once always sensor.)
# adds the controller name into a property attached to the piece this should allow
# me to get the controller and activate any attached actuators
def init_controllers(controller):
controller.owner["controller"] = controller
#debug
print("initialized the controller property for ",controller.owner.name)
return
On the game board tiles, I have the following code that tries to take control of a selected controllers actuators.
# testing
j_key = SensorList["j-key"]
scene = GameLogic.getCurrentScene()
knight = scene.objects["Black-Knight-queen"]
knight_controller = knight["controller"]
print("looking for j-key")
if j_key.positive:
print("okay, I am trying to activate actuator")
actList = knight_controller.actuators
jiggleMove = actList["jiggle-move"]
<b>knight_controller.activate(jiggleMove)</b> # error is here
Everything seems to work until I try to activate the actuator jiggle-move, when I get the following output.
Python script error - object 'e8', controller 'Python':
Traceback (most recent call last):
File "C:\Documents and Settings\Hope\Desktop\Blender-Chess\chess.py", line 239, in move_piece
knight_controller.activate(jiggleMove)
<b>SystemError: Cannot add an actuator from a non-active controller</b>
Am I on the correct track here and, if so, how can I activate the objects controller. If not, I would be grateful for a bit of direction.
Irvine