I am still getting this damn syntax error what is going on? I even put in the endif where the camode is and I am still getting it
Rem * Title : Test Level 1
Rem * Author : Ian George
Rem * Date : 21/09/04
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Solar Dominion TEST LEVEL 1
REM Author :Ian George aka Vampyre
REM ****************************************************************
REM ****************************************************************
REM ****************************************************************
REM ****************************************************************
autocam off
hide mouse
sync rate 60
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 3D object and append walking data to it
LOAD OBJECT "Walk.x",1 : APPEND OBJECT "walk.x",1,100
rem Rotate and fix data so character faces right way
xrotate object 1,0
yrotate object 1,180
zrotate object 1,0
fix object pivot 1
X# = object position X(1)
Z# = object position Z(1)
Y# = Get ground height(1,X#,Z#)
Position object 1,X#,Y#,Z#
`position object 1,object position x(2),object position y(2),object position z(2)
rem check distance from vehicle
if (playerX#-hovertankX#)^2+(playerZ#-hovertankZ#)^2 <= 160
rem If chartacter collides with vehicle
if object collision(vehicle,player)=1
rem get into vehicle and make sure pilot is not detected anymore
glue object to limb 1,2,23
position object 1,0,0,0
set object collision off 1
hide object 1
endif
set object collision on 1
REM Variables
player = 1
Hovertank = 2
inVehicle = 0
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 1,100,100,100
cammode = 0
do
gosub _UpdateAircraft
gosub _UpdateHovertank
gosub _UpdatePlayer
sync
loop
rem movement
rem Modify character angle based on left/right keys
_UpdatePlayer:
if inVehicle = 0
stage=0
if upkey()=1 or keystate(17)
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 backward
if 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 leftkey()=1 or keystate(30)
x# = newxvalue(x#,wrapvalue(AngleY#-90),30)
z# = newzvalue(z#,wrapvalue(AngleY#-90),30)
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)
x# = newxvalue(x#,wrapvalue(AngleY#+90),30)
z# = newzvalue(z#,wrapvalue(AngleY#+90),30)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,40
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,40
ENDIF
oldstage=stage
ENDIF
xMouse=mousemovex()
yMouse=mousemovey()
AngleY#=wrapvalue(AngleY#+xMouse)
AngleX#=wrapvalue(AngleX#+yMouse)
Position object 1,x#,60,z#
rotate object 1,AngleX#,AngleY#,0.025
a#=wrapvalue(a#)
rem Player jumping
if controlkey()=1 and ajump=1
jumpb=1
height=60
endif
if jumpb=1
height=height-1
position object 1,object position x(1),object position y(1)+height,object position z(1)
endif
if object position y(1)>100 then ajump=0 else ajump=1
if object position y(1)<100
position object 1,object position x(1),100,object position z(1)
jump=0
height=0
endif
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 2,1000,1000,1000
rem load hovercraft object
load object "CDHTANK1.X", 2
rem movement
if joystick left()=1 then AngleY# = wrapvalue( AngleY# - 1.5 )
if joystick right()=1 then AngleY# = wrapvalue( AngleY# + 1.5 )
if joystick up()=1 then pitch object up 2, 10
if joystick down()=1 then pitch object down 2,10
rem forwards
if joystick slider a()=0 or upkey()=1 or keystate(17)
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 backwards
if joystick slider a()=65535 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 right
if joystick twist z()=1000 or rightkey()=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 left
if joystick twist z()=-1000 or leftkey()=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 2,x,100,z
yrotate object 2,AngleY#
rem jumping
if controlkey()=1 or joystick fire x(5) and ajump=1
jumpb=1
height=150
endif
if jumpb=1
height=height-1
position object 2,object position x(2),object position y(2)+height,object position z(2)
endif
if object position y(2)>100 then ajump=0 else ajump=1
if object position y(2)<100
position object 2,object position x(2),100,object position z(2)
jump=0
height=0
endif
endif
endif
rem check distance from vehicle
if (playerX#-aircraftX#)^2+(playerZ#-aircraftZ#)^2 <= 160
rem If chartacter collides with vehicle
if object collision(vehicle,player)=1
rem get into vehicle and make sure pilot is not detected anymore
glue object to limb 1,3,4
position object 1,0,0,0
set object collision off 1
hide object 1
rem Aircraft Object
load object "AIRPL043.X", 3
rem Rotate and fix data so character faces right way
xrotate object 3,0
yrotate object 3,180
zrotate object 3,0
fix object pivot 3
position object 3,x,150,z
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 3,1000,1000,1000
rem movement
if joystick up()=1 then pitch object up 3,5
if joystick down()=1 then pitch object down 3,5
if joystick left()=1 then turn object left 3,5
if joystick right()=1 then turn object right 3,5
if joystick twist z()=1000 then roll object left 3,5
if joystick twist z()=-1000 then roll object right 3,5
if joystick slider a()=0 then move object 3,1000
if joystick slider a()=65535 then move object 3,-60
rem VTOL take off and landing
if controlkey()=1 or joystick fire x(5)
position object 2,object position x(2),object position y(2)+height,object position z(2)
height=90
endif
if spacekey()=1 or joystick fire x(4)
position object 2,object position x(2),object position y(2)-10,object position z(2)
height=height-1
endif
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(1),object position y(1)+60,object position z(1)
set camera to object orientation 1
endif
endif
endif
If Invehicle=1
rem Set the hat look flags to nothing
lookUp = 0: lookLeft = 0: lookRight = 0: lookBack = 0
if jhat = 0 then lookUp = 1
if jhat=9000 or jhat=4500 or jhat=13500 then lookRight = 1
if jhat=31500 or jhat=27000 or jhat=22500 then lookLeft = 1
if jhat = 18000 then lookBack = 1
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 camera and set orientation to object for FPS
position camera object position x(1),object position y(1)+60,object position z(1)
set camera to object orientation 1
rem Place for 3rd person
move object 1,-150
position object 3,object position x(1),object position y(1),object position z(1)
move object 1,150
rem Place camera and set orientation to object
position camera object position x(3),object position y(3),object position z(3)
set camera to object orientation 1
Endif
sync
loop