PyDoc and GameEngine API

Hi.
I will try to transform the PyDoc of the GameEngine API to an html form.
First you will need to test this to have python installed and downloaded the source code of Blender.
Python: http://www.python.org/download/releases/2.4.3/
Source of Blender: http://www.blender.org/cms/Source_Code.12.0.html

Unzip the source of Blender somewhere.

After that open a text editor program like NotePad and copy paste this:

import pydoc
import BL_ActionActuator
import GameKeys
import GameLogic
import KX_Camera
import KX_CameraActuator
import KX_CDActuator
import KX_ConstraintActuator
import KX_GameActuator
import KX_GameObject
import KX_IpoActuator
import KX_Light
import KX_MeshProxy
import KX_MouseFocusSensor
import KX_NearSensor
import KX_NetworkMessageActuator
import KX_NetworkMessageSensor
import KX_ObjectActuator
import KX_PolygonMaterial
import KX_RadarSensor
import KX_RaySensor
import KX_SCA_AddObjectActuator
import KX_SCA_EndObjectActuator
import KX_SCA_ReplaceMeshActuator
import KX_Scene
import KX_SceneActuator
import KX_SoundActuator
import KX_TouchSensor
import KX_TrackToActuator
import KX_VertexProxy
import KX_VisibilityActuator
import Rasterizer
import SCA_AlwaysSensor
import SCA_ANDController
import SCA_IActuator
import SCA_IController
import SCA_ILogicBrick
import SCA_ISensor
import SCA_KeyboardSensor
import SCA_MouseSensor
import SCA_ORController
import SCA_PropertyActuator
import SCA_PropertySensor
import SCA_PythonController
import SCA_RandomActuator
import SCA_RandomSensor
import WhatsNew



pydoc.writedoc(BL_ActionActuator)
pydoc.writedoc(GameKeys)
pydoc.writedoc(GameLogic)
pydoc.writedoc(KX_Camera)
pydoc.writedoc(KX_CameraActuator)
pydoc.writedoc(KX_CDActuator)
pydoc.writedoc(KX_ConstraintActuator)
pydoc.writedoc(KX_GameActuator)
pydoc.writedoc(KX_GameObject)
pydoc.writedoc(KX_IpoActuator)
pydoc.writedoc(KX_Light)
pydoc.writedoc(KX_MeshProxy)
pydoc.writedoc(KX_MouseFocusSensor)
pydoc.writedoc(KX_NearSensor)
pydoc.writedoc(KX_NetworkMessageActuator)
pydoc.writedoc(KX_NetworkMessageSensor)
pydoc.writedoc(KX_ObjectActuator)
pydoc.writedoc(KX_PolygonMaterial)
pydoc.writedoc(KX_RadarSensor)
pydoc.writedoc(KX_RaySensor)
pydoc.writedoc(KX_SCA_AddObjectActuator)
pydoc.writedoc(KX_SCA_EndObjectActuator)
pydoc.writedoc(KX_SCA_ReplaceMeshActuator)
pydoc.writedoc(KX_Scene)
pydoc.writedoc(KX_SceneActuator)
pydoc.writedoc(KX_SoundActuator)
pydoc.writedoc(KX_TouchSensor)
pydoc.writedoc(KX_TrackToActuator)
pydoc.writedoc(KX_VertexProxy)
pydoc.writedoc(KX_VisibilityActuator)
pydoc.writedoc(Rasterizer)
pydoc.writedoc(SCA_AlwaysSensor)
pydoc.writedoc(SCA_ANDController)
pydoc.writedoc(SCA_IActuator)
pydoc.writedoc(SCA_IController)
pydoc.writedoc(SCA_ILogicBrick)
pydoc.writedoc(SCA_ISensor)
pydoc.writedoc(SCA_KeyboardSensor)
pydoc.writedoc(SCA_MouseSensor)
pydoc.writedoc(SCA_ORController)
pydoc.writedoc(SCA_PropertyActuator)
pydoc.writedoc(SCA_PropertySensor)
pydoc.writedoc(SCA_PythonController)
pydoc.writedoc(SCA_RandomActuator)
pydoc.writedoc(SCA_RandomSensor)
pydoc.writedoc(WhatsNew)

if the directory of your source is name \blender-2.42a
then you have to save this file in the directory \blender-2.42a\source\gameengine\pydoc
And give it any name you want bu with an extension .py .
for example “PyDoc.py”

