OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bankler on 09 Mar 2009, 17:57:57

Title: Attacking only under a set altitude
Post by: Bankler on 09 Mar 2009, 17:57:57
I  want a couple of Shilkas (aa1, aa2 and aa3) to stand by in an enemy city. The player (helo1) should be allowed to fly over the city and the Shilkas should not fire at the helicopter. However, IF the player is flying lower than 200 meters and within the city limit radius, the Shilkas should attack and shoot him down.

How is this easiest accomplished?
Title: Re: Attacking only under a set altitude
Post by: Walter_E_Kurtz on 10 Mar 2009, 01:26:03
1. Set the shilkas to never fire using setCombatMode (http://www.ofpec.com/COMREF/index.php?action=details&id=290)
In the init line of each shilka write:
Code: [Select]
this setCombatMode "BLUE"2. Create a trigger encompassing the city, connected to the player or the player's helicopter (once the trigger is created, press F2 and drag a line from the player / chopper to the trigger)

3. Configure the trigger
"Vehicle" "Present" "Once", and enter in the condition line:
Code: [Select]
this && ((getPos helo1 select 2) < 200)then, in the activation line:
Code: [Select]
aa1 setCombatMode "RED"; aa2 setCombatMode "RED"; aa3 setCombatMode "RED"
Title: Re: Attacking only under a set altitude
Post by: Bankler on 10 Mar 2009, 03:15:16
Thank you very much Walter!
Title: Re: Attacking only under a set altitude
Post by: Ext3rmin4tor on 13 Mar 2009, 10:49:53
Did the unit synchronization works with triggers in OFP 1.96 too? I thought that was an ArmA feature
Title: Re: Attacking only under a set altitude
Post by: h- on 13 Mar 2009, 15:01:54
Quote
Did the unit synchronization works with triggers in OFP 1.96 too?
IIRC it worked since the day one..
Title: Re: Attacking only under a set altitude
Post by: Raptorsaurus on 14 Mar 2009, 19:55:01
In the on activation field you can save some typing by using:
Code: [Select]
{_x setCombatMode "red"} forEach [aa1, aa2, aa3]