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 / .X collisions

Author
Message
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 2nd Oct 2005 22:43
Ive been looking thru some posts about collisions and none of them really help me. I have a level which is a .X file and the player object which is also a .X file. Is there any way that if one .X goes into the other .X it explodes and restarts or sometihng?

http://www.Bevansfunbox.com
UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 2nd Oct 2005 22:46
What language? DBC or DBP?

Green Bunnies rule!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 2nd Oct 2005 22:52
If its DBC -

Set object collision on Player#
sync on
do
if object collision(Player#,Level#)=1
play object Explosion#,Start Frame#,End Frame#
blah blah goto restart place blah blah
endif
sync
loop

Replace all the 'Player#' with the object number of your player. Replace the 'Level#' with the object number of your level. Replace the 'Explosion#' with the object number of the animated explosion. Replace Start Frame# and End Frame# with the starting and ending frames of the animated explosion.

That should be it.
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 2nd Oct 2005 22:55
Sry, forgot to say. Im using Dark Basic Pro

http://www.Bevansfunbox.com
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 2nd Oct 2005 23:05
The code I posted might work in DBPro too. Try it.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Oct 2005 04:58 Edited at: 3rd Oct 2005 04:58
Xeno that isn't polygonal collision, .x models are usually polygons so, I doubt it'll work.


Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 3rd Oct 2005 21:37
No that code didnt work. Thanks for trying to help tho

http://www.Bevansfunbox.com
UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 3rd Oct 2005 21:46
Okay, I can't help you then. Sorry.

Green Bunnies rule!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 3rd Oct 2005 23:57
Quote: " Xeno that isn't polygonal collision, .x models are usually polygons so, I doubt it'll work."

Quote: " No that code didnt work. Thanks for trying to help tho"


???? It works for me with two .X polygonal objects
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 4th Oct 2005 15:30
... I don't see how... Unless DB object collision switches on polygon collision by default... I thought the command used two spheres to test against collision with, in which case that wouldn't be polygonal. You're saying you could have 1 .x model of a house with an open door, and another .x model of a little kid, and the little kid would collide with the model and stop, yet still be able to go inside the house, just using the built-in object collision commands.

If you're justusing spheres and boxes as your .x models then yes it'll work

Your signature has been erased by a mod because it's larger than 600x120...
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 4th Oct 2005 17:07
Hi..
Look at the "Codebase" & search for "collision" you'll find a procedure for collision between .x files.
Needs some changes for your game, but i use it & it works very fine!

Login to post a reply

Server time is: 2024-11-13 21:16:32
Your offset time is: 2024-11-13 21:16:32