OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: laggy on 13 May 2009, 00:20:39

Title: Question about group linked trigger
Post by: laggy on 13 May 2009, 00:20:39
 :scratch:

EDIT: Version 2 is the CORRECT way. Version 1 seems to only care about the first guy detected even though spottedguy is reset as objNull. The rest of the group are still setCaptive, even though detected. My guess is that no one else will be setCaptive false until the first guy is NOT detected anymore.

Sounds plausible ?


I want group members that are detected in a certain area to be setCaptive false IF they are detected after "myTarget" is dead. Group members NOT detected under those conditions should remain captive.

I know about the delay (units are still counted as detected for a while even when out of sight), but that's OK, I'm only worried about the onActivation thing. Those group members that are detected when AND after "myTarget" is dead must be setCaptive false.

Version 1

Trigger with 300m radius

Activation: -Any Group Member -Detected by OPFOR -Repetedly

Condition: this AND ! (alive myTarget)

onActivation: spottedguy = thislist select 0; spottedguy setCaptive false; spottedguy = objNull


Version 2

onActivation: {_x setCaptive false} forEach thislist


Will these two versions have the same results?
Or which one is better?
If none of the two works, what could work better?

Cheers,

Laggy
Title: Re: Question about group linked trigger
Post by: Spooner on 21 May 2009, 00:59:10
The former method will only setCaptive the first person and the later will only setCaptive the first ones to enter the zone. More people will only be affected if everyone is undetected for a time and someone is detected again. The reason for this is a common misconception on how trigger conditions work. OnAct is run only when the whole condition flips from true to false and OnDeact is run only when the condition flips from false to true. Setting a trigger REPEATEDLY only means that it will run these events indefinitely as the condition flips from true to false to true to false, not that they will trigger each time the condition is checked and found to be true.

To cut the Gordian Knot (although your second solution seems to work fine)...
Code: (init line for myTarget) [Select]
this addEventHandler ["KILLED", { { _x setCaptive false } forEach units myGroup }];
Code: (init line for someone in my group) [Select]
myGroup = group this;
What you really want, it seems, is that everyone should be unset as captive after the target is killed. If you aren't detected by the enemy, then not being a captive isn't dangerous so there isn't a problem.
Title: Re: Question about group linked trigger
Post by: laggy on 21 May 2009, 14:51:42
Quote
What you really want, it seems, is that everyone should be unset as captive after the target is killed. If you aren't detected by the enemy, then not being a captive isn't dangerous so there isn't a problem.

Hmmm... not quite true in my case.

This is for my mission "One Shot One Kill"

The players (all in the same group) are "undercover" wearing enemy uniforms.
They can walk around quite safely before target is assassinated, target is an enemy general/politician.
However when target is killed (by someone in players group) the enemies should be more on their guard and suspect/attack any (now detected) unfamiliar faces in the "crime" area.

That's why I need a solution.
The point being, if you have planned and carried out the assassination perfectly, you should be able to "walk" away easily.

Any other solution will cause unrealistic effects/results like:

A group member who has been standing alone on the other side of the map all day doing nothing is all of a sudden setCaptive false - doesn't make sense, he hasn't been doing anything suspicious.

Same thing goes for an assassin who has perfectly infiltrated the assassination area and was never seen at all.

I might be picky, but that's my philosophy in mission editing... it has to make sense   :scratch:

Laggy