Posted: 19th Jun 2007 3:27
Hi again...
I have searched the forums for collision code, tried everything i could think of and just wasn't able to get the collision working. I have a .x map and need collison for the map/objects in the map. Does anyone have a good way of doing this?

Thanks in advance.
Posted: 19th Jun 2007 4:13
IF you want to use collision on a map, Intersect Object is your friend.

h# = Intersect Object(levelobject, x,-100,z, x,100,z) - 100

Basically, it makes an invisible line and returns a 0 if the line doesn't intersect your object, and if it does, it returns the distance from the first point to the intersection.

In the example I gave, the x and z are the coordinates of your player object, and it makes a vertical line from -100 to 100, and figures out how high up it goes before touching your level. To find the height of your terrain, we have to subtract 100 afterward because we started at -100 and not at 0. So now, you can just position your player like this:

Position object playerob, x,h#,z

To do collision with walls, you would have to use horizontal lines instead, but this gets more confusing. Do some research on intersect object.
Posted: 19th Jun 2007 4:25
I will and thank you.
Posted: 19th Jun 2007 10:57
To use standard DBP collision you set the level object to polygon colision.

Everyone recommends Sparkys collision DLL though. There is a nice slider example in there you can rip off to make your game easy.
Posted: 19th Jun 2007 11:41
There is a nice slider example in there you can rip off to make your game easy.


Yeah check that example, it realy helps!
Posted: 19th Jun 2007 16:22
hallo Ellatica...i,v got a example ready for you...have a look to it and juest change your .x model...it really works good luck