Jump to content
jhonenglish

Visibility Condtion

Recommended Posts

hi, im trying to script an action that its condition will be that you are not visible to enemy units.

*( the idea is that you can switch your identitiy (i made an action for that) by luting a dead enemy corpse, but it will be stupid if this works when the enemy can see you doing it)*

i tried to do this: 

 

_visibilityCheck = {[objNull, "VIEW"] checkVisibility [eyePos (_this select 1), eyePos _x];} forEach (allUnits select {side _x isEqualTo east});

if (_visibilityCheck > 0) then {code...}.

 

------------------------

 

but it wont work, any ideas why? 

Share this post


Link to post
Share on other sites
private _canSeePlayer = [];

{
	if ((side group player) getFriend (side group _x) < 0.6 && alive _x && isNull objectParent _x && ([_x, "VIEW"] checkVisibility [eyePos player, eyePos _x]) > 0 && currentWeapon _x != "" && !(lifeState _x isEqualTo "INCAPACITATED")) then {_canSeePlayer = _canSeePlayer + [_x]; player knowsabout _x;}
} forEach allUnits;

if (_canSeePlayer isNotEqualTo []) then {//code};

That works for me when run on the client!

 

Good luck!

  • Like 1

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

×