GamePython Tutorials Needed

I am in need of some basic but well-written tutorials for the use of Python in the blender GE.

Please post a link to any good BGE-python tutorials you know of.

Thank You.

maybe I could write something new and up to date?
What do you want to know?


well, since you made the offer, how about a tutorial on setting up a vehicle from scratch? And perhaps explain the role of the parameters in the python command (the addWheel I think) that the makes the magic? I tried a couple of times based on the steering_fix demo of 2.42 but it went down the drain…

I’v been planning to write a few tutorials for ages, but just never got around to it. Anyway…

Basic you want, basic you get:

maybe I shouldn’t have made the offer so vague, since I’m new to python. But maybe that’s a good thing, a newbie can perhaps explain it better to another newbie. I will try to make something useful

So has no one made any decent newbie python tutorials for BGE that takes you step by step through at all?:confused:

there’s the commands…
It’s just the structure and how to use variables and loops.

For example:
if you want an action to be played when an property reaches a value you would do something like:

cont = GameLogic.getCurrentController() #so we can write 'cont' instead of GameLogic.getCurrenController()
own = cont.getOwner() #so we can write own instead of cont.getOwner()

act = cont.getActuator("action") #need a link to an action logic brick called action

if (own.a > 100):
        act.setAction("jump")  #found in the game logic list of python code in link above
        GameLogic.addActiveActuator(act,1) #the way you activate an actuator

Okey, it’s in the middle of the night so there might be some mistakes… but the important thing is:
variables (a = 5, if you write a it will bring up the number 5)
properties (own.a brings data from the protery a)
if, elif, else (to compre things, like if(a>own.a): or if(a<b and own.a = 5):
sensors and actuators (getSensor/getActuator)

or something

3DGURU managed to write one beginner’s tut on the subject before he went on his “year away.” I ran a forum search on “Python tut” and found the link for you. Here it is: Become a Python GURU now!

Writing some basic Python tuts has been on my list of things to do since p00f decided to plunge in to coding… Maybe I’ll get around to it soon.