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 / need help with a newbie question

Author
Message
crow34
19
Years of Service
User Offline
Joined: 22nd Jul 2005
Location:
Posted: 23rd Jul 2005 02:27
i am new to darkbasic so sorry if this is a lame question but i am trying to apply collision detection to my level that i built in cartography shop so instead of walking through the walls of my level i collide with the walls

i have tried the automatic camera collision command and i end up getting embeded in the walls unable to move

can some one please help and give some suggestion to solve this problem so i can stop tearing my hair out

thankyou
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Jul 2005 04:10
hi, collision is quite hard with darkbasic, but theres a dll called sparky's collision dll, its for pro, but someone made it for dbc.. you'll find it somewhere in the code snippet forum.

There's also a dll called nuclear glory, but ive never tried it so i wouldn't know if its good enough..

Your signature has been erased by a mod because it's larger than 600x120...
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 23rd Jul 2005 06:38
the automatic camera collision will work on a basic level but you have to set your object to polygon collision. Only draw back is it wont let you walk up stairs so I would recommend using something such as Sparky or NGC.

If you are using DBP, look in the code base forum, there are several good working examples avaliable to download

J

Hello!
Zone Chicken
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: `~-..-~`~-..-~`
Posted: 23rd Jul 2005 07:45
You could use set object to polygon collision on your player and get your player to go up the stairs if you make a triangle model the just slightly larger then the stairs and position it over the stair case, set collion to poly on the triangle on and hide the triangle out of site then your player would slide up the triangle but only see the stairs. Or just get a collison dll.

Your signature has been erased by a mod -- please resize to under 600x120...
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 23rd Jul 2005 10:05
Once again, if you're using dbp...

Try looking up the INTERSECT OBJECT() command in the help file, it's excellent for this sort of thing, I always use it. I even made a small dll for single player collision with intersect object.

Basically you shoot a line from the character to a limb infront of the character and detect if anything goes inbetween those two points. If so and the distance is infront of you, you can then handle appropriately.

It's a fairly complex command to get used to if youre new to the coding world but basically:

INTERSECT OBJECT(Object, X, Y, Z, ToX, ToY, ToZ)

Object = The object you wish to detect intersection with (the map file in this case)

X = Starting x pos of ray
Y = Starting Y pos of ray
Z = Starting Z pos of ray

ToX, ToY, and ToZ are the same but give the coordinates of where the ray should travel to.

I recommend using a for/next loop to change the object being tested against.

Goodluck, if you need any help just post.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection

Login to post a reply

Server time is: 2024-09-23 23:22:47
Your offset time is: 2024-09-23 23:22:47