SHARE
TWEET

Hunting Groups

Pwner-Actual Feb 20th, 2019 (edited) 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // =======================================================================================
  2. // =======================================  SETUP  =======================================
  3. // =======================================================================================
  4. // INSTRUCTIONS
  5. // =======================================================================================
  6. /*
  7.     USAGE   :   Server only.
  8.     PURPOSE :   Spawn hunting groups that will target a random prey's last known location.
  9.    
  10.     EXAMPLE :   nul = [[p_1,p_2],[250,500],["INDEPENDENT SYNDIKAT","EAST CSAT"],[safeTrigger_1,"safeMarker"],[5,30],"RANDOM",0,0] execVM "UAF\huntingGroups.sqf";
  11.     EXAMPLE :   nul = [allPlayers - entities "HeadlessClient_F",[300,600],["EAST CSAT PACIFIC"],[],[15,45],"FULL",1,0] execVM "UAF\huntingGroups.sqf";
  12.    
  13.     FORMAT  :   nul = [[A],[B,C],["D"],[E],[F,G],"H",I,J] execVM "huntingGroups.sqf";
  14.     FORMAT  :   nul = [[A],[B,C],["D"],[E,"E"],[F,G],"H",I,J] execVM "huntingGroups.sqf";
  15.     A =         Array of unit names that can be chosen as prey for the hunting groups.
  16.                     One prey is randomly selected each time.
  17.                     Make sure the units exist (i.e. no disabled playable AI)
  18.     B =         1st element of Radius array.
  19.                     Minimum distance in meters from which no hunting group can spawn from a prey.
  20.     C =         2nd element of Radius array.
  21.                     Maximum distance in meters from the randomly chosen prey at which the hunting group can spawn.
  22.                     When the group is more than this distance from all preys, it will be deleted.
  23.     D =         Array of strings of groups that can be spawned — one is chosen randomly if more than one is listed.
  24.                     Here are the possible choices :
  25.                         "WEST NATO"
  26.                         "WEST NATO PACIFIC"
  27.                         "WEST GUERILLA"
  28.                         "WEST CTRG"
  29.                         "EAST CSAT"
  30.                         "EAST CSAT PACIFIC"
  31.                         "INDEPENDENT AAF"
  32.                         "INDEPENDENT SYNDIKAT"
  33.     E =         Array of trigger or "marker" names serving as safe zones.
  34.                     A prey within a safe zone cannot be selected as the current prey.
  35.                     A hunting group will not spawn within a safe zone.
  36.                     However, hunting groups can still cross thru or fire at units in safe zones.
  37.     F =         1st element of Wait array.
  38.                     Minimum amount of seconds to wait before spawning a new group when the previous one is dead or deleted.
  39.     G =         2nd element of Wait array.
  40.                     Maximum amount of seconds to wait before spawning a new group when the previous one is dead or deleted.
  41.     H =         String ("RANDOM" or "FULL").
  42.                     "RANDOM" :  A hunting group will have minimally an amount of units equal to the amount of preys alive.
  43.                                 There is also a random chance that a full group spawns.
  44.                                 Ex.: 2 preys are alive — the hunting group will spawn at least 2 units, or maybe more.
  45.                     "FULL" :    A hunting group will spawn with full units.
  46.                                 Ex.: if normally the group contains 6 units, then 6 units will spawn regardless of the amount of preys alive.
  47.     I =         Number (1 or 0)
  48.                 If number is 1 :    • the group will have a modified skillset considering that it travelled far and fast but is on the hunt.
  49.                                     • ex.: lower accuracy and precision but more courage and spotting distance.
  50.     J =         Number (1 or 0)
  51.                 If number is 1 : debug is enabled — markers as well as hints will show radiuses, timer, positions, safe zones...
  52.                 If number is 0 : debug is deactivated.
  53. */
  54. // =======================================================================================
  55. // SERVER ONLY
  56. // =======================================================================================
  57. if (!isServer) exitWith {};
  58. // =======================================================================================
  59. // DEFINE & DECLARE VARIABLES
  60. // =======================================================================================
  61. //      VARS & VALUES THRU ARGUMENTS
  62. // =======================================================================================
  63. private _preyList   = _this select 0;               // A
  64. private _minRad     = (_this select 1) select 0;    // B
  65. private _maxRad     = (_this select 1) select 1;    // C
  66. private _groups     = _this select 2;               // D
  67. private _safeZones  = _this select 3;               // E
  68. private _minRest    = (_this select 4) select 0;    // F
  69. private _maxRest    = (_this select 4) select 1;    // G
  70. private _hunterCnt  = _this select 5;               // H
  71. private _skill      = _this select 6;               // I
  72. private _debug      = _this select 7;               // J
  73. // =======================================================================================
  74. //      VARS & VALUES THRU SCRIPT
  75. // =======================================================================================
  76. private ["_grp","_grpCnt","_wp","_relDir","_safeZoneMkr","_szIcoMkr"];
  77. private _wpMkr          = "";
  78. private _huntMkrs       = [];
  79. private _preyMkrs       = [];
  80. private _minRadMkrs     = [];
  81. private _maxRadMkrs     = [];
  82. private _safeZoneMkrs   = [];
  83. private _szIcoMkrs      = [];
  84. private _rockBuff       = 30; // buffer radius for rock positions
  85. // =======================================================================================
  86. // ====================================  SCRIPT  =========================================
  87. // =======================================================================================
  88. //  CONTINUOUS LOOP
  89. // =======================================================================================
  90. while {true} do {
  91. // =======================================================================================
  92. // DEFINE & DECLARE VARS & VALUES (to avoid undefined errors)
  93. // =======================================================================================
  94. private _alivePreys     = [];
  95. private _targetPos      = [0,0];
  96. private _pos            = [0,0];
  97. private _rocks          = [];
  98. // =======================================================================================
  99. //  CHECK CONDITIONS TO CALCULATE A SPAWN POSITION
  100. // =======================================================================================
  101. while
  102.     {
  103.     (count _alivePreys < 1)                                                     // no preys alive
  104.     or
  105.     ({_targetPos inArea _x} count _safeZones > 0)                               // selected prey is in a safezone
  106.     or
  107.     ({_pos inArea _x} count _safeZones > 0)                                     // spawn position is in a safezone
  108.     or
  109.     (surfaceIsWater _pos)                                                       // spawn position is on water
  110.     or
  111.     ({getPos _x distance _pos < _minRad} count _alivePreys >= 1)                // spawn position is too close to a prey
  112.     or
  113.     ({getPos _x distance _pos <= _rockBuff} count _rocks >= 1)                  // spawn position is too close to a rock
  114.     }
  115. // =======================================================================================
  116. //      KEEP CALCULATING (random point in circle relative to min/max radius from center)
  117. // =======================================================================================
  118. do  {
  119.     _alivePreys = _preyList select {alive _x;};                                     // check if preys are alive
  120.     if      (count _alivePreys >= 1)                                                // if there are preys then plot a spawn position
  121.     then    {
  122.             _targetPos  = getPos (selectRandom _alivePreys);                        // choose random prey and get its coordinates
  123.             _pos    = [(_targetPos select 0)+((_minRad)+(random(_maxRad-_minRad)))*(cos(random 360)),(_targetPos select 1)+((_minRad)+(random(_maxRad-_minRad)))*(sin(random 360))];
  124.             _rocks  = nearestTerrainObjects [_pos,["ROCK","ROCKS"],_rockBuff];      // get nearby rocks to avoid spawning in them
  125.             _relDir = _pos getDir _targetPos;
  126.             };
  127.     sleep 1;
  128.     }; 
  129. // =======================================================================================
  130. //  SPAWN A HUNTING GROUP
  131. // =======================================================================================
  132. //      SELECT AMOUNT OF UNITS IN GROUP
  133. // =======================================================================================
  134. switch (_hunterCnt) do {
  135.     case "RANDOM":
  136.         {_grpCnt = [count _alivePreys, random 1];}; // minimally equal to amount of preys alive (and maybe more)
  137.     case "FULL":
  138.         {_grpCnt = [1,1];};                         // spawn a full group regardless of amount of preys alive
  139. };
  140. // =======================================================================================
  141. //      SELECT A RANDOM A HUNTING GROUP FROM ARGUMENT LIST
  142. // =======================================================================================
  143. _group = selectRandom _groups;
  144. switch (_group) do {
  145.     case "WEST NATO":
  146.         {
  147.         _type1  = selectRandom ["BUS_InfSentry","BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AA","BUS_InfTeam_AT","BUS_ReconPatrol","BUS_ReconSentry","BUS_ReconTeam","BUS_SniperTeam"];
  148.         _type2  = selectRandom ["BUS_Recon_EOD","BUS_Support_CLS","BUS_Support_ENG","BUS_Support_EOD","BUS_Support_GMG","BUS_Support_MG","BUS_Support_Mort"];
  149.         _type   = selectRandom [_type1,_type2];
  150.         if (_type == _type1) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  151.         if (_type == _type2) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Support" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  152.         };
  153.     case "WEST NATO PACIFIC":
  154.         {
  155.         _type1  = selectRandom ["B_T_InfSquad","B_T_InfSquad_Weapons","B_T_InfTeam","B_T_InfTeam_AT","B_T_InfTeam_AA","B_T_InfSentry","B_T_ReconTeam","B_T_ReconPatrol","B_T_ReconSentry","B_T_SniperTeam"];
  156.         _type2  = selectRandom ["B_T_Support_CLS","B_T_Support_EOD","B_T_Support_ENG","B_T_Recon_EOD","B_T_Support_MG","BUS_Support_MG","B_T_Support_GMG","B_T_Support_Mort"];
  157.         _type   = selectRandom [_type1,_type2];
  158.         if (_type == _type1) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  159.         if (_type == _type2) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  160.         };
  161.     case "WEST GUERILLA":
  162.         {
  163.         _type1  = selectRandom ["IRG_InfSentry","IRG_InfSquad","IRG_InfSquad_Weapons","IRG_InfTeam","IRG_InfTeam_AA","IRG_InfTeam_AT","IRG_ReconSentry","IRG_SniperTeam"];
  164.         _type2  = selectRandom ["IRG_Support_CLS","IRG_Support_ENG","IRG_Support_EOD"];
  165.         _type   = selectRandom [_type1,_type2];
  166.         if (_type == _type1) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "Guerilla" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  167.         if (_type == _type2) then {_grp = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "Guerilla" >> "Support" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  168.         };
  169.     case "WEST CTRG":
  170.         {
  171.         _type   = selectRandom ["CTRG_InfSentry","CTRG_InfSquad","CTRG_InfTeam"];
  172.         _grp    = [_pos,West,(configfile >> "CfgGroups" >> "West" >> "BLU_CTRG_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;
  173.         };
  174.     case "EAST CSAT":
  175.         {
  176.         _type1  = selectRandom ["OI_reconPatrol","OI_reconSentry","OI_reconTeam","OI_SniperTeam","OIA_InfSentry","OIA_InfSquad","OIA_InfSquad_Weapons","OIA_InfTeam","OIA_InfTeam_AA","OIA_InfTeam_AT"];
  177.         _type2  = selectRandom ["OI_recon_EOD","OI_support_CLS","OI_support_ENG","OI_support_EOD","OI_support_GMG","OI_support_MG","OI_support_Mort"];
  178.         _type3  = selectRandom ["OIA_GuardSentry","OIA_GuardSquad","OIA_GuardTeam"];
  179.         _type   = selectRandom [_type1,_type2,_type3];
  180.         if (_type == _type1) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  181.         if (_type == _type2) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Support" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  182.         if (_type == _type3) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "UInfantry" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  183.         };
  184.     case "EAST CSAT PACIFIC":
  185.         {
  186.         _type1  = selectRandom ["O_T_InfSentry","O_T_InfSquad","O_T_InfSquad_Weapons","O_T_InfTeam","O_T_InfTeam_AA","O_T_InfTeam_AT","O_T_reconPatrol","O_T_reconSentry","O_T_reconTeam","O_T_SniperTeam"];
  187.         _type2  = selectRandom ["O_T_recon_EOD","O_T_support_CLS","O_T_support_ENG","O_T_support_EOD","O_T_support_GMG","O_T_support_MG","O_T_support_Mort"];
  188.         _type3  = selectRandom ["O_T_ViperTeam"];
  189.         _type   = selectRandom [_type1,_type2,_type3];
  190.         if (_type == _type1) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_T_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  191.         if (_type == _type2) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_T_F" >> "Support" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  192.         if (_type == _type3) then {_grp = [_pos,East,(configfile >> "CfgGroups" >> "East" >> "OPF_T_F" >> "SpecOps" >> _type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  193.         };
  194.     case "INDEPENDENT AAF":
  195.         {
  196.         _type1  = selectRandom ["HAF_InfSentry","HAF_InfSquad","HAF_InfSquad_Weapons","HAF_InfTeam","HAF_InfTeam_AA","HAF_InfTeam_AT","HAF_SniperTeam"];
  197.         _type2  = selectRandom ["HAF_support_CLS","HAF_support_ENG","HAF_support_EOD","HAF_support_GMG","HAF_support_MG","HAF_support_Mort"];
  198.         _type   = selectRandom [_type1,_type2];
  199.         if (_type == _type1) then {_grp = [_pos,Independent,(configfile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  200.         if (_type == _type2) then {_grp = [_pos,Independent,(configfile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Support" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;};
  201.         };
  202.     case "INDEPENDENT SYNDIKAT":
  203.         {
  204.         _type   = selectRandom ["BanditCombatGroup","BanditFireTeam","BanditShockTeam","ParaCombatGroup","ParaFireTeam","ParaShockTeam"];
  205.         _grp    = [_pos,Independent,(configfile >> "CfgGroups" >> "Indep" >> "IND_C_F" >> "Infantry" >>_type),[],[],[],[],_grpCnt,_relDir] call BIS_fnc_spawnGroup;
  206.         };
  207. };
  208. _grp deleteGroupWhenEmpty true; // make sure the group is deleted when dead
  209. // =======================================================================================
  210. //      SET SKILLS — CONSIDERING THE GROUP IS SPRINTING OVER A LONG DISTANCE
  211. // =======================================================================================
  212. if      (_skill == 1)
  213. then    {
  214.         (units _grp) apply {
  215.             _x setskill ["aimingAccuracy",0.1];
  216.             _x setskill ["aimingShake",0.1];
  217.             _x setskill ["aimingSpeed",0.5];
  218.             _x setskill ["spottime",0.9];
  219.             _x setskill ["spotdistance",0.9];
  220.             _x setskill ["courage",0.9];
  221.             _x setskill ["commanding",0.9];
  222.             _x setskill ["reloadspeed",0.1];
  223.             };
  224.         };
  225. // =======================================================================================
  226. //  CREATE A "SEARCH & DESTROY" WAYPOINT AT TARGET'S LAST POSITION
  227. // =======================================================================================
  228. _form = selectRandom ["LINE","STAG COLUMN","WEDGE","DIAMOND","FILE"];   // choose random formation
  229. [_grp, 0]   setWaypointFormation _form;                                 // set formation
  230. [_grp, 0]   setWaypointCombatMode "RED";                                // fire at will
  231. [_grp, 0]   setWaypointSpeed "FULL";                                    // sprint
  232. _wp         = _grp addWaypoint [_targetPos, 0];                         // set WP position
  233. _wp         setWaypointPosition [_targetPos, 0];                        // precise placement
  234. _wp         setWaypointType "SAD";                                      // search and destroy
  235. // =======================================================================================
  236. //  DEBUG STATIC MARKERS
  237. // =======================================================================================
  238. if      (_debug == 1)
  239. then    {
  240.         // hunt waypoint
  241.         _wpMkrN = format ["marker_%1",floor(random 1000)];
  242.         _wpMkr  = createMarker [_wpMkrN, _targetPos];
  243.         _wpMkr  setMarkerShape "ICON";
  244.         _wpMkr  setMarkerType "hd_objective";
  245.         _wpMkr  setMarkerColor "ColorYellow";
  246.         _wpMkr  setMarkerText "HUNT WAYPOINT";
  247.         // min radius from each prey
  248.         _alivePreys apply {
  249.             _minRadN    = format ["marker_%1",floor(random 1000)];
  250.             _minRadMkr  = createMarker [_minRadN, getPos _x];
  251.             _minRadMkr  setMarkerShape "ELLIPSE";
  252.             _minRadMkr  setMarkerSize [_minRad,_minRad];
  253.             _minRadMkr  setMarkerBrush "Horizontal";
  254.             _minRadMkr  setMarkerAlpha 1;
  255.             _minRadMkr  setMarkerColor "ColorBlue";
  256.             _minRadMkrs append [_minRadMkr];
  257.             };
  258.         // safe zones circles
  259.         _safeZones apply {     
  260.             _safeZoneN      = format ["marker_%1",floor(random 1000)];
  261.             if (typeName _x == "STRING") then {_safeZoneMkr = createMarker [_safeZoneN, getMarkerPos _x];};
  262.             if (typeName _x == "OBJECT") then {_safeZoneMkr = createMarker [_safeZoneN, position _x];};
  263.             _safeZoneMkr    setMarkerShape "ELLIPSE";
  264.             _safeZoneMkr    setMarkerSize [(triggerArea _x) select 0,(triggerArea _x) select 1];
  265.             _safeZoneMkr    setMarkerBrush "SolidFull";
  266.             _safeZoneMkr    setMarkerAlpha 0.25;
  267.             _safeZoneMkr    setMarkerColor "ColorCIV";
  268.             _safeZoneMkrs   append [_safeZoneMkr];
  269.         // safe zones icons
  270.             _szIcoMkrN      = format ["marker_%1",floor(random 1000)];
  271.             if (typeName _x == "STRING") then {_szIcoMkr = createMarker [_szIcoMkrN, getMarkerPos _x];};
  272.             if (typeName _x == "OBJECT") then {_szIcoMkr = createMarker [_szIcoMkrN, position _x];};   
  273.             _szIcoMkr       setMarkerShape "ICON";
  274.             _szIcoMkr       setMarkerType "mil_box";
  275.             _szIcoMkr       setMarkerColor "ColorWhite";
  276.             _szIcoMkr       setMarkerText "SAFEZONE";
  277.             _szIcoMkrs      append [_szIcoMkr];
  278.             };
  279.         };
  280. // =======================================================================================
  281. //  WAIT FOR GROUP'S DEATH OR TOO GREAT A DISTANCE FROM TARGETS
  282. // =======================================================================================
  283. while
  284.     {
  285.     // hunting group is still alive
  286.     ({alive _x} count units _grp >= 1)
  287.     and
  288.     // hunting group is not too far from all preys
  289.     ({(getPos _x) distance (getPos leader _grp) > _maxRad} count _alivePreys < (count _alivePreys))
  290.     and
  291.     // not all preys are dead
  292.     (count _alivePreys >= 1)
  293.     }
  294. do  {
  295.     _alivePreys = _preyList select {alive _x;};                     // get list of alive preys
  296. // =======================================================================================
  297. //      DYNAMIC DEBUG MARKERS
  298. // =======================================================================================
  299.     if      (_debug == 1)
  300.     then    {
  301.             // hunter markers
  302.             _huntMkrs apply {deleteMarker _x;};
  303.             _huntMkrs = [];
  304.             (units _grp) apply {
  305.                 _huntMkrN   = format ["marker_%1",floor(random 1000)];
  306.                 _huntMkr    = createMarker [_huntMkrN, getPos _x];
  307.                 _huntMkr    setMarkerShape "ICON";
  308.                 _huntMkr    setMarkerType "mil_triangle";
  309.                 _huntMkr    setMarkerColor "ColorRed";
  310.                 _huntMkr    setMarkerText "HUNTER";
  311.                 _huntMkr    setMarkerDir (getDir _x);
  312.                 _huntMkrs   append [_huntMkr];
  313.                 };
  314.             // prey markers
  315.             _preyMkrs apply {deleteMarker _x;};
  316.             _preyMkrs = [];
  317.             _alivePreys apply {
  318.                 _preyMkrN   = format ["marker_%1",floor(random 1000)];
  319.                 _preyMkr    = createMarker [_preyMkrN, getPos _x];
  320.                 _preyMkr    setMarkerShape "ICON";
  321.                 _preyMkr    setMarkerType "mil_dot";
  322.                 _preyMkr    setMarkerColor "ColorGreen";
  323.                 _preyMkr    setMarkerText "PREY";
  324.                 _preyMkrs   append [_preyMkr];
  325.                 };
  326.             // max radius markers
  327.             _maxRadMkrs apply {deleteMarker _x;};
  328.             _maxRadMkrs = [];
  329.             _alivePreys apply {
  330.                 _maxRadN    = format ["marker_%1",floor(random 1000)];
  331.                 _maxRadMkr  = createMarker [_maxRadN, getPos _x];
  332.                 _maxRadMkr  setMarkerShape "ELLIPSE";
  333.                 _maxRadMkr  setMarkerSize [_maxRad,_maxRad];
  334.                 _maxRadMkr  setMarkerBrush "Solid";
  335.                 _maxRadMkr  setMarkerAlpha 0.75;
  336.                 _maxRadMkr  setMarkerColor "ColorOrange";
  337.                 _maxRadMkrs append [_maxRadMkr];
  338.                 };
  339.             };
  340.     sleep 2;   
  341.     };
  342. // =======================================================================================
  343. //  RESET
  344. // =======================================================================================
  345. //      DELETE GROUP IF TOO FAR FROM PREYS OR IF ALL PREYS ARE DEAD
  346. // =======================================================================================
  347. if      (
  348.         ({(getPos _x) distance (getPos leader _grp) > _maxRad} count _alivePreys == (count _alivePreys))
  349.         or
  350.         (count _alivePreys < 1)
  351.         )
  352. then    {(units _grp) apply {deleteVehicle _x};};
  353. // =======================================================================================
  354. //      DELETE MARKERS IF DEBUG ENABLED
  355. // =======================================================================================
  356. if      (_debug == 1)
  357. then    {
  358.         _huntMkrs       apply {deleteMarker _x;};
  359.         _preyMkrs       apply {deleteMarker _x;};
  360.         _minRadMkrs     apply {deleteMarker _x;};
  361.         _maxRadMkrs     apply {deleteMarker _x;};
  362.         _safeZoneMkrs   apply {deleteMarker _x;};
  363.         _szIcoMkrs      apply {deleteMarker _x;};
  364.         deleteMarker    _wpMkr;
  365.         };
  366. deleteWaypoint _wp;                         // remove waypoint
  367. // =======================================================================================
  368. //  REST TIME BETWEEN SPAWNS
  369. // =======================================================================================
  370. _wait = (_minRest)+(floor(random(_maxRest - _minRest)));    // random sleep relative to arguments
  371. // =======================================================================================
  372. //      DEBUG ON — HINT TIME REMAINING
  373. // =======================================================================================
  374. if      (_debug == 1)
  375. then    {
  376.         while   {_wait > 0}
  377.         do      {
  378.                 if      (_wait == 1)
  379.                 then    {hint "Next hunting group in 1 second";}
  380.                 else    {hint format ["Next hunting group in %1 seconds", _wait];};            
  381.                 sleep 1;
  382.                 _wait = _wait - 1;             
  383.                 };
  384.         hint "";
  385.         }
  386. // =======================================================================================
  387. //      DEBUG OFF
  388. // =======================================================================================
  389. else    {sleep _wait;};
  390. // =======================================================================================
  391. //  RESTART
  392. // =======================================================================================
  393. };  // loop
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top