OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: rlk on 25 Feb 2007, 15:17:46

Title: Condition & OnActivation question
Post by: rlk on 25 Feb 2007, 15:17:46
If I wanted to make it so when any member of group A gets outside a trigger area, he'll be set non-captive (setcaptive false) and he must be alive if this happens,

1. What do I need to set as the condition of a trigger?
2. What do I put on the activation field?

 :dunno:
Title: Re: Condition & OnActivation question
Post by: Wolfrug on 25 Feb 2007, 18:44:05
I was first going to offer some general suggestions, but then I thought "hell, I think better with the editor under my fingertips" : so I went in and it took me about two minutes to figure out a foolproof way :

Code: [Select]
Trigger : A/B (whatever you want)
Grouped (F2) to the group in question.
Activated By : Whole Group - Not Present

On Act: hint "one out!"; {_x setcaptive false} forEach units YourGroupName; {_x setcaptive true} foreach thislist

And that's it. AFAIK if you make it repeatedly, it'll keep doing it for as long as there're units inside the trigger. I'm sure you can figure out how to make it for instance re-setcaptivate people who re-enter the safe-zone and so forth, if needed.

Note : it takes a number of seconds for OPFOR troops to actually realise you're no longer setcaptive, so if you want them to act faster at someone leaving I suggest you add some kind of Reveal function (for instance a larger trigger surrounding the smaller one, which reveals everyone entering it to the OPFOR troops).

Have fun!

Wolfrug out.
Title: Re: Condition & OnActivation question
Post by: rlk on 25 Feb 2007, 19:09:44
Thanks, works perfect. :good: