Home   Help Search Login Register  

Author Topic: SAM / Incoming Missile Warning.  (Read 818 times)

0 Members and 1 Guest are viewing this topic.

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
SAM / Incoming Missile Warning.
« on: 21 Nov 2003, 19:33:26 »
Hi y'all.

I'm working on a helicopter rescue mission in which the player flies a Cobra gunship escorting a Black Hawk onto Kolgujev. Just to make it a little more challenging, the enemy has the BKM SA-11 SAM launcher. Now basically as soon as I introduced this the mission became practically impossible, as those things are so darned accurate that unless you see them coming, you don't stand a chance.
So I did a quick eventhandler script that basically detects incoming missiles and warns you they're coming. But what would be great is if there was a script that:

1) detected the incoming missile (using the incomingmissile EH)
2) detected the direction the missile is coming from and converted it to a clock position.
3) used speech to have the "co-pilot" say "SAM inbound, three o-clock" or whatever.

Can it be done?

Cheers
Dark
"Moondark" in Beta Testing

Grendel

  • Guest
Re:SAM / Incoming Missile Warning.
« Reply #1 on: 21 Nov 2003, 21:30:43 »
Almost anything is possible in the world of OFP scripting :)

Heres an idea:

The incoming EH doesn't give you a whole lot of time to react.

instead of an incomming missile EH for the chopper, give the SAMs a fired EH.  Use the "this select" parameter to capture the rocket.

use the distance command in a loop to determine the distance of the SAM and the chopper.  Once the SAM is a set distance to the chopper, have it execute the warning.

use a dirtoobj function to get the direction from the chopper to the SAM, use a getdir for the chopper and convert the difference into a clock direction.

You can find good tutes on this site to use custom sounds for the warning, or just use sidechat.

If you are willing to wait, I could do one up. Private Message me if you like.

-Grendel

Offline DarkAngel

  • Members
  • *
  • The night is my friend.
    • DarkAngels Missions
Re:SAM / Incoming Missile Warning.
« Reply #2 on: 22 Nov 2003, 11:21:22 »
Cheers Grendel.

I'm not too familiar with functions yet but I'll look up dirtoobj and try and work something out over the next day or two. Mind if I send you what I come up with? I'm no scripting guru so it'd be great to have some extra advice.  :)

Dark
"Moondark" in Beta Testing