Hi there!
This might be a bit sudden, but the easiest way for checking collision with loaded X or 3DS objects is Sparky's collision DLL.
Attached is a simple demonstration of sliding collision using sparky's dll. It should be easy to implement into your project, just change "position camera x#,y#+2,z#" with the object you want to position:
position object <player>,x#,y#,z#
But only if you want the player to be an object.
Download the attachment, hope this helps!
Another thing you may have to change is the collision size and speed, because your world may be a lot bigger or smaller than mine. My collision size is set to 6:
rem collision with ground
if intersectObjectDBC(1,0,x#,y#,z#,x#,y#-3,z#,0) then y#=GetStaticCollisionY()+3:grav#=0
rem collision with roof
if intersectObjectDBC(1,0,x#,y#,z#,x#,y#+3,z#,0) then y#=GetStaticCollisionY()-3
rem collision with walls
if IntersectObjectDBC(1,0,x#,y#,z#,x#-3,y#,z#,0) then x#=GetStaticCollisionX()+3
if IntersectObjectDBC(1,0,x#,y#,z#,x#+3,y#,z#,0) then x#=GetStaticCollisionX()-3
if IntersectObjectDBC(1,0,x#,y#,z#,x#,y#,z#-3,0) then z#=GetStaticCollisionZ()+3
if IntersectObjectDBC(1,0,x#,y#,z#,x#,y#,z#+3,0) then z#=GetStaticCollisionZ()-3
You will notice the 3 everywhere. If your character is 30 wide, 20 long and 80 high, you will have to divide those numbers by 2 and insert them at the correct place:
rem collision with ground
if intersectObjectDBC(1,0,x#,y#,z#,x#,y#-40,z#,0) then y#=GetStaticCollisionY()+40:grav#=0
rem collision with roof
if intersectObjectDBC(1,0,x#,y#,z#,x#,y#+40,z#,0) then y#=GetStaticCollisionY()-40
rem collision with walls
if IntersectObjectDBC(1,0,x#,y#,z#,x#-15,y#,z#,0) then x#=GetStaticCollisionX()+15
if IntersectObjectDBC(1,0,x#,y#,z#,x#+15,y#,z#,0) then x#=GetStaticCollisionX()-15
if IntersectObjectDBC(1,0,x#,y#,z#,x#,y#,z#-10,0) then z#=GetStaticCollisionZ()+10
if IntersectObjectDBC(1,0,x#,y#,z#,x#,y#,z#+10,0) then z#=GetStaticCollisionZ()-10
Of course, feel free to use this example as your base structure to build things into it how you like and turn it into a good FPS game!
TheComet
Make the paths of your enemies easier with WaypointPro!