A3XAI-Final/A3XAI/compile/A3XAI_vehStartPatrol.sqf
Snark Industries c4a7084754 A3XAI Final Release (April 17, 2016 version)
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
2017-07-19 21:20:00 -04:00

24 lines
805 B
Plaintext

#include "\A3XAI\globaldefines.hpp"
private ["_unitGroup","_tooClose","_locationSelected"];
_unitGroup = _this select 0;
_tooClose = true;
_locationSelected = [0,0,0];
while {_tooClose} do {
_locationSelected = (A3XAI_locationsLand call A3XAI_selectRandom) select 1;
if (((waypointPosition [_unitGroup,0]) distance2D _locationSelected) > 300) then {
_tooClose = false;
};
};
_locationSelected = [_locationSelected,random(300),random(360),0,[1,300]] call A3XAI_SHK_pos;
[_unitGroup,0] setWPPos _locationSelected;
[_unitGroup,0] setWaypointCompletionRadius 150;
if ((count (waypoints _unitGroup)) isEqualTo 1) then {
_unitGroup setCurrentWaypoint [_unitGroup,0];
};
if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: Set %1 waypoint position to %2.",_unitGroup,_locationSelected];};