Unable to find actuator

Lately I’ve been trying to find out how to python script. I’ve used some examples found on webpages, such as Ben’s speedometer . Now all I get is error messages saying “Unable to find actuator”.
What am I doing wrong?


import GameLogic
import math
cont=GameLogic.getCurrentController()
owner=cont.getOwner()

speed=owner.getVelocity()
speedt=math.pow(speed[0],2)+math.pow(speed[1],2)+math.pow(speed[2],2)
speedtot=(math.sqrt(speedt))*2
speedfinal=int(speedtot*36/300)

ve=cont.getActuator("ipoact")
ve.setType(1)
ve.setStart(speedfinal*0.8)
ve.setEnd(speedfinal)
GameLogic.addActiveActuator(ve,1)

perhaps you haven’t connected the actuator with the conroller which contains the script? or the name of the actuator isn’t “ipoact” (pay attention on the capitalisation!)

I have.
And it doesn’t work.

did you link the actuator to the python controller?

I’m not that stupid. :-? %| Of course I did connect it. And the actuator is named “ipoact”. However blender refuses to see the actuator.[/i]

if you’re using an actuator that requires an object/property/mesh/action name then you have to put a dummy name in to begin with, even if you intend to change it using a script. If you just leave it blank, then blender will ignore the actuator as if it doesn’t exist. That could be the problem here. :-?

Keith. 8)

Dummy name? :expressionless: … Doesn’t ring any bells…
Could you give an example?
(please keep in mind that I didn’t write that script. I barely even understand how it works. :-? :x )

okay. Say you’re using a replace mesh actuator. the actuator has a box for you to enter the mesh name. This is the box that you must not leave blank. You can put any mesh name in here as a dummy, it doesn’t matter what mesh you use if the script is going to change it anyway. So just put in something like Plane or Plane.001, or any of the mesh names in your game.

Ofcourse the mesh name in the actuator will matter if the script won’t be changing it, but then it wouldn’t be blank in the first place.

Keith. 8)

Problem is, I’m using an Ipo actuator so there is no place to put the dummy name.:frowning:
What now? :-?

Hmmm… that can’t be the problem then. Send me a copy of the blend file to gorgan_almighty@yahoo.co.uk (if it’s not too big) and I’ll have a look for you. :slight_smile:

Keith. 8)

I sent it over pretty long ago, have you found the issue? :expressionless:

Yeah sorry I took so long replying, I’ve just emailed you the solution to your problem! :smiley:

Keith. 8)