Jump to content
Sign in to follow this  
AnimalMotherUK

End Mission on vehicle engine off

Recommended Posts

Keeping it short and to the point.

I have a small mission based on an apache flight destroying several targets throughout takistan.

Currently I am using a trigger area that detects the two apaches (with unit names ugly51 and ugly50) and that they have to be under a certain altitude (2m).

What I'd like to do for the mission end is have it so that the crews have to return to the flight line, land and turn off the engines for the mission to complete.

What can I put into the triggers condition field for this to happen?

Regards,

Animal

Share this post


Link to post
Share on other sites

Create a marker called "apachespawn" and place it on the airfield near the apache.

Condition of trigger:

ugly50 distance (markerPos "apachespawn") < 50 && !(isEngineOn ugyl50) && ugly51 distance (markerPos "apachespawn") < 50 &&  !(isEngineOn ugyl51)

However that would end the mission instantly so either create a variable when the objective is done, such as

condition

!alive tank1

on activation:

tank_destroyed = true;

And then add that to your condition

ugly50 distance (markerPos "apachespawn") < 50 && !(isEngineOn ugyl50) && ugly51 distance (markerPos "apachespawn") < 50 &&  !(isEngineOn ugyl51) && tank_destroyed 

Share this post


Link to post
Share on other sites

I slapped this into a trigger condition and it worked fine. Radius 0, Activation None.

Condition:

((getPosATL ugly50) select 2) < 2 && !(isEngineOn ugly50) && ((getPosATL ugly51) select 2) < 2 && !(isEngineOn ugly51)

Activation:

endMission "END1"

Share this post


Link to post
Share on other sites

Thank you both. Got it working perfectly now. Can I just ask with regards to the:

((getPosATL ugly50) select 2) < 2 

What exactly do the numbers set there? Trying to get an understanding of them.

Share this post


Link to post
Share on other sites

He's getting the position over terrain for ugly50, since it returns an array you can use the command select, he's selecting the third value (it starts on 0) which means height only, not X or Y and then check if it's lower than 2.

Basically "is ugly50's height lower than 2"

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  

×