Why isn't this working ? when I #include my hovercraft od 7 code into my player pilot code it doesn't work, everything complies but I don't see the hovercraft or another matrix what is wrong?
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Player Pilot
REM Author :Ian George aka Vampyre
REM ****************************************************************
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 Include vehicles
#include "hovercraft mod7.dba"
rem Make drone to mark a back position
make object sphere 3,10
hide object 3
rem load hovercraft object
load object "TESTBOX.X", 2
rem Rotate and fix data so character faces right way
xrotate object 2,0
yrotate object 2,180
zrotate object 2,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
`position object 1,object position x(2),object position y(2),object position z(2)
rem check distance from vehicle
`if Pdist <0 or AIdist<0
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 2,1,4
` position object 2,0,0,0
` set object collision off 2
`endif
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 2,5000,5000,5000
cammode = 0
do
rem movement
rem forward
if upkey()=1 or keystate(17)
x# = newxvalue(x#,wrapvalue(AngleY#),10)
z# = newzvalue(z#,wrapvalue(AngleY#),10)
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#),-10)
z# = 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(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 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
xMouse=mousemovex()
yMouse=mousemovey()
AngleY#=wrapvalue(AngleY#+xMouse)
AngleX#=wrapvalue(AngleX#+yMouse)
Position object 2,x#,100,z#
rotate object 2,AngleX#,AngleY#,0.025
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
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 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
position camera object position x(3),object position y(3),object position z(3)
set camera to object orientation 2
Endif
sync
loop