By the way, i fully debugged your code:
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Solar Dominion Test Level
REM Author :Ian George aka Vampyre
REM ****************************************************************
REM ****************************************************************
autocam off
hide mouse
sync rate 60
sync on
Make matrix 1,10000,10000,20,20
Rem texture matrix
load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem Randomize the matrix
randomize matrix 1,125
update matrix 1
X#=5000
Z#=5000
rem Make drone to mark a back position
make object sphere 3,10
hide object 3
rem load player object
load object "Testbox.X", 2
rem Rotate and fix data so character faces right way
rotate object 2,0,180,0
fix object pivot 2
X# = object position X(2)
Z# = object position Z(2)
Y# = Get ground height(1,X#,Z#)
Position object 2,X#,Y#,Z#
AngleY# = 0.0
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 2,500,500,500
cammode = 0
`*****************************************************
`There is no loop for this do command
`*****************************************************
do
rem movement
if upkey()=1 or keystate(17)
XTEST# = newxvalue(x#,wrapvalue(AngleY#),10)
ZTEST# = newzvalue(z#,wrapvalue(AngleY#),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
x#=XTest#
z#=ZTest#
Endif
Endif
if downkey()=1 or keystate(31)
XTEST# = newxvalue(x#,wrapvalue(AngleY#),-10)
ZTEST# = newzvalue(z#,wrapvalue(AngleY#),-10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
x#=XTest#
z#=ZTest#
Endif
Endif
rem left
if leftkey()=1 or keystate(30)
XTEST# = newxvalue(x#,wrapvalue(AngleY#-90),10)
ZTEST# = newzvalue(z#,wrapvalue(AngleY#-90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
x#=XTest#
z#=ZTest#
Endif
Endif
rem right
if rightkey()=1 or keystate(32)
XTEST# = newxvalue(x#,wrapvalue(AngleY#+90),10)
ZTEST# = newzvalue(z#,wrapvalue(AngleY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
x#=XTest#
z#=ZTest#
Endif
Endif
xMouse=mousemovex()
yMouse=mousemovey()
AngleY#=wrapvalue(AngleY#+xMouse)
AngleX#=wrapvalue(AngleX#+yMouse)
Position object 2,x#,100,z#
rotate object 2,AngleX#,AngleY#,0
point camera x#,y#,z#
sync
loop
rem *********************************************************************
rem Player Hovercraft Jumping
rem *********************************************************************
if jumpb=1
height#=height#-.7
endif
if mouseclick()=2 or spacekey()=1 or joystick fire x(4) and ajump=1
jumpb=1
height#=150
endif
if height#<-13 then height#=-13
if object position y(2)>100 then ajump=0 else ajump=1
position object 2,object position x(2),object position y(2)+height#,object position z(2)
if object position y(2)<100
jumpb=0
height#=0
endif
`************************************************************
`There is no endif to this if/else statement below
`************************************************************
If PDist<0
position object 2,object position x(4),object position y(4),object position z(2)
endif
`************************************************************
`There is no endif to this if statement below
`************************************************************
if scancode()=36
position object 2,object position x(2),object position y(2),object position z(2)
endif
rem load hovercraft object
load object "Testbox.X",4
rem Rotate and fix data so character faces right way
xrotate object 4,0
yrotate object 4,360
zrotate object 4,0
fix object pivot 4
X# = object position X(4)
Z# = object position Z(4)
Y# = Get ground height(1,X#,Z#)
Position object 2,x,100,y
AngleY# = 0.0
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 4,3000,3000,3000
cammode = 0
do
rem movement
if joystick left()=1 then AngleY# = wrapvalue( AngleY# - 1.5 )
if joystick right()=1 then AngleY# = wrapvalue( AngleY# + 1.5 )
rem forwards
if joystick slider a()=0 or upkey()=1 or keystate(17)
XTEST# = newxvalue(x#,wrapvalue(AngleY#),30)
ZTEST# = newzvalue(z#,wrapvalue(AngleY#),30)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
x#=XTest#
z#=ZTest#
Endif
Endif
rem backwards
if joystick slider a()=64852 or downkey()=1 or keystate(31)
x = newxvalue(x,wrapvalue(AngleY#),-30)
z = newzvalue(z,wrapvalue(AngleY#),-30)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
rem left
if joystick twist z()=1000 or leftkey()=1 or keystate(32)
x = newxvalue(x,wrapvalue(AngleY#+90),10)
z = newzvalue(z,wrapvalue(AngleY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
rem right
if joystick twist z()=-1000 or rightkey()=1 or keystate(30)
x = newxvalue(x,wrapvalue(AngleY#-90),10)
z = newzvalue(z,wrapvalue(AngleY#-90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Position object 4,x,100,z
yrotate object 4,AngleY#
rem *********************************************************************
rem Player Hovercraft Jumping
rem *********************************************************************
if jumpb=1
height#=height#-.7
endif
if joystick fire x(4) and ajump=1
jumpb=1
height#=150
endif
if height#<-13 then height#=-13
if object position y(4)>100
ajump=0
else
ajump=1
endif
position object 4,object position x(4),object position y(4)+height#,object position z(4)
if object position y(4)<100
jumpb=0
height#=0
endif
REM **************************************************************************
REM Camera Control 1st and 3rd Person
REM **************************************************************************
If InKey$() = "1" Then cammode = 1 : ` third person
If InKey$() = "2" Then cammode = 0 : ` first person
If cammode = 0
rem Place camera and set orientation to object for FPS
position camera object position x(2),object position y(2)+40,object position z(2)
set camera to object orientation 2
endif
`************************************************************************
`What is this endif supposed to go to?
`************************************************************************
if lookRight = 1 then turn camera right 90.0
if lookLeft = 1 then turn camera left 90.0
if lookUp = 1 then pitch camera up 45.0
if lookBack = 1 then turn camera right 180.0
else
rem Place as over head for 3rd person
move object 2,-150
position object 3,object position x(2),object position y(2),object position z(2)
move object 2,150
rem Place camera and set orientation to object
`*****************************************************************************
`this object position z(3) at the last of this next line is missing the z
`*****************************************************************************
position camera object position x(3),object position y(3),object position z(3)
set camera to object orientation 2
sync
loop