Jump to content
Sign in to follow this  
shanawa

Is there a way to report who detected who?

Recommended Posts

I didn't see any event handlers that would help me on this one. I can make a seperate trigger for each player and report that the player was detected but I'm not sure how to have 1 trigger report which ai detected which player.

Currently I have a trigger for each player BLUFOR/DETECTED by OPFOR/ ONCE:

Condition:

p1 in thislist

Activation:

hint"Player 1 has been detected.";

Share this post


Link to post
Share on other sites

I think that the magical knowsAbout value to ID a unit is 0.105, so once a detected-trigger has fired you should be able to check what unit(s) has a knowsAbout value of 0.105 or higher for the detected unit.

Share this post


Link to post
Share on other sites

Thanks.

Wouldn't I have to name each unit and run a separate check for each unit? I don't know of a way to ask logically if any units knowsabout then report name of said unit. The biki on knowsabout says Number = unit knowsAbout target . So I would then have to name each unit and run a check on them individually.

On activation:

kv1 = e1 knowsabout p1;
kv2 = e2 knowsabout p1;
if (kv1>0) then {hint"e1 knows about p1";};
if (kv2>0) then {hint"e2 knows about p1";}; 

This works on a simple utes test with 2 soldiers. But I was looking for an easier way like how the killed event handler reports unit killed and the killer, I was hoping something would report the detector and the detected.

Share this post


Link to post
Share on other sites

_target = _this select 0;
_detectors = _this select 1;
_hasDetected = [];

{
if (!(_x side = _target side)) and ((_x knowsAbout _target) > 0.105) then
{
	[_hasDetected, _x] call BIS_fnc_arrayPush;
};
} forEach _detectors;

_hasDetected;

UnitsThatHaveDetectedPlayer = [player, allUnits] ExecVM "Detected.sqf";

UnitsThatHaveDetectedPlayer = [player, list TRIGGERNAME] ExecVM "Detected.sqf";

Edited by AgentD

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  

×