Hi er I need help in updating my objects
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Solar Dominion in and Out of Vehicle Test
REM Author :Ian George aka Vampyre
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM****************************************************************
autocam off
hide mouse
sync rate 60
sync on
REM Variables
invehicle=0
inaircraft=0
object1 = 1
Rem Backdrop On
Backdrop on
REM FOG
Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)
REM Make Matrix
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 Make drone to mark a back position
make object sphere 3,10
hide object 3
REM player object
load object "H-Babe-Move.X", 1
REM Get Ground Height
Y# = Get ground height(1,X#,Z#)
Position object 1, X#+1,Y#+0.30,Z#
REM Aircraft Object
load object "AIRPL043.X", 4
REM Object Collisions
Set object collision to spheres 4
set object collision on 4
rem Rotate and fix data so character faces right way
xrotate object 4,0
yrotate object 4,180
zrotate object 4,0
fix object pivot 4
Position object 4, X#+1,Y#+0.70,Z#
rem Hovercraft Object
load object "Hover1.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
REM Get Ground Height
Y# = Get ground height(1,X#,Z#)
Position object 2, X#+1,Y#+0.50,Z#
rem scaling to 10% (YOU WILL NEED TO ADJUST THIS)
scale object 2,100,100,100
cammode = 0
REM Object angles
aircraftX# = 200.0
aircraftcraftY# = 3.0
aircraftZ# = 200.0
aircraftAngY# = 0.0
hovercraftX# = 150.0
hovercraftY# = 3.0
hovercraftZ# = 150.0
hovercraftAngY# = 0.0
object1X# = 50.0
object1Y# = 3.0
object1Z# = 50.0
object1AngX# = 0.0
object1AngY# = 45.0
camX# = 0.0
camY# = 0.0
camZ# = 0.0
camAngX# = 0.0
camAngY# = 0.0
_Input:
if controlkey()
if oldctrl = 0
ctrl = 1
else
ctrl = 0
endif
oldctrl = 1
else
oldctrl = 0
ctrl = 0
endif
if keystate(47)
if oldv = 0
v = 1
else
v = 0
endif
oldv = 1
else
oldv = 0
v = 0
endif
if v = 1
if object1View = 0 then object1View = 1 else object1View = 0
endif
return
REM MAIN PROGRAM LOOP
do
gosub _Input
gosub _UpdateHovercraft
gosub _UpdateObject1
gosub _UpdateAircraft
sync
loop
inVehicle = 0
Object1View = 0
REM Player pilot controls
_UpdateObject1:
If invehicle=0
if object visible(1)=0 then show object 1
ncxa#=camera angle x()
ncya#=camera angle y()
nibopx#=object position x(1)
nibopy#=object position y(1)
nibopz#=object position z(1)
position camera object position x(1),object position y(1),object position z(1)
rotate camera object angle x(1),object angle y(1),object angle z(1)
wvtx=object angle x(1)
wvty=object angle y(1)
wvtz=object angle z(1)
wcax=wrapvalue(wvtx)
wcay=wrapvalue(wvty)
wcaz=wrapvalue(wvtz)
rotate camera wrapvalue(cxa#),cya#,0
rotate object 1,0,camera angle y(),0
position camera object position x(1),object position y(1),object position z(1)
rotate object 1,0,camera angle y(),0
position camera object position x(1),object position y(1),object position z(1)
if keystate(17)=1 or upkey()=1 then x#=newxvalue(x#,cya#,16.0) : z#=newzvalue(z#,cya#,16.0)
if keystate(31)=1 or downkey()=1 then x#=newxvalue(x#,cya#,-16.0) : z#=newzvalue(z#,cya#,-16.0)
if keystate(30)=1 or leftkey()=1 then x#=newxvalue(x#,wrapvalue(cya#-90.0),20.0):z#=newzvalue(z#,wrapvalue(cya#-90.0),20.0)
if keystate(32)=1 or rightkey()=1
x#=newxvalue(x#,wrapvalue(cya#+90.0),20.0)
z#=newzvalue(z#,wrapvalue(cya#+90.0),20.0)
else
AngX# = wrapvalue(AngX# + mousemovey()*0.25)
AngY# = hovercraftyAngY#
X# = newxvalue(hovercraftX#,wrapvalue(hovercraftAngY#-45.0),3.0)
Z# = newzvalue(hovercraftZ#,wrapvalue(hovercraftAngY#-45.0),3.0)
Y# = 5.0
position object 1,X#,Y#,Z#
rotate object 1,0.0,AngY#,0.0
endif
if jumpb=1 then height#=height#-0.7
if joystick fire x(4) or spacekey()=1
if ajump=1
jumpb=1
height#=20
endif
endif
endif
return
_UpdateHovercraft:
rem hovercraft controls
if invehicle=1
if object visible(1)=1 then hide object 1
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 2,0.002
if mmy<0 then pitch object down 2,0.002
if mmx<0 then turn object left 2,5
if mmx>0 then turn object right 2,5
if upkey()=1 then move object 2,40
if downkey()=1 then move object 2,-40
if scancode()=17 then move object 2,40
if scancode()=31 then move object 2,-40
if joystick up()=1 then pitch object up 2,0.0002
if joystick down()=1 then pitch object down 2,0.0002
if joystick left()=1 then turn object left 2,5
if joystick right()=1 then turn object right 2,5
if joystick slider a()=0 then move object 2,40
if joystick slider a()=65535 then move object 2,-40
REM Straffe Left
if joystick twist z()=-1000 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if joystick twist z()=1000 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Straffe Left
if scancode()=30 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if scancode()=32 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Straffe Left
if leftkey()=1 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if rightkey()=1 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Hovercaft Jump
if jumpb=1 then height#=height#-0.7
if joystick fire x(4) or spacekey()=1
if ajump=1
jumpb=1
height#=20
endif
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 then jumpb=0:height#=0
rem HAT control
jhat=joystick hat angle(0)
print westminster
text 10,10,"HAT signal: "+str$(jhat)
text 10,20,"Joystick: "+str$(jx)+"/"+str$(jy)
text 10,30,"Slider: "+str$(joystick slider a())
text 10,40,"FPS: "+str$(screen fps())
text 320,400,"Speed: "+str$(intspeed)+"MPH"
endif
return
_UpdateAircraft:
rem air/spacecraft movement controls
if inaircraft=1
if object visible(1)=1 then hide object 1
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 4,5
if mmy<0 then pitch object down 4,5
if mmx<0 then turn object left 4,5
if mmx>0 then turn object right 4,5
if upkey()=1 then move object 4,40
if downkey()=1 then move object 4,-40
if scancode()=17 then move object 4,40
if scancode()=31 then move object 4,-40
if inkey$() = "q" then roll object left 4,5
if inkey$() = "e" then roll object right 4,5
if scancode()=211 then roll object left 4,5
if scancode()=209 then roll object right 4,5
if joystick up()=1 then pitch object up 4,5
if joystick down()=1 then pitch object down 4,5
if joystick left()=1 then turn object left 4,5
if joystick right()=1 then turn object right 4,5
if joystick twist z()=1000 then roll object left 4,5
if joystick twist z()=-1000 then roll object right 4,5
if joystick slider a()=0 then move object 4,40
if joystick slider a()=65535 then move object 4,-40
REM Straffe Left
if joystick fire x(4)=1 then turn object left 4,90 : move object 4,20 : turn object right 4,90
REM Straffe Right
if joystick fire x(5)=1 then turn object right 4,90 : move object 4,20 : turn object left 4,90
REM Straffe Left
if scancode()=30 then turn object left 4,90 : move object 4,20 : turn object right 4,90
REM Straffe Right
if scancode()=32 then turn object right 4,90 : move object 4,20 : turn object left 4,90
REM Straffe Left
if leftkey()=1 then turn object left 4,90 : move object 4,20 : turn object right 4,90
REM Straffe Right
if rightkey()=1 then turn object right 4,90 : move object 4,20 : turn object left 4,90
rem VTOL take off and landing
if joystick fire x(6) then position object 4,object position x(4),object position y(4)+height,object position z(4):height=10
if controlkey()=1 then position object 4,object position x(4),object position y(4)+height,object position z(4):height=10
if joystick fire x(7) then position object 4,object position x(4),object position y(4)-10,object position z(4):height=height-1
if spacekey()=1 then position object 4,object position x(4),object position y(4)-10,object position z(4):height=height-1
rem HAT control
jhat=joystick hat angle(0)
print westminster
text 10,10,"HAT signal: "+str$(jhat)
text 10,20,"Joystick: "+str$(jx)+"/"+str$(jy)
text 10,30,"Slider: "+str$(joystick slider a())
text 10,40,"FPS: "+str$(screen fps())
intspeed=int(speed#*150)
intspeed=int(speed#-150)
if timer()>t then t=timer()+500
rem then we add another half second to t
` t=timer()+500
rem so the IF part of this bit will only be true when timer() is equal to t
` endif
endif
rem HAT control
jhat=joystick hat angle(0)
print westminster
text 10,10,"HAT signal: "+str$(jhat)
text 10,20,"Joystick: "+str$(jx)+"/"+str$(jy)
text 10,30,"Slider: "+str$(joystick slider a())
text 10,40,"FPS: "+str$(screen fps())
text 320,400,"Speed: "+str$(intspeed)+"MPH"
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 spacekey()=1
hide object 1
else
show object 1
Position object 1, X#,Y#,Z#
invehicle=0
endif
_UpdateCam:
if inVehicle = 0
if object1View = 0
camX# = object1X#
camY# = object1Y# + 2.5
camZ# = object1Z#
camAngX# = object1AngX#
camAngY# = object1AngY#
else
camX# = newxvalue(object1X#,wrapvalue(object1AngY#+180.0),25.0)
camY# = newyvalue(object1Y#,object1AngX#,-25.0)
camZ# = newzvalue(object1Z#,wrapvalue(object1AngY#+180.0),25.0)
camAngX# = object1AngX#
camAngY# = object1AngY#
endif
else
if object1View = 0
camX# = object1X#
camY# = object1Y# + 2.5
camZ# = object1Z#
camAngX# = 0.0
camAngY# = aircraftAngY#
else
camX# = newxvalue(aircraftX#,wrapvalue(carAngY#+180.0),25.0)
camY# = newyvalue(object1Y#,object1AngX#,-25.0)
camZ# = newzvalue(aircraftyZ#,wrapvalue(aircraftAngY#+180.0),25.0)
camAngX# = object1AngX#
camAngY# = aircraftAngY#
endif
endif
position camera camX#,camY#,camZ#
rotate camera camAngX#,camAngY#,0.0
else
if object1View = 0
camX# = object1X#
camY# = object1Y# + 2.5
camZ# = object1Z#
camAngX# = 0.0
camAngY# = hovercraftAngY#
else
camX# = newxvalue(hovercraftX#,wrapvalue(carAngY#+180.0),25.0)
camY# = newyvalue(object1Y#,object1AngX#,-25.0)
camZ# = newzvalue(hovercraftyZ#,wrapvalue(hovercraftAngY#+180.0),25.0)
camAngX# = object1AngX#
camAngY# = hovercraftAngY#
endif
position camera camX#,camY#,camZ#
rotate camera camAngX#,camAngY#,0.0
return
and camera and I seem to have a problem naming loaded objects as "player" or "self" and DBC ctually accept this , why is this please?