Advertisement
InnovativeStudios

fn_spawnWave.sqf

Apr 30th, 2022
2,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 0.83 KB | None | 0 0
  1. /*
  2.     filename: @fn_spawnWave.sqf
  3.     Author: J. Schmidt
  4.     Coded for SOG Missions and Campaigns
  5.  
  6. */
  7.  
  8. params ["_spawn", "_attack", "_waves", "_side", "_cfgSide", "_cfgFaction", "_cfgUnitType", ["_units", []]];
  9.  
  10. SpawnEnemies = true;
  11. _wave = 0;
  12.  
  13. while {SpawnEnemies} do {
  14.     _rdmSquad = _units call BIS_fnc_selectRandom;
  15.     // (configFile >> "CfgPatches" >> "CfgSide" >> "CfgFaction" >> "CfgUnitType" >> "CfgUnitClassName" or "CfgGroupClassName" or "CfgVehicleClassName")
  16.     _grp = [getMarkerPos _spawn, _side, (configFile >> "CfgGroups" >> _cfgSide >> _cfgFaction >> _cfgUnitType >> _rdmSquad)] call BIS_fnc_spawnGroup;
  17.     null = [_grp, (getMarkerPos _attack)] call BIS_fnc_taskAttack;
  18.     waitUntil {{alive _x} count (units _grp) == 0};
  19.  
  20.     _wave = _wave + 1;
  21.     if (_wave < _waves) then { SpawnEnemies = true } else { SpawnEnemies = false };
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement