Apex,
I am using this code
Rem Project: BSP TEST
Rem Created: 8/13/2003 17:45:36
REM 3dsmax with grid=1.87/generic units gets 1:1 with VHE3.4
REM Space bar exits, ctrl key centers mouse, mouselook, arrow keys move,
REM right-click jump, left-click Pick Object
sync on : sync rate 100
backdrop off
center text screen width()/2,screen height()/2,"LOADING, PLEASE WAIT..."
sync
load bsp "","new1.bsp"
set bsp camera 0
set camera range 1,3000
autocam off
set bsp collision off 1
rotate camera 0,180,0
set bsp camera collision 1,0,1.30,0
`\\DUMMY OBJECTS
make object cube 1,.5
position object 1,0,-1,-18
make object cube 2,.5
position object 2,0,1.1,-18
`\\INDEX ?
set bsp object collision 1,1,2,1
hide object 1
hide object 2
set camera to object orientation 0,1
`\\Test objects
make object sphere 3,1
position object 3,1,0,0
make object sphere 4,1
position object 4,-1,0,0
`\\dummy obj for non-bsp objects
automatic object collision 2,1,1
`\\non-bsp test objects
automatic object collision 3,1,1
automatic object collision 4,1,1
`---------------------------------------------------------
intMouse as integer
intPickObject as integer
intCollided as integer
do
rem Mouselook
rotate object 1, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
rotate object 2, object angle x(1)+(mousemovey()/2.75),object angle y(1)+(mousemovex()/2.75),0
`\\move player with arrow keys (objects 1 & 2)
cx#=object angle x(1) : cy#=object angle y(1)
dx#=object angle x(2) : dy#=object angle y(2)
if upkey()=1
xrotate object 1,0 : move object 1,0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,0.15 : xrotate object 2,dx#
endif
if downkey()=1
xrotate object 1,0 : move object 1,-0.15 : xrotate object 1,cx#
xrotate object 2,0 : move object 2,-0.15 : xrotate object 2,dx#
endif
if leftkey()=1
yrotate object 1,cy#-90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#-90 : move object 2,0.15 : yrotate object 2,dy#
endif
if rightkey()=1
yrotate object 1,cy#+90 : move object 1,0.15 : yrotate object 1,cy#
yrotate object 2,dy#+90 : move object 2,0.15 : yrotate object 2,dy#
endif
`\\camera follows dummy object 1 for now (will switch to 2)
position camera 0,object position x(1),object position y(1),object position z(1)
rotate camera 0,object angle x(1),object angle y(1),object angle z(1)
`\\re-center mouse on screen (for picking objects)
if controlkey()=1 then position mouse screen width()/2,screen height()/2
rem Apply gravity to player / offset object 2 by 2.1 point
position object 1,object position x(1),object position y(1)-0.1,object position z(1)
position object 2,object position x(1),object position y(1)+2,object position z(1)
`\\ check for mouse value
intMouse=mouseclick()
`\\ left click Get PICK OBJECT value
if intmouse=1
intpickobject=pick object(mousex(),mousey(),3,4)
endif
`\\ right click Simple Jump
if intMouse=2
for intLoop= 1 to 35
position object 1, object position x(1),object position y(1)+0.1,object position z(1)
position object 2, object position x(2),object position y(2)+0.1,object position z(2)
position camera 0,object position x(1),object position y(1),object position z(1)
rotate camera 0,object angle x(1),object angle y(1),object angle z(1)
gosub UpdateScreenXYZ
sync
next intLoop
endif
rem Space Key ENDS demo
if spacekey()=1
sync
center text screen width()/2,screen height()/2,"ENDING GAME, PLEASE WAIT..."
sync
delete object 1
delete object 2
delete object 3
delete object 4
delete bsp
`delete music 1
end
endif
intCollided=object collision(2,0)
`\\show coordinates on screen
gosub UpdateScreenXYZ
sync
loop
UpdateScreenXYZ:
set cursor 0,0
print "x:";str$(int(object position x(1)));" y:";str$(int(object position y(1)));" z:";str$(int(object position z(1)))
set cursor 0,15
print "Obj#: ";str$(intPickObject)
set cursor 0,30
print "Collided: ";str$(intcollided)
Return
I set it up to have 2 dummy objects, one for bsp collisions, one for standard collisions, but it seems once bsp collision is set on for ANY object, automatic standard collision fails. The hit is registered by the system but it fails to auto-back-track the player, the player passes right thru the collided object, in this case Object 2 with any other non bsp object. Any Ideas?
Thanks
-RUST-