Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / collision problems

Author
Message
Matigus
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Costa Rica...bc im a bad person
Posted: 22nd Oct 2004 03:34
i am making my first atempt at a 3d game and i am having some collision problems. it will be an fps game. i have my gun and the area where the lvl will take place. the area is a room but if i am inside the room not touching ne thing or if i am out side of the building it still says that i am colliding with the object. i dont know if i explained that right but i would like some help if you know how to fix this problem. this is my code.

F*** the world and rock on!
Matigus
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Costa Rica...bc im a bad person
Posted: 22nd Oct 2004 03:44
Rem Project: FPS
Rem Created: 9/10/2004 11:04:47 AM

Rem ***** Main Source File *****
hide mouse
sync on:sync rate 0
set camera range 0.1,5000
autocam off
position camera 0,50,10,50
load image "crosshair.bmp",1
load object "gunhand1.x",1
load object "school.3ds",2

rotate object 2,0,0,44
make object sphere 3,2
lock object on 1
scale object 1,80,80,80
position object 1,0,0,0
scale object 2,400,400,400

bullet=30

sprite 1,295,200,1
make matrix 1,1000,1000,50,50

do

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 keystate(30)=1 then yrotate camera 0,cy#-90 : move camera 1 : yrotate camera 0,cy#
if keystate(32)=1 then yrotate camera 0,cy#+90 : move camera 1 : yrotate camera 0,cy#
if keystate(17)=1 then xrotate camera 0,0 : move camera 0,1 : xrotate camera 0,cx#
if keystate(31)=1 then xrotate camera 0,0 : move camera 0,-1 : xrotate camera 0,cx#
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))<300 then xrotate camera 0,300

if camera position y()>10 then position camera camera position x(0),10,camera position z(0)
if camera position y()<10 then position camera camera position x(0),10,camera position z(0)


if object collision (1,2)=1 then print "hello"
`it always says hello


if mouseclick()=1 and bullet>9 then play object 1,0,8:bullet=0
if bullet<10
move object 3,30
bullet=bullet+1
endif
if bullet>9
position object 3,camera position x(0),camera position y(0),camera position z(0)
rotate object 3,camera angle x(0),camera angle y(0),0
endif


sync

loop

F*** the world and rock on!
bibz1st
21
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 23rd Oct 2004 20:53
not sure if this is the problem but I would suggest making your "school" 400 times bigger in a modeler and then loading into your program rather than scaling it up 400 percent in DB.The reason being is is that DB uses the original object size when performing collisions using the built in collision system.
rob

Login to post a reply

Server time is: 2024-09-23 03:27:02
Your offset time is: 2024-09-23 03:27:02