using operators in game python ???

hey is this possible to do…? eg… to mod a number or use some other operator… don’t know what I mean? have a look at this link to the python site…

also where do I find documentation on this kind of thing in the game engine…? can I use sin and tan etc… how do I do that…? I have to import the math module somehow. I’ve tried looking but can’t find python specfically of the game engine on how to do these things. pls. help:yes:

You should be able to use all standard Python operators in the Game Engine. There is no special documentation on using operators or math utils in the Game Engine. Aside from it’s special modules, classes and functions, Game Engine Python is the same as normal Python. Some libraries are not included in the Python24.dll file, so you will need to include extra libraries you use with the distribution of your game.

You should be able to import the math library using “import math”, then use its functions like this “math.sin()” or “math.tan()” etc. If you use the code “from math import *”, then you can reference its function directly like this “sin()” or “tan()” etc. If you are getting an error on the console saying “No module name math” or something similar, that means Blender can’t find the math module, and you should make sure there is a copy of in the working directory for your game.

Hi thanks for the info… yes I’m getting the no math module error in the cmd prompt… I downloaded python 2.4… (is that the correct version of python I should be using?) where would I find the math library… looked in all the directories for it?.. edit… okay I was using the wrong version of blender… I got the modules importing… but nothing is happening… i will post an image…


I got the operators working… thanks again!