I've got a bsp loaded, an MD2 model loaded. But when i try to add control to the model loaded it moves in a wierd way, as if the axis are screwed. Heres my code:
Sync On : Sync Rate 0 : Color Backdrop RGB(0, 0, 0) : Hide Mouse : AutoCam Off : Ink RGB( 0, 255, 0), RGB( 0, 255, 0)
Load Object "Mesh\Tris.md2", 1
Load Image "Mesh\char.tga", 2
Scale Object 1, 5.8, 5.8, 5.8
Texture Object 1, 2
Position Object 1, 0, 1.8, 0
Loop Object 1, 0, 38
Load BSP "testpak.pk3", "test2.bsp"
Position Camera 0, 1.8, -1.8
Set BSP Camera 0
set bsp camera collision 1, 0, 1.3, 0
DoDiag = 0
Do
GoSub Keys
Sync
Loop
Keys:
If Scancode() = 30 Then Position Camera 0, Camera Position X(), Camera Position Y() + 0.2, Camera Position Z()
If Scancode() = 44 Then Position Camera 0, Camera Position X(), Camera Position Y() - 0.2, Camera Position Z()
If UpKey() = 1 Then Move Object 1, 0.2
If DownKey() = 1 Then Move Object 1, -0.2
If LeftKey() = 1 Then Turn Object Left 1, 0.2
If RightKey() = 1 Then Turn Object Right 1, 0.2
If EscapeKey() = 1 Then End
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
If Scancode() = 42
If DoDiag = 0 Then DoDiag = 1 Else DoDiag = 0
EndIf
If DoDiag = 1 Then GoSub Diag
Return
Diag:
`TODO
`Tri Count, Screen Mode, Pk3 File, Bsp Loaded
Text 0, 0, "[ FPS ] "+Str$(Screen FPS())
Text 0, 22, "[ Camera Axis ]"
Text 0, 33, "[ X ] "+Str$(Camera Position X())
Text 0, 44, "[ Y ] "+Str$(Camera Position Y())
Text 0, 55, "[ Z ] "+Str$(Camera Position Z())
Return
Can any1 see an error in my code, bar the fact that its messy?
Its these two lines that are giving me grief:
"If UpKey() = 1 Then Move Object 1, 0.2
If DownKey() = 1 Then Move Object 1, -0.2"
The object doesn't move forwards it moves sideways.
¥öü ®å§Ë tHË ß|å�Ë, ¥öü måkË tHË ÇHåñgË, ¥öü ®Ëå®åñgË mË tî|| î'm §åñË