Property to set Throttle

I need someone to give me a start on a basic aircraft Throttle script

I have done this in Game Engine GUI and it works, and now i want to know how to do it with python
(Apparent when you do the print dir function, it no longer outputs the data into the debugger, which has got me horribly confused)

basically, the is a throttle property
the property can be increased or decreased with different keys (e.g. + or -)
and, the actuator takes the info and outputs the correct amount of speed
to keep it simple i tried it with throttle (max 100, goes up in tens)
so when throttle property equals 10 = force equals ten or whatever basically

now, i cant work out how to get the property (i tried getProperty(“x”) but it didnt work)

and i dont know ho to set value or increase value
and i also dont know how to cap it at min 0 and max 100(the only way i could do it was adding a sensor that made the value 0 when it was -10 and 100 when it was 110):spin:

and yes, i did look at the Game Logic API and i couldnt make tail or head out of it

are there any tuts on how to do this?

someone plz help:o

do this
co = GameLogic.getCurrentController()
o = co.getOwner()
#then access your property with :o.yourPropertyName
#you write to it
o.yourPropertyName = … # or += etc… just like usual python
#and read it
print o.yourPropertyName…

you can code all of this with logic bricks
here’s how I’d do

an int property named “speed”
keyboard sensor : if key +
=> linked to
expression controller : the expression to enter would be : speed < 100 AND speed > -10
=>linked to
property actuator : add 1 to property speed

keyboard sensor : if key -
=> linked to
expression controller : the expression to enter would be : speed < 100 AND speed > -10
=>linked to
property actuator : add -1 to property speed

so… all of this is nice
one problem though is that to set the amount of speed or force to apply to your object, there’s no write to script that with just logic bricks…
so what you should do, is have a python controller, which reads the amount of speed, and why not readapt that into another amount value (for example, take the speed property and divide it by 10), and then sets up a motion actor (by using theActuator.setForce(a vector of things) and triggers the latter.

so… you could do a mix of python and logic bricks with more or less python… here I will put something with almost-full python. There’s are many solutions a single problem… so you could imagine other ways to do that.
http://www.ece.fr/~schroder/showPlace/gameEngineCustomEditMotionAct.blend
what I’ve done with the speedScript could have been done in normal logic bricks as I’ve shown above
it’s just here, because I had assembled speedScript and alwaysAct together in one single file at the beginning but separated them for a more interesting design

i kinda get what u mean, and im having a good look at ur blend
thx alot!

That ‘alwaysact’ script with your blend is brilliant. Awesome and simple. I might use this…
Thank you