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 Professional Discussion / Pick object.. from an objects position

Author
Message
Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 7th Aug 2004 13:45
Hokay... SO!
you can pick an object using pick object...

is there anyway that an object can do the same to another object...

I have a turret model.. I could attach a very long inivisble rod to the rotating part and if it touches the camera then you will be shot... thing is if another object is in the way... in real life you wont be shot.. yet obviously the rod is still in contact...

any ideas how to do this?

or maybe i should just go get the ngc plugin and shoot super fast bullets instead!

Next on ITV. I'm a DBPRO Bug forum moderator get me out of here.
Terabyte - The only user to have a newton cradle hoisted above the F5 button when making a game.
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Aug 2004 13:51
I'd either use NGC or object intersect commands as opposed to the long object idea. I'd use NGC first because I bought it But If I didn't have $15 I'd probably look into intesect object command(s).

Terabyte
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 7th Aug 2004 13:58
ya... i think it's time to get ngc... i really dont fancy interesect commands

Next on ITV. I'm a DBPRO Bug forum moderator get me out of here.
Terabyte - The only user to have a newton cradle hoisted above the F5 button when making a game.
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Aug 2004 14:08
NGC is the easiest. I have had no trouble placing my bullet decal objects and shooting models with my bullets

walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 7th Aug 2004 15:08
the intersect object command is EXACTLY what you're describing. you simply attach a hidden sphere to the camera (to represent the player), then run an intersect object from your enemy gun for a certain distance (range of the weapon). if you get a collision, the player's been hit!!

you should also run a loop of other objects in the scene, to determine that there isn't something blocking the shot. basically you first see if there's a possible hit (if the ray hits the sphere), and if it does, you loop through all possible blocking objects, checking the distance to that object. if the distance is smaller than the distance to the player, that object is in the way!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB

Login to post a reply

Server time is: 2025-06-07 09:43:49
Your offset time is: 2025-06-07 09:43:49