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.

DarkBASIC Discussion / Sliding Collision

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 11th Dec 2004 21:58
`Detect collision with an Object
If Object Collision(1,0)>0

Position Object 1,Posx,Posy,Posz

Endif

How do I make this into sliding collision (For a FPS)

**IDEA**


`Detect collision with an Object and Slide

If Object Collision(1,0)>0

Dec Posx,1

Position Object 1,Posx,Posy,Posz

Endif

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 11th Dec 2004 22:05
basic sliding collision can be coded this way:

move the object on the x axis first
check for collision (and if its 1, put it back at its original x position)

now move the object on the z axis
check for collision (again, check and put it back when necessary)

if you also want y movement, simply move the object on the y and do the same.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 11th Dec 2004 22:34
Cant seem to get it to work... could you post some simple code?

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Joe Cooning
22
Years of Service
User Offline
Joined: 29th Mar 2003
Location: United States
Posted: 11th Dec 2004 23:12
store oldX and oldZ. Send out a static collision line from oldX to newX and from oldZ to newZ. If there is a collision on the x line, set x to oldX and same thing for z. To detect static collision, you can use the free collision tool here.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 11th Dec 2004 23:14
?

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Joe Cooning
22
Years of Service
User Offline
Joined: 29th Mar 2003
Location: United States
Posted: 11th Dec 2004 23:27
(*sigh*)
(not actual working code, just closer to)

Maybe that will help. The tool I suggested is just a quick way to send out an object collision line. i belive this code should work, though.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 12th Dec 2004 00:56
I just want to use the commands that come with DBC! Anyway I cant use dlls I DONT KNOW HOW!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 18th Dec 2004 16:29
this is how i use sliding collision.



Of course i haven't done a whole lot of things in that (Camera, Object Positioning etc..). That's your Job.

I'm not sure if that's the right command.
Just check it in the help menu. Just press F1 on Dark Edit.

Anyways
Cya Later,
Axelman

43% of Percentages are made up on the spot.

Login to post a reply

Server time is: 2025-05-24 07:57:07
Your offset time is: 2025-05-24 07:57:07