i have added that and it works like a dream.
you dont know how frustrating this has been.
thanks alot
one more favour
sync rate 60 : sync on
set display mode 1280,1024,32
makelevel()
makeplayer()
global Ammo = 6
global spareammo = 24
global init_time#
global time#
global bulletlife
init_time#=timer()/1000
time#=init_time#
set dir ".."
rem bullet
Make object sphere 10,3
load image "textures/gold.bmp",40
Texture object 10,40
Hide object 10
load object "media/python.x",100
load image "media/Elite_tex.dds",50
texture object 100,50
YRotate Object 100,180
Fix object pivot 100
Scale object 100,125,75,100
position object 100,0,-10,15
Lock object on 100
do
move()
sync
LOOP
function makelevel()
set window off
maximize window
hide mouse
set dir "files"
load static objects "levelbank/testlevel/universe.dbo",0
load object "levelbank/testlevel/universe.dbo",1 :hide object 1
fog color rgb(28,28,0)
color backdrop rgb(28,28,28)
rem sc_setupobject 1,0,0
sc_setupcomplexobject 1,1,2
endfunction
function makeplayer()
Rem Player's camera collision object
make object sphere 2,10 : rem hide object 2
position object 2,700,30,-500
sc_setupobject 2,0,2
endfunction
function move()
rem collision for the person
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
rem move the player
if keystate(17)=1 then move object 2,3
if keystate(31)=1 then move object 2,-3
if keystate(30)=1 then move object left 2,3
if keystate(32)=1 then move object right 2,3
rem if player isn't pressing a key apply simple gravity
if keystate(17)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(31)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(30)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
if keystate(32)=0 then position object 2, object position x(2),object position y(2)-0.4, object position z(2)
x# = object position x(2)
y# = object position y(2)
z# = object position z(2)
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,30,0)
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
position object 2,x#,y#,z#
endif
rem position the camera
position camera object position x(2),object position y(2),object position z(2)
rem camera control/player movement
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
cx#=camera angle x(0) : cy#=camera angle y(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
yrotate object 2,camera angle y()
`-------------------------------------------------
if ammo > 0
If mouseclick()=1 and Bulletlife=0
set object to camera orientation 10
Position object 10,X#,Y#+20,Z#
Bulletlife = 100
Show object 10
`play sound 200
damage = 25
ammo = ammo - 1
Endif
if bulletlife>0
Dec bulletlife
Move object 10,20
If bulletlife=0 then hide object 10
endif
endif
if spareammo > 0
enterkey = keystate(28)
if enterkey=1
`play sound 201
spareammo =spareammo - (6-ammo)
ammo = 6
endif
endif
if ammo = 0
set text size 70
set cursor 550,200
print "RELOAD";
endif
endfunction
in my dbo file i have used hollow buildings (x.model) which i could walk in previously.. but i have played around with movement alot recently and since i have not been able to go in them.
Can you see why, are know of any reason why this is happening.