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 / Missle Homing

Author
Message
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 18th Feb 2006 19:44 Edited at: 18th Feb 2006 19:46
How will I have some missles home in on the player?
I have tried doing it many different ways.

I used the curvevalue command to make it go towards the player, but all the missles made a clump following the player, and they didn't point at the player.

I would like the missles to point at the player, or slowly point at the player so they aren't perfectly accurate and it would take a little bit for it to point at the player. kind of like in 2d shooters where the missles are kind of inacurate and it slowly turns towards the player so it would be moderatly easy to dodge.

Can someone show me how to do this? It would be greatly appreciated.


Hippopotomonstrosesquippedaliophobia-Fear of long words
Death100
19
Years of Service
User Offline
Joined: 18th Feb 2006
Location: The underworld
Posted: 18th Feb 2006 21:01
create a primitive in the same location as your missile, hide it and point it to the target. Then get the angle of the hidden object and then use the curvalue function to make it slowly go towards the target.
then loop it.

that should work

<> <> EVIL....
---
Untitled Space Sim: 10%
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 19th Feb 2006 01:11
hm...good idea. I will try it. THANKS!!!


Hippopotomonstrosesquippedaliophobia-Fear of long words
Death100
19
Years of Service
User Offline
Joined: 18th Feb 2006
Location: The underworld
Posted: 19th Feb 2006 13:27
no prob

<> <> EVIL....
---
Untitled Space Sim: 10%
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 19th Feb 2006 16:18
Gr...it should work. They just go it circles:


Alienmissle#(I,1) = If it exists
Alienmissle#(I,2) = x pos
Alienmissle#(I,3) = y pos
Alienmissle#(I,4) = z pos

699+I = missle object
724+I = missle direction object that points at player

There is a background object(a plain) positioned at 0,0,0
The missle direction object is hidden behind it (z=1)
The missle rotate angle is z

UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 22nd Feb 2006 00:40
ok, I have an idea. Just one question.

What formula would you use to find the wrapping distance between two angles like 300 and 45? (The answer would be 105) It would go 60 to 360, and then 45 more to 45.

Please help since this should be easier to answer than the last question.

UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 22nd Feb 2006 01:38
Never mind. Figured it out.

Login to post a reply

Server time is: 2025-05-23 14:37:10
Your offset time is: 2025-05-23 14:37:10