OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: wastzzz on 05 Sep 2006, 15:11:09

Title: activating a trigger when unit1 and unit2 are present
Post by: wastzzz on 05 Sep 2006, 15:11:09
like subject.. i need to activate a trigger when both unitName1 and unitName2 are present in the trigger area.
any suggestion please?

oh, another question: how do i make it triggerable only if those units are are on foot?
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: bedges on 05 Sep 2006, 16:11:26
trigger's condition -

Code: [Select]
(unit_1 in thislist) and (unit_2 in thislist) and ((vehicle unit_1) == unit_1) and ((vehicle unit_2) == unit_2)
untested, but i think it's okay.

oh, and welcome to OFPEC!  :thumbsup:
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: wastzzz on 05 Sep 2006, 19:40:42
thanks :D
and what if i want to activate a trigger only if unit1 and unit2 are inside the area (no matter if they are on a vehicle or on foot) ?
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: bedges on 05 Sep 2006, 20:07:13
then leave out the last two vehicle bits... ;)
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: wastzzz on 05 Sep 2006, 20:14:15
then leave out the last two vehicle bits... ;)
ye i tried that, however it works if the 2 units are on foot, but doesn't work if they are on a vehicle togheter :|
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: rhysduk on 05 Sep 2006, 20:31:30
Try this:

(unit_1 in thislist) and (unit_2 in thislist) and (unit_1 in jeep1) and (_unit2 in jeep1)

where jeep1 is the name of the vehicle

Rhys
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: Cheetah on 05 Sep 2006, 20:42:50
Or you can check the distance between the trigger and your soldiers with the distance (http://www.ofpec.com/COMREF/index.php?action=list&letter=d#distance) command.

Because it can be the problem that only the name of the vehicle is in the array and not the unit in the vehicle.
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: wastzzz on 05 Sep 2006, 20:47:07
Try this:

(unit_1 in thislist) and (unit_2 in thislist) and (unit_1 in jeep1) and (_unit2 in jeep1)

where jeep1 is the name of the vehicle

Rhys

i don't wanna name the vehicle, could be any
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: JasonO on 05 Sep 2006, 20:48:58
Try putting vehicle instead of jeep1.. Although that is a guess. If someoen replies sooner with a known fix then take that option  :yes:
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: Chris Death on 05 Sep 2006, 21:26:21
Condition:
Code: [Select]
vehicle unit1 in thislist AND vehicle unit2 in thislist
~S~ CD
Title: Re: activating a trigger when unit1 and unit2 are present
Post by: wastzzz on 05 Sep 2006, 22:06:01
Thanks Chris Death, it works :)