fnc_spawnerInit.sqf 1.0 KB

123456789101112131415161718
  1. #include "function_macros.hpp"
  2. params ["_target"];
  3. if(!isServer) exitWith
  4. {
  5. LOG_ERROR("Not Server, Exiting PFH");
  6. };
  7. LOGF_1("Initialising spawner %1",_target);
  8. // TODO: Read these vars from config, maybe CfgVehicles to allow placement of vehicles, although may be better to use static object with HP and destroyed mesh rather
  9. _target setVariable [QGVAR(group), createGroup [opfor, true]]; // group that units will be spawned into
  10. _target setVariable [QGVAR(boundUnits), []]; // units currently bound to this unit
  11. _target setVariable [QGVAR(maxUnits),20]; // max units that can be alive at any time from this spawner
  12. _target setVariable [QGVAR(possibleUnits),["RD501_opfor_unit_B2_droid_Standard","RD501_opfor_unit_b1_grenadier","RD501_opfor_unit_B2_droid_Standard","RD501_opfor_unit_B1_AT_heavy","RD501_opfor_unit_B1","RD501_opfor_unit_B1_marksman"]];
  13. // Start PFH
  14. LOGF_1("Attempting to start PFH on %1",_target);
  15. _params= [_target];
  16. _handle = [FUNC(spawnDroidPFH), GVAR(spawnTime), _params] call CBA_fnc_addPerFrameHandler;