2023-09-23 14:05:31 +00:00
|
|
|
/*
|
|
|
|
By Ghostrider [GRG]
|
|
|
|
*/
|
|
|
|
#include "\GMS\Compiles\Init\GMS_defines.hpp"
|
|
|
|
|
2023-09-25 19:54:52 +00:00
|
|
|
params["_coords",["_missionEmplacedWeapons",[]],["_useRelativePos",true],["_aiDifficultyLevel","red"],["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]]];
|
2023-09-23 14:05:31 +00:00
|
|
|
if (_uniforms isEqualTo []) then {_uniforms = [_aiDifficultyLevel] call GMS_fnc_selectAIUniforms};
|
|
|
|
if (_headGear isEqualTo []) then {_headGear = [_aiDifficultyLevel] call GMS_fnc_selectAIHeadgear};
|
|
|
|
if (_vests isEqualTo []) then {_vests = [_aiDifficultyLevel] call GMS_fnc_selectAIVests};
|
|
|
|
if (_backpacks isEqualTo []) then {_backpacks = [_aiDifficultyLevel] call GMS_fnc_selectAIBackpacks};
|
2023-10-03 00:05:16 +00:00
|
|
|
if (_weaponList isEqualTo []) then {_weaponList = [_aiDifficultyLevel] call GMS_fnc_selectAILoadout};
|
2023-09-23 14:05:31 +00:00
|
|
|
if (_sideArms isEqualTo []) then {[_aiDifficultyLevel] call GMS_fnc_selectAISidearms};
|
|
|
|
|
2023-09-25 19:54:52 +00:00
|
|
|
private["_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"];
|
2023-09-23 14:05:31 +00:00
|
|
|
_emplacedWeps = [];
|
|
|
|
_emplacedAI = [];
|
|
|
|
_units = [];
|
|
|
|
_abort = false;
|
|
|
|
_pos = [];
|
|
|
|
|
|
|
|
private _emplacedWepData = +_missionEmplacedWeapons; // So we dont overwrite this for the next instance of the mission
|
|
|
|
|
|
|
|
{
|
|
|
|
_x params [["_static",""],["_pos",[0,0,0]],["_dir",0]];
|
2023-10-06 11:09:26 +00:00
|
|
|
//diag_log format["_spawnEmplacedWeaponArray: _emplacedWedData %11 = %2",_forEachIndex,_x];
|
2023-10-03 00:05:16 +00:00
|
|
|
if (isClass(configFile >> "CfgVehicles" >> _static)) then {
|
|
|
|
if (_useRelativePos) then
|
|
|
|
{
|
|
|
|
_pos = _coords vectorAdd _pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define configureWaypoints false
|
|
|
|
#define numberAI 1
|
|
|
|
#define areaDimensions [] // an empty array forces the spawnGroup function to skip setup of any waypoint
|
2023-10-13 01:26:29 +00:00
|
|
|
/*
|
|
|
|
params[
|
|
|
|
["_pos",[-1,-1,1]],
|
|
|
|
["_numbertospawn",0],
|
|
|
|
["_skillLevel","red"],
|
|
|
|
["_areaDimensions",[]],
|
|
|
|
["_uniforms",[]],
|
|
|
|
["_headGear",[]],
|
|
|
|
["_vests",[]],
|
|
|
|
["_backpacks",[]],
|
|
|
|
["_weaponList",[]],
|
|
|
|
["_sideArms",[]],
|
|
|
|
["_scuba",false],
|
|
|
|
["_timeOut",300],
|
|
|
|
["_waypointclass","Soldier"]
|
|
|
|
];
|
|
|
|
*/
|
|
|
|
private _empGroup = [_pos,numberAI,_aiDifficultyLevel,areaDimensions,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,-1,"Turret"] call GMS_fnc_spawnGroup;
|
2023-10-03 00:05:16 +00:00
|
|
|
_empGroup setcombatmode "RED";
|
|
|
|
_empGroup setBehaviour "COMBAT";
|
|
|
|
_empGroup setVariable ["soldierType","emplaced"];
|
2023-09-23 14:05:31 +00:00
|
|
|
|
2023-10-03 00:05:16 +00:00
|
|
|
// TODO: recode to use GMS_fnc to create vehicle
|
|
|
|
//private _wep = [_static,_pos] call GMS_fnc_spawnVehicle;
|
|
|
|
/*
|
|
|
|
["_className",""], // Clasname of vehicle to be spawned
|
|
|
|
["_spawnPos",[0,0,0]], // selfevident
|
|
|
|
["_dir",0], // selfevident
|
|
|
|
["_height",0],
|
|
|
|
["_disable",0], // damage value set to this value if less than this value when all crew are dead
|
|
|
|
["_removeFuel",0.2], // fuel set to this value when all crew dead
|
|
|
|
["_releaseToPlayers",true],
|
|
|
|
["_deleteTimer",300],
|
|
|
|
["_vehHitCode",[]],
|
|
|
|
["_vehKilledCode",[]]
|
|
|
|
*/
|
|
|
|
//_wep setVariable["GRG_vehType","emplaced"];
|
|
|
|
//_wep setPosATL _pos;
|
|
|
|
//_wep setdir _dir;
|
2023-09-23 14:05:31 +00:00
|
|
|
|
2023-10-03 00:05:16 +00:00
|
|
|
// TODO: recode to use GMS_fnc to handle this if needed
|
|
|
|
//[_wep,2] call GMS_fnc_configureMissionVehicle;
|
|
|
|
#define height 0
|
|
|
|
#define removeFuel 0
|
|
|
|
#define vehHitCode []
|
|
|
|
#define vehKilledCode []
|
|
|
|
private _damage = if (GMS_killEmptyStaticWeapons) then {1} else {0};
|
|
|
|
private _releaseToPlayers = if (GMS_killEmptyStaticWeapons) then {false} else {true};
|
|
|
|
private _wep = [_static,_pos,_dir,height,_damage,removeFuel,_releaseToPlayers,GMS_vehicleDeleteTimer,vehHitCode,vehKilledCode] call GMSCore_fnc_spawnPatrolVehicle;
|
|
|
|
_wep setVariable["GMS_vehType","emplaced"];
|
|
|
|
_emplacedWeps pushback _wep;
|
|
|
|
[_wep,_empGroup] call GMSCore_fnc_loadVehicleCrew;
|
|
|
|
//diag_log format["_spawnEmplacedWeaponArray(91): _wep = %1 | getPos _wep = %2 | _static = %3",_wep, getPosATL _wep, _static];
|
|
|
|
//_gunner setVariable["GRG_vehType","emplaced"];
|
2023-10-14 16:50:53 +00:00
|
|
|
_emplacedAI append (units _empGroup);
|
2023-10-03 00:05:16 +00:00
|
|
|
} else {
|
|
|
|
[format["GMS_fnc_spawnEmplacedWeaponArray: Invalid classname %1 used in _missionEmplacedWeapons", _static],"warning"] call GMS_fnc_log;
|
|
|
|
};
|
2023-09-23 14:05:31 +00:00
|
|
|
} forEach _emplacedWepData;
|
|
|
|
GMS_monitoredVehicles append _emplacedWeps;
|
2023-10-06 11:09:26 +00:00
|
|
|
//[format["GMS_fnc_spawnEmplacedWeaponArray: count _emplacedAI = %1", count _emplacedAI]] call GMS_fnc_log;
|
2023-09-23 14:05:31 +00:00
|
|
|
[_emplacedWeps,_emplacedAI]
|
|
|
|
|