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 / can somone give me some code to check where an object is

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 7th Mar 2004 22:47
can somone give me some code to check where an object is cause i want to check where my bullet is after i shot it and if its hit anything svae the position and put a textured plain there so it looks like a mark or blood and stuff

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 7th Mar 2004 23:02
OBJECT POSITION X(objnum)
OBJECT POSITION y(objnum)
OBJECT POSITION z(objnum)

and

OBJECT ANGLE x(objnum)
OBJECT ANGLE y(objnum)
OBJECT ANGLE z(objnum)

note that you will need to calculate the angle of the polygon you hit to paste the plain to it correctly, a simple spark flash would be easier.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 13th Mar 2004 22:40
thanks but i dont know what to put to put a plain where the bullet is

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
Big Al
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: infront of the PC
Posted: 14th Mar 2004 15:11
bulletposx#=object position x(objnum)
bulletposy#=object position y(objnum)
bulletposz#=object position z(objnum)

position object plainnum,bulletposx#,bulletposy#,bulletposz#

If quizes are quizical then what are tests?
Dark Serpent
21
Years of Service
User Offline
Joined: 24th Feb 2004
Location: U.S.A.
Posted: 15th Mar 2004 05:31 Edited at: 15th Mar 2004 05:31
I think Irish fool asks the best questions which I profit from ... .... .... ....

I'm exited in boresville....what does that tell you?
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 20th Mar 2004 23:05 Edited at: 20th Mar 2004 23:06
lol well dark serpent i have noticed you always seem to look at my posts and post me back
anyhoow thanks big al (metallica rule apart from slipknot that is) sorry i just had to say that but can u give me some code to say this if my bullet hits my tank then my command because i cant get that collision bit working what do i put do i need to save the object position what i dont get it

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 21st Mar 2004 12:11
aaaaahhhhhhh i cant get it working can somone give me some code to once ive shot my bullet if it hits anything it puts my textured plain where it hit pls

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 21st Mar 2004 14:47
I think that should work,
also depending on the shape of the object the bullet hits, if it's a simple plain then you need to angle the "blood" plain at the same angle as the hit object but if it's an awkward shape then it gets more complicated and a bit beyond me, maybe someone else could do that.
this will only make one blood stain si when you shoot again that stain will then be repositioned to the new bullet positions, d'ya see?
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 21st Mar 2004 17:46
aaawww this is my code can u tell me why it aint working

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 21st Mar 2004 20:33
I gived it a fast look, but I think the problem is because:

if fired=1
IF OBJECT COLLISION(3,0)>0
bulletposx#=OBJECT POSITION X(3)
bulletposy#=OBJECT POSITION Y(3)
bulletposz#=OBJECT POSITION Z(3)
HIDE OBJECT 3
POSITION OBJECT 4,bulletposx#,bulletposy#,bulletposz#
SHOW OBJECT 4
fired=0
endif

I don't see where you set "fired" to 1, just "shoot=1"...

Anyway that was a fast look...

steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 22nd Mar 2004 20:00
k i forgot to set object collsion to the sphere and the plain but now i have it still dont work

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 26th Mar 2004 19:24
try this,
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 26th Mar 2004 20:47
you might even try puting it about .01 units away from what it hit, so you cant see under it, but it doesnt get covered bye the object you hit

Do you model? contact me: [email protected]

Login to post a reply

Server time is: 2025-05-31 17:47:28
Your offset time is: 2025-05-31 17:47:28