Jump to content
Sign in to follow this  
cc_kronus

radar detection alarm for helicopters.

Recommended Posts

Hi, I am making a mission where helicopters need to insert a SF team behind enemy lines. The helicopter pilots (human players) will need to fly under 100 meters above terrain (ATL) to avoid enemy radar detection.

I would like help to make a script where if the helicopter flies above 100 meters above terrain, the pilot or the chopper gets a warning sound (The standard sound in arma for combat helicopters when being locked by a launcher, would do nicely). And if the pilots are careless enough to stay above 100 meters ATL for more than 10 seconds, means that they have been locked for good and a enemy fighter with a search and destroy mission is spawned to enter the area in 15 minutes (or is directly spawned in the area 15 minutes after the got detected ).

The problem is that I do not know how and where to start, where to get the sound from (i've gone trough arma folders but could not locate the individual sounds), how to make the script, the correct sintax, etc...

Anybody?

Thanks.

Share this post


Link to post
Share on other sites

Well I'd use two triggers to achieve this:

Trigger 1)

Activation: GameLogic (Repeatedly)

Condition: ((vehicle player getPosATL) select 2) >= 100

onAct.: playAltitudeAlarm = true; execVM "playMissileInbound.sqf";

onDea.: playAltitudeAlarm = false;

Trigger 2)

Activation: GameLogic (Repeatedly)

Condition: playAltitudeAlarm

Timeout: 10, 10, 10

onAct: execVM "spawnEnemyFighter.sqf";

In playMissileInbound.sqf you'd implement a loop which will play the sound you're searching for (I also didn't find it in a quick search, but "missile inbound" has a good ring to it).

To loop the sound you need the length of the sound and multiply it with 1000 to set the correct delay. The result could look like this:

while {playAltitudeAlarm} do 
{
    playSound "......";
    sleep 1300;
};

This example is for a sound which takes 1,3 seconds to play.

I'm sure there is a more efficient way to achieve sound loops using triggers, but as I'm not an experienced developer, this is the most I can do ^^

In spawnEnemyFighter.sqf you'd sleep for 15 Minutes (isn't this a bit too long? I mean if the enemies are already warned by the radar, why bother to wait 15 minutes until they actually attack?) and spawn a Heli with AI's and let them attack the player.

The commands you'd want to use are "createVehicle" and "createUnit". As for the AI and attacking part you have to look around in this forum, the BIKI or ask someone else who has more experience in AI scripting :D

Edited by XxAnimusxX

Share this post


Link to post
Share on other sites

Hi XxAnimusxX

Thanks for your help but I can't make it work, in fact, the trigger does not even accept the syntax you propose. Any idea of what is going wrong?

Share this post


Link to post
Share on other sites

correct syntax for first trigger condition:

((getposATL vehicle player) select 2) >= 100

Share this post


Link to post
Share on other sites

ahahah my bad, I tried the code out in an example mission but somehow managed to write it down the wrong way in this thread x'D

If the second trigger somehow fails to accept the condition, try

playAltitudeAlarm == true

instead. Haven't tested it yet, just in case it gives you some errors.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×