Вроде как нет стандартных средств на проверку, может ли один юнит видеть другого юнита.
Вот тут спросил.
Поэтому выкладываю свою функцию для сей проверки. (Там скорее всего есть баги )
Kurt_fnc_isInFOV = { /* Author: Kurt Description: checks if the given unit can see another unit Parameter(s): 0: OBJECT - the main character of this book 1: OBJECT - the unit, we try to see Returns: BOOL */ params["_unit", "_target"]; private ["_return", "_vis", "_uia"]; _return = false; _vis = lineIntersects [eyePos _unit, eyePos _target, _unit, _target]; if(_vis) exitWith { false }; _uia = [getpos _unit, getdir _unit, 90, getpos _target] call BIS_fnc_inAngleSector; if(_uia) exitWith { true }; _return; };
Пример:
_s = [player, BILL] call Kurt_fnc_isInFOV; if(_s) then { hintSilent "I see you, Bill!"; };
Видео
Сообщение отредактировал Kurt212: 19 April 2016 - 23:06