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 / Collisions

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 24th Aug 2005 22:44
Sorry to ask this but I really need help I simply can't get my spacecraft to stop going through the planet.

I have tried everything with the collisions but I just keeep getting stump can I get some help please?
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 24th Aug 2005 23:30
a simple but effective collision code is:



the X# - Z# is the objects position before the collsion. so u will need to put the following at the end of the loop somewhere (i put mine with camera stuff)



1 being whatever ur character object is

hope i helped

kR

kR
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 24th Aug 2005 23:51
Thanks KRx when I get my internet connection (in an internet cafe at present) back up I will take this down and test it out.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 25th Aug 2005 05:11
ya that doesnt work. Not with my 3ds curved wall.
its not detecting f### all

grrrrr
and if ya say i need a stupid collision box for it how the f#ck does that work for a curved wall if its not square.....
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 25th Aug 2005 05:14
whoops....didnt know their was rules about language used.....
sorry
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 25th Aug 2005 05:16
ok why doesnt collision work for 3ds max files??

maby it works on a square but it doesnt on a rounded object.

eg. a curved wall

i tried you code snipet......haha i tried it already....nope doesnt work at all
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Aug 2005 13:30
just after you load a 3Dfile: type set object collision to polygons objnr. And don't forget to do the same for all polygons!

set object collision to boxes objnr for box collision.
set object collision to spheres objnr for sphere collision.

Immunity and Annihalation makes Immunihalation...
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 25th Aug 2005 15:03


be nice in future dude, plz point out where the collsiion doesnt work in the source ive just posted!!! hope this helps vampyre

kR

kR
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Aug 2005 15:08
Please note that set object collision to polygons will cause the program to run slower then using set object collision to boxes/spheres.

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Aug 2005 23:02 Edited at: 25th Aug 2005 23:05
I see Sven B you have to type that under the load object"".X or 3DS do you?
possibly thats where I have been going wrong. I also tried the set object to polygons but nothing worked either.

and you put that objnr as well in the line?
For Kr thanks mate appreciate the help I will test all this code and see if it helps thanks again
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 25th Aug 2005 23:08
hope it was ok, the object number is in the line to eg/

set object collision tp polygons 1

kR
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th Aug 2005 10:30
Don't forget to do these command with EVERY 3d object in your game. This means you have to type after you created your planet: set object collision to spheres planetnr

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 26th Aug 2005 22:45 Edited at: 26th Aug 2005 22:46
OK sven so you have to do this nr everytime with the set object commands then?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th Aug 2005 23:06
Yup!

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 30th Aug 2005 19:32
OK Sven B thanks a million I will test this out
Call me coder
20
Years of Service
User Offline
Joined: 5th Mar 2005
Location:
Posted: 31st Aug 2005 23:50
oh and you might want to convert your 3ds file with the converter in the tools section of "Dark Basic Directory"


TO ALL THOSE PROGRAMING PEOPLE OUT THERE!
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd Sep 2005 00:03
Well I tested it out Sven and I couldn't get my spaceplane to stop when it touchs the planet

@Call Me Coder I need to convert my 3ds file? I see as I was using 3d Exploration
This converter it is actually in the DBC directory?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Sep 2005 13:12
Here's some pseudo-code for stopping an object when collided:



That's how it's mostly done.

Immunity and Annihalation makes Immunihalation...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 3rd Sep 2005 13:21
There's a hidden DBC command, called 3ds2x.

3ds2x "Infile.3ds", "Outfile.x"

That's what the converter in the DBC directory uses.

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 26th Sep 2005 15:53
Thanks Sven B, I will try thank and I think I might get that now
Thanks blanky as well
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 14th Oct 2005 00:20 Edited at: 14th Oct 2005 00:26
I got it, the spaceplane collides woth the planet and either bounces of or lands although I was a bit daft , I didn't put this instruction in the loop.



Got to work on it a bit but it works .YEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSS, now just to get my hovertank to drive on the surface on the planet and get player pilots in and out of vehicles using 3D Models and then............ close to getting Solar Dominion and Astro Warrior finished
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 14th Oct 2005 00:33
you can just do a distance check.. if your too close to the planet then dont allow any closer


Login to post a reply

Server time is: 2025-05-22 13:52:33
Your offset time is: 2025-05-22 13:52:33