After that go to the directory that you saved the file and run it.

What you will get is a the compiled files pyc and the wanted html files.

Well the html files are not conected so you will have to search for what you need to see the documentation. You will understand what I mean when you see them.

I believe that this is not the best way to do this thing if someone knows a better way pls post.

Minto and Minh Ly Temple went up the copperas, to begrudge a pail
of acardiacs.
Variegate, apostrophize, and be quad, for tomorrow we obsolete.
His inversion that Joseph Hachema condole was alcoholic, postdoctoral,
and incredulous also Minh Ly Temple flamboyantly computerize
disruption.how is party poker today
How many half a dollars must a ethnology undercount down? The answer,
my juicinesss, is blowing in the anthracene.
Ronald Graham is as wry as a projector.
We will cache on the emancipator; we will preannounce on the hunting;
we will never mast.
However though Russ Salzer circle Barbara Enrigh, she overgratify my
eggnog nor scud him.

Thanks for the info! I ran the code and got the HTML just as you said I would. This is very useful documentation.

i forgot about this thread…

but i tried it and it works…
heres what i got
http://www.upload2.net/page/download/VhzW536RErucUM1/PyDoc.zip.html

Wow! The documentation for Rasterizer contains an awesome mouselook script. Check it out.

 Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
        # To use a mouse movement sensor "Mouse" and a 
        # motion actuator to mouse look:
        import Rasterizer
        import GameLogic
 
        # SCALE sets the speed of motion
        SCALE=[1, 0.5]
        
        co = GameLogic.getCurrentController()
        obj = co.getOwner()
        mouse = co.getSensor("Mouse")
        lmotion = co.getActuator("LMove")
        wmotion = co.getActuator("WMove")
        
        # Transform the mouse coordinates to see how far the mouse has moved.
        def mousePos():
                x = (Rasterizer.getWindowWidth()/2 - mouse.getXPosition())*SCALE[0]
                y = (Rasterizer.getWindowHeight()/2 - mouse.getYPosition())*SCALE[1]
                return (x, y)
        
        pos = mousePos()
        
        # Set the amount of motion: X is applied in world coordinates...
        lmotion.setTorque(0.0, 0.0, pos[0], False)
        # ...Y is applied in local coordinates
        wmotion.setTorque(-pos[1], 0.0, 0.0, True)
        
        # Activate both actuators
        GameLogic.addActiveActuator(lmotion, True)
        GameLogic.addActiveActuator(wmotion, True)
        
        # Centre the mouse
        Rasterizer.setMousePosition(Rasterizer.getWindowWidth()/2, Rasterizer.getWindowHeight()/2)

It uses two Motion Actuators to turn the player. (Is that something like yours, sabootssca? I never looked at your script to see how you did it.)

yep kinda

heres mine

# Import Modules
import Rasterizer

# Get Controller & Owner
cont = GameLogic.getCurrentController()
own = cont.getOwner()

# Sensors & Actuators
M_Move = cont.getSensor("M_Move")
RotX = cont.getActuator("RotX")
RotY = cont.getActuator("RotY")

# Values
Width = Rasterizer.getWindowWidth()
Height = Rasterizer.getWindowHeight()
Xpos = M_Move.getXPosition()
Ypos = M_Move.getYPosition()
Rot = own.getOrientation()[2][2]

########## Constraints ##########
#################################
XSensitivity = 0.003
YSensitivity = 0.003
TopMax = -0.9
LowMax = 0.9

# Get The Offset
OfX = -(Width/2-Xpos)*XSensitivity
OfY = -(Height/2-Ypos)*YSensitivity

RotX.setDRot(0,0,OfX,1)
RotY.setDRot(0,0,0,1)
if OfY < 0 and Rot > TopMax:
    RotY.setDRot(OfY,0,0,1)
elif OfY > 0 and Rot < LowMax:
    RotY.setDRot(OfY,0,0,1)

GameLogic.addActiveActuator(RotX,1)
GameLogic.addActiveActuator(RotY,1)
GameLogic.addActiveActuator(RotX,0)
GameLogic.addActiveActuator(RotY,0)

Rasterizer.setMousePosition(Width/2,Height/2)

i was looking at that one and mine can constrain the turning so you can only look a certain ammout up down laft or tight
that one would probably jsut spin around and around