Build 179, see changelog for details.

This commit is contained in:
Chris Cardozo 2019-07-19 17:00:30 -04:00
parent 5c0bdbd60d
commit d19502492f
56 changed files with 98 additions and 2854 deletions

View File

@ -1,16 +1,29 @@
v 6.92
1. Added code needed to use Claim Vehicle scripts on Exile Servers.
2. Added simulation management for dead AI when blck_useBlckeaglsSimulationManagement == true;
3. Deleted unused files.
4. A monitor to catch wandering units and send them back to the mission was added.
5. Some issues with vehicles not being unlocked when AI hop out.
6. Added a setting to disable deployment of smoke when AI heal.
1. [Added] simulation management for dead AI when blck_useBlckeaglsSimulationManagement == true;
2. [Deleted] unused files.
3. [Added] A monitor to catch wandering units and send them back to the mission.
4. [Fixed] Some issues with vehicles not being unlocked when AI hop out.
5. [Added] a setting to disable deployment of smoke when AI heal.
blck_useSmokeWhenHealing = true; // when true, injured AI will toss a smoke when they attempt to heal.
6. [Added] Support for claim-vehicle scripts is now built-in
blck_allowClaimVehicle = true; // To allow players to claim vehicles (Exile only).
7. [Added] an option to display kill notices using Toasts
blck_aiKillUseToast=true; // in blckClient.sqf in the debug folder of your mission.pbo to enable these.
8. [Added] Support for offloading AI to clients
////////
// Client Offloading and Headless Client Configurations
blck_useHC = true; // Experimental (death messages and rewards not yet working).
// Credit to Defent and eraser for their excellent work on scripts to transfer AI to clients upon which these scripts are based.
blck_ai_offload_to_client = true; // forces AI to be transfered to player's PCs. Disable if you have players running slow PCs.
blck_ai_offload_notifyClient = false; // Set true if you want notifications when AI are offloaded to a client PC. Only for testing/debugging purposes.
blck_limit_ai_offload_to_blckeagls = true; // when true, only groups spawned by blckeagls are evaluated.
9. [Fixed] An issue whereby vehicles would not unlock when AI got out of mission vehicles rather than being killed.
10. [Changed] code for spawning vehicles redone to reduced redundancy.
11. [Fixed] a bug whereby some types of loot containers could not be loaded in Epoch (Thanks to MGTDB for the fix).
V 6.90
1. Added new settings to specify the number of crew per vehhicle to blck_config.sqf and blck_config_mil.sqf
// global settings for this parameters

View File

@ -7,14 +7,26 @@
Offloads AI groups to a nearby client in order to improve server performance.
*/
private ["_groups"];
if (!blck_ai_offload_to_client) exitWith {};
if (blck_limit_ai_offload_to_blckeagls) then {_groups = blck_monitoredMissionAIGroups} else {_groups = allGroups};
#ifdef blck_debugMode
diag_log format[
"_fnc_ai_offloadToClients: blck_ai_offload_to_client = %1 | blck_limit_ai_offload_to_blckeagls = %2 | count blck_monitoredMissionAIGroups = %3",
blck_ai_offload_to_client,
blck_limit_ai_offload_to_blckeagls,
count _groups
];
#endif
{
if (((count (units _x))>1) && {!(_x getVariable ["blck_LockLocality",false])} && {!(blck_ai_offload_Only_blck_AI && {!(_x getVariable ["blck_SpawnedGroup",false])})}) then
//diag_log format["_fnc_ai_offloadToClients(26): _x = %1 | units _x = %2 | blck_lockLocality = %3",_x, units _x, _x getVariable["blck_LockLocality",false]];
if (((count (units _x))>1) && {!(_x getVariable ["blck_LockLocality",false])}) then
{
private _leader = leader _x;
private _group = _x;
//diag_log format["_fnc_ai_offloadToClients(31): evaluating group _x = %1 | leader _x = %2 | blck_lockLocality = %3",_x, leader _x, _x getVariable["blck_LockLocality",false]];
if !(isPlayer _leader) then
{
// Ignore Exile flyovers.
@ -25,6 +37,7 @@ if (blck_limit_ai_offload_to_blckeagls) then {_groups = blck_monitoredMissionAIG
(format ["AILocalityManager :: Finding owner for group: %1",_group]) call blck_fnc_DebugLog;
};
#endif
//diag_log format["_fnc_ai_offloadToClients(42): _x =%1 with owner = %2 is not a player's group so look for a home for it if still on the server",_x, groupOwner _x];
private _groupOwner = groupOwner _group;
private _ownerObj = objNull;
private _isLocal = local _group;
@ -38,11 +51,12 @@ if (blck_limit_ai_offload_to_blckeagls) then {_groups = blck_monitoredMissionAIG
};
} forEach allPlayers;
};
//diag_log format["_fnc_ai_offloadToClients(56): _group = %1 | _groupOwner = %2 | _ownerObj = %3 | _isLocal = %4",_group,_groupOwner,_ownerObj,_isLocal];
// If the owner doesn't exist or is too far away... Attempt to set a new player owner, and if none are found... and if the group doesn't belong to the server...
if (((isNull _ownerObj) || {(_ownerObj distance2D _leader)>3500}) && {!([_group,_leader] call blck_fnc_SetAILocality)} && {!_isLocal}) then
{
// Reset locality to the server
diag_log format["_fnc_ai_offloadToClients: setting locality of group %1 to server",_group];
_group setGroupOwner 2;
#ifdef blck_debugMode
if (blck_debugOn) then

View File

@ -16,7 +16,7 @@
*/
private _AI = param [0,objNull,[objNull,grpNull]];
//diag_log format["_fnc_setAILocality: _this = %1",_this];
if (isNull _AI) exitWith
{
diag_log format ["blckeagls ERROR :: Calling blck_fnc_SetAILocality with null parameter; _this: %1",_this];

View File

@ -0,0 +1,5 @@
params["_entity","_isLocal"];
diag_log format["_EH_changeLocality call with params = %1 | typeOf _entity %2 | _isLocal %3",_this,typeOf _entity,_isLocal];
if (isServer) then {[_entity] call blck_fnc_checkForEmptyVehicles}
else {};

View File

@ -10,8 +10,21 @@
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
//diag_log format["_EH_vehicleGetOut: _this = %1",_this];
_this remoteExec["blck_fnc_handleVehicleGetOut",2];
diag_log format["_EH_vehicleGetOut: _this = %1",_this];
if (isServer) then
{
_this call blck_fnc_handleVehicleGetOut
};
/* else {
if ((crew _this) isEqualTo []) then
{
private _veh = _this select 0;
//_veh lock 1;
diag_log format["_EH_vehicleGetOut: letting the server handle unit getout event for _vehicle %1",_veh];
};
};
//_this remoteExec["blck_fnc_handleVehicleGetOut",2];

View File

@ -8,8 +8,9 @@
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
if !(isServer) exitWith {};
params["_veh"];
//diag_log format["_fnc_checkForEmptyVehicle: _veh = %1 | count (crew _veh) = %2",_veh, count(crew _veh)];
//diag_log format["_fnc_checkForEmptyVehicle: _veh = %1 | typeOf _veh = %2 | count (crew _veh) = %3",_veh, typeOf _veh, count(crew _veh)];
if (crew(_veh) isEqualTo []) then
{
[_veh] call blck_fnc_handleEmptyVehicle;

View File

@ -21,6 +21,9 @@ _veh lock _locked;
_veh addMPEventHandler["MPHit",{ _this call blck_EH_AIVehicle_HandleHit}];
_veh addMPEventHandler["MPKilled",{_this call blck_EH_vehicleKilled}];
_veh addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}];
//_veh addEventHandler["Local", {if (isServer) then {_this call blck_EH_changeLocality}}];
blck_monitoredVehicles pushBackUnique _veh;
if (blck_modType isEqualTo "Epoch") then
{
if (blck_allowSalesAtBlackMktTraders) then {_veh setVariable["HSHALFPRICE",1,true]};

View File

@ -23,5 +23,5 @@ this addEventHandler ["GetOut", {
//diag_log format["_fnc_handleAIgetOut: _this = %1",_this];
private _veh = _this select 0;
private _unit = _this select 2;
//private _unit = _this select 2;
[_veh] call blck_fnc_checkForEmptyVehicle;

View File

@ -17,7 +17,7 @@ diag_log format["_fnc_releaseVehicleToPlayers: _veh = %1",_veh];
[_veh] call GMS_fnc_unlockServerVehicle;
{
_veh removealleventhandlers _x;
} forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
} forEach ["Local","GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
{
_veh removeAllMPEventHandlers _x;
} forEach ["MPHit","MPKilled"];

View File

@ -14,7 +14,17 @@
params["_vehicle"];
//diag_log format["_fnc+unlockServerVehicle: _vehicle = %1 | typeOf _vehicle = %2 | crewCount _vehicle = %3",_vehicle,typeOf _vehicle,count(crew _vehicle)];
//[_vehicle,"UNLOCKED"] remoteExec["setVehicleLock", owner _vehicle];
if !((owner _vehicle) isEqualTo 2) then {_vehicle setOwner 2};
_vehicle lock 0;
//if !((owner _vehicle) isEqualTo 2) then {_vehicle setOwner 2};
//_vehicle lock 0;
if (local _vehicle) then
{
_vehicle lock 1;
}
else
{
[_vehicle, 1] remoteExecCall ["lock", _vehicle];
};
//diag_log format["_fn_unlockServerVehicle: owner of vehicle %1 = %2",_vehicle, owner _vehicle];
diag_log format["_fn_unlockServerVehicle: vehicle %1 lock state set to %2",_vehicle,locked _vehicle];

View File

@ -22,8 +22,7 @@ for "_i" from 1 to (count blck_monitoredVehicles) do
// if the owner is a player do not add back for further monitoring
if ((owner _veh) in (_serverIDs)) then
{
//diag_log format["_fnc_vehicleMonitor: vehicle %1 to be deleted at %2",_veh,(_veh getVariable ["blck_deleteAtTime",0])];
diag_log format["_fnc_vehicleMonitor: vehicle %1 to be deleted at %2",_veh,(_veh getVariable ["blck_deleteAtTime",0])];
if ((_veh getVariable ["blck_deleteAtTime",0]) > 0) then
{
if (diag_tickTime > ( _veh getVariable ["blck_deleteAtTime",0])) then
@ -34,10 +33,11 @@ for "_i" from 1 to (count blck_monitoredVehicles) do
blck_monitoredVehicles pushBack _veh;
};
} else {
[_veh] call blck_fnc_checkForEmptyVehicle;
blck_monitoredVehicles pushBack _veh;
};
//} else {
// diag_log format["_fnc_vehicleMonitor: owner of vehicle %1 is a player, discontinuing further monitoring",_veh]
} else {
diag_log format["_fnc_vehicleMonitor: owner of vehicle %1 is a player, discontinuing further monitoring",_veh]
};
};
};

View File

@ -149,6 +149,7 @@ private _functions = [
["blck_EH_AIVehicle_HandleHit","\q\addons\custom_server\Compiles\Vehicles\GMS_EH_AIVehicle_Hit.sqf"],
["blck_fnc_HandleAIVehicleHit","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_HandleAIVehicleHit.sqf"],
["blck_EH_VehicleKilled","\q\addons\custom_server\Compiles\Vehicles\GMS_EH_VehicleKilled.sqf"],
["blck_EH_changeLocality","\q\addons\custom_server\Compiles\Vehicles\GMS_EH_changeLocality.sqf"],
["blck_fnc_processAIVehicleKill","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_processAIVehicleKill.sqf"],
["blck_fnc_selectPatrolVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_selectPatrolVehicle.sqf"],
["blck_fnc_releaseVehicleToPlayers","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_releaseVehicleToPlayers.sqf"],

View File

@ -1,17 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_sm_addAircraft: _this = %5",_this];
params["_aircraftPatrol"];
//diag_log format["_sm_addAircraft: _aircraftPatrol = %1",_aircraftPatrol];
blck_sm_Aircraft pushBack [_aircraftPatrol,grpNull,0];
//diag_log format["_sm_addAircraft: updated blck_sm_Aircraft = %1",blck_sm_Aircraft];
true

View File

@ -1,16 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_emplacedWeapon"];
blck_sm_Emplaced pushBack [_emplacedWeapon,grpNull,0];
diag_log format["_sm_AddEmplaced::-> _emplacedWeapon = %1, blck_sm_Emplaced = %2",_emplacedWeapon,blck_sm_Emplaced];
true

View File

@ -1,16 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_group"];
blck_sm_Groups pushBack [_group,grpNull,0];
diag_log format["_sm_AddGroup:: blck_sm_Groups = %1",blck_sm_Groups];
true

View File

@ -1,22 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_array","_patrolInformation",["_timesToRespawn",-1]];
waitUntil {blck_sm_monitoring isEqualTo 0};
_array pushBack [
_patrolInformation,
grpNull,
0, // groupSpawned
0, // times Spawned
0, // Respawn At
_timesToRespawn // Max Times to Respawn
];
_array

View File

@ -1,16 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_vehicle"];
blck_sm_Vehicles pushBack [_vehicle,grpNull,0];
//diag_log format["_fnc_sm_AddVehicle: _vehicle = %1",_vehicle];
true

View File

@ -1,80 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log "[blckeagls] GMS_fnc_sm_init_functions.sqf <Defining Variables and Compiling Functions>";
//blck_sm_Groups = [];
blck_sm_Infantry = [];
blck_sm_Vehicles = [];
blck_sm_Aircraft = [];
blck_sm_Emplaced = [];
blck_sm_scubaGroups = [];
blck_sm_surfaceShips = [];
blck_sm_submarines = [];
blck_sm_lootContainers = [];
blck_sm_garrisonBuildings_ASL = [];
blcl_sm_garrisonBuilding_relPos = [];
blck_fnc_sm_AddGroupToArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddGroupToArray.sqf";
/*
blck_fnc_sm_AddGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddGroup.sqf";
blck_fnc_sm_AddVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddVehicle.sqf";
blck_fnc_sm_AddAircraft = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddAircraft.sqf";
blck_fnc_sm_AddEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddEmplaced.sqf";
*/
private _functions = [
//["blck_fnc_sm_monitorStaticUnits","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf"],
["blck_fnc_sm_monitorInfantry","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorInfantry.sqf"],
["blck_fnc_sm_monitorScuba","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorScuba.sqf"],
["blck_fnc_sm_monitorVehicles","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorVehicles.sqf"],
["blck_fnc_sm_monitorAircraft","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorAircraft.sqf"],
["blck_fnc_sm_monitorShips","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorShips.sqf"],
["blck_fnc_sm_monitorSubs","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorSubs.sqf"],
["blck_fnc_sm_monitorEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorEmplaced.sqf"],
["blck_fnc_sm_monitorGarrisonsASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisonsASL.sqf"],
["blck_fnc_sm_monitorGarrisons_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisons_relPos.sqf"],
["blck_fnc_sm_spawnVehiclePatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrol.sqf"],
["blck_fnc_sm_spawnAirPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrol.sqf"],
["blck_fnc_sm_spawnEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"],
// ["blck_fnc_sm_spawnInfantryPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf"],
["blck_fnc_sm_staticPatrolMonitor","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_staticPatrolMonitor.sqf"],
// ["blck_fnc_sm_checkForPlayerNearMission","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_checkForPlayerNearMission.sqf"],
["blck_fnc_sm_spawnAirPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrols.sqf"],
["blck_fnc_sm_spawnEmplaceds","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"],
["blck_fnc_sm_spawnInfantryPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnInfantryPatrols.sqf"],
["blck_fnc_sm_spawnLootContainers","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnLootContainers.sqf"],
["blck_fnc_sm_spawnObjects","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjects.sqf"],
["blck_fnc_sm_spawnVehiclePatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrols.sqf"],
["blck_fnc_sm_spawnBuildingGarrison_ASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrisonASL.sqf"],
["blck_fnc_sm_spawnBuildingGarrison_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf"],
["blck_fnc_sm_spawnObjectASLVectorDirUp","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf"],
["blck_fnc_spawnScubaGroup","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnScubaGroup.sqf"],
["blck_fnc_spawnSDVPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnSDVPatrol.sqf"],
["blck_fnc_spawnSurfacePatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnSurfacePatrol.sqf"],
//["blck_fnc_sm_AddScubaGroup","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddScubaGroup.sqf"],
//["blck_fnc_sm_AddSurfaceVehicle","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddSurfaceVehicle.sqf"],
["blck_fnc_sm_AddSDVVehicle","\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddSDVVehicle.sqf"]
];
{
_x params ["_name","_path"];
missionnamespace setvariable [_name,compileFinal preprocessFileLineNumbers _path];
} foreach _functions;
diag_log "[blckeagls] GMS_sm_init_functions.sqf <Variables Defined and Functions Loaded>";
/*
blck_fnc_spawnScubaGroup = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnScubaGroup.sqf";
blck_fnc_spawnSDVPatrol = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnSDVPatrol.sqf";
blck_fnc_spawnSurfacePatrol = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnSurfacePatrol.sqf";
blck_fnc_sm_AddScubaGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddScubaGroup.sqf";
blck_fnc_sm_AddSurfaceVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddSurfaceVehicle.sqf";
blck_fnc_sm_AddSDVVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddSDVVehicle.sqf";

View File

@ -1,88 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_mission"];
// Spawn landscape
// params["_objects"];
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_missionLandscape") then {_missionLandscape = []};
if (isNil "_garrisonedBuilding_ASLsystem") then {
//diag_log "_fnc_sm_initializeMission: _garrisonedBuilding_ASLsystem set to []";
_garrisonedBuilding_ASLsystem = [];
};
if (isNil "_garrisonedBuildings_BuildingPosnSystem") then {
//diag_log "_fnc_sm_initializeMission: _garrisonedBuildings_BuildingPosnSystem set to []";
_garrisonedBuildings_BuildingPosnSystem = [];
};
if (isNil "_airPatrols") then {_airPatrols = []};
if (isNil "_aiGroupParameters") then {_aiGroupParameters = []};
if (isNil "_missionEmplacedWeapons") then {_missionEmplacedWeapons = []};
if (isNil "_vehiclePatrolParameters") then {_vehiclePatrolParameters = []};
if (isNil "_missionLootVehicles") then {_missionLootVehicles = []};
_markerClass = format["static%1",floor(random(1000000))];
_blck_localMissionMarker = [_markerClass,_missionCenter,"","",_markerColor,_markerType];
if (blck_labelMapMarkers select 0) then
{
_blck_localMissionMarker set [2, _markerMissionName];
};
if !(blck_preciseMapMarkers) then
{
_blck_localMissionMarker set [1,[_missionCenter,75] call blck_fnc_randomPosition];
};
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
[_blck_localMissionMarker] call blck_fnc_spawnMarker;
[_missionLandscape] call blck_fnc_sm_spawnObjects;
{
//diag_log format["processing _garrisonedBuilding_ASL %1 which = %2",_forEachIndex,_x];
// ["Land_i_House_Big_02_V2_F",[23650.3,18331.9,3.19],[[0,1,0],[0,0,1]],[true,true],"Red",
_x params["_buildingClassName","_buildingPosnASL","_buildingVectorDirUp","_buildingDamSim","_aiDifficulty","_staticsASL","_unitsASL","_respawnTimer","_noRespawns"];
private _building = [_buildingClassName,_buildingPosnASL,_buildingVectorDirUp,_buildingDamSim] call blck_fnc_sm_spawnObjectASLVectorDirUp;
[blck_sm_garrisonBuildings_ASL,[_building,_aiDifficulty,_staticsASL,_unitsASL,_respawnTimer,_noRespawns]] call blck_fnc_sm_AddGroupToArray;
//diag_log format["_fnc_sm_initializeMission: blck_sm_garrisonBuildings_ASL updated to: %1",blck_sm_garrisonBuildings_ASL];
}forEach _garrisonedBuilding_ASLsystem;
// blcl_sm_garrisonBuilding_relPos
{
//diag_log format["processing _garrisonedBuilding_relPos %1 which = %2",_forEachIndex,_x];
_x params["_buildingClassName","_buildingPosnASL","_buildingVectorDirUp","_buildingDamSim","_aiDifficulty","_p","_noStatics","_typesStatics","_noUnits","_respawnTimer","_noRespawns"];
private _building = [_buildingClassName,_buildingPosnASL,_buildingVectorDirUp,_buildingDamSim] call blck_fnc_sm_spawnObjectASLVectorDirUp;
[blcl_sm_garrisonBuilding_relPos,[_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits,_respawnTimer,_noRespawns]] call blck_fnc_sm_AddGroupToArray;
//diag_log format["_fnc_sm_initializeMission: blcl_sm_garrisonBuilding_relPos updated to: %1",blcl_sm_garrisonBuilding_relPos];
}forEach _garrisonedBuildings_BuildingPosnSystem;
{
[blck_sm_Aircraft,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _airPatrols;
//uiSleep 1;
{
[blck_sm_Infantry,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _aiGroupParameters;
{
[blck_sm_Emplaced,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _missionEmplacedWeapons;
{
[blck_sm_Vehicles,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _vehiclePatrolParameters;
uiSleep 30;
// spawn loot chests
[_missionLootBoxes,_missionCenter] call blck_fnc_sm_spawnLootContainers;
[_missionLootVehicles,_missionCenter] call blck_fnc_sm_spawnLootContainers;
diag_log format["[blckeagls] Static Mission Spawner: Mission %1 spawned",_mission];

View File

@ -1,93 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//private["_mode","_sm_groups"];
//_sm_groups = +blck_sm_Aircraft;
//diag_log format["_fnc_monitorAircraft: time %2 | blck_sm_Aircraft %1",blck_sm_Aircraft,diag_tickTime];
for "_i" from 1 to (count blck_sm_Aircraft) do
{
if (_i == (count blck_sm_Aircraft)) exitWith {};
private _element = blck_sm_Aircraft deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorAircraft: _x %1",_element];
//diag_log format["_fnc_monitorAircraft: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorAircraft (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"];
_groupParameters params["_aircraftType","_pos","_difficulty","_patrolRadius","_respawnTime"];
//diag_log format["_fnc_monitorAircraft: _aircraftType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_aircraftType,_pos,_difficulty,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_return = [_pos,_difficulty,[_aircraftType]] call blck_fnc_spawnMissionHeli;
_group = group (driver (_return select 0));
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
};
blck_sm_Aircraft pushBack _element;
};
case 2: {
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_Aircraft pushBack _element;
//diag_log format["_fnc_monitorAircraft: update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorAircraft(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorAircraft: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorAircraft: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_Aircraft pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorAircraft: despanwing patrol for _element %1",_element];
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_Aircraft pushBack _element;
};
};
};

View File

@ -1,92 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorEmplaced: time %2 | blck_sm_Emplaced %1",blck_sm_Emplaced,diag_tickTime];
for "_i" from 0 to (count blck_sm_Emplaced) do
{
if (_i >= (count blck_sm_Emplaced)) exitWith {};
private _element = blck_sm_Emplaced deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorEmplaced: _element %1",_element];
//diag_log format["_fnc_monitorEmplaced: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorEmplaced (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"];
_groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime"];
//diag_log format["_fnc_monitorEmplaced: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
// params["_coords","_missionEmplacedWeapons","_useRelativePos","_noEmplacedWeapons","_aiDifficultyLevel",["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]]];
private _return = [_pos,[_groupParameters],false,1,_difficulty] call blck_fnc_spawnEmplacedWeaponArray;
_group = group( (_return select 1) select 0);
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
};
blck_sm_Emplaced pushBack _element;
};
case 2: {
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_Emplaced pushBack _element;
//diag_log format["_fnc_monitorEmplaced: update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorEmplaced(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorEmplaced: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorEmplaced: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_Emplaced pushBack _element;
} else {
if (diag_tickTime >= (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorEmplaced: despanwing patrol for _element %1",_element];
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_Emplaced pushBack _element;
};
};
};

View File

@ -1,97 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private["_mode","_sm_groups"];
//diag_log format["_fnc_sm_monitorGarrisonASL: blck_fnc_spawnGarrisonInsideBuilding_ATL = %1",blck_sm_garrisonBuildings_ASL];
if (blck_sm_garrisonBuildings_ASL isEqualTo []) exitWith {};
for "_i" from 0 to (count blck_sm_garrisonBuildings_ASL) do
{
if (_i >= (count blck_sm_garrisonBuildings_ASL)) exitWith {};
private _element = blck_sm_garrisonBuildings_ASL deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt"];
// ["_building","_aiDifficultyLevel","_staticsATL","_unitsATL"];
_groupParameters params['_building','_aiDifficulty','_staticsASL','_unitsASL','_respawnTime','_maxRespawns'];
//diag_log format["_fnc_sm_monitorGarrisonASL: _group = %1 | _timesSpawned = %2 | _respawnTime = %3 | _respawnAt = %4 | _groupSpawned = %5",_group,_timesSpawned,_respawnTime,_respawnAt,_groupSpawned];
private _pos = position _building;
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
// ["_building","_aiDifficultyLevel","_staticsATL","_unitsATL"]
//diag_log format
private _group = [_building,_aiDifficulty,_staticsASL,_unitsASL] call blck_fnc_sm_spawnBuildingGarrison_ASL;
_timesSpawned = _timesSpawned + 1;
_groupSpawned = 1;
_respawnAt = 0;
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned];
_element set[respawnAt,_respawnAt];
//blck_sm_garrisonBuildings_ASL set[blck_sm_garrisonBuildings_ASL find _x,_element];
};
blck_sm_garrisonBuildings_ASL pushBack _element;
};
case 2: {
_groupSpawned = 0;
_respawnAt = diag_tickTime + _respawnTime;
_element set[respawnAt,_respawnAt];
_element set[groupSpawned,_groupSpawned];
//blck_sm_garrisonBuildings_ASL set[blck_sm_garrisonBuildings_ASL find _x,_element];
blck_sm_garrisonBuildings_ASL pushBack _element;
};
default {};
};
} else {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
blck_sm_garrisonBuildings_ASL pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
//blck_sm_garrisonBuildings_ASL set[(blck_sm_garrisonBuildings_ASL find _x), _element];
};
blck_sm_garrisonBuildings_ASL pushBack _element;
};
};
};

View File

@ -1,89 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private["_mode","_sm_groups","_pos","_element"];
if (blck_fnc_sm_spawnBuildingGarrison_relPos isEqualTo []) exitWith {};
_sm_groups = +blcl_sm_garrisonBuilding_relPos;
{
_x params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt"];
// [_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits,_respawn]
_groupParameters params['_building','_aiDifficulty','_noStatics','_typesStatics','_noUnits','_respawnTime','_maxRespawns'];
_element = +_x;//
_pos = position _building;
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {blcl_sm_garrisonBuilding_relPos deleteAt (blcl_sm_garrisonBuilding_relPos find _x)};
case 1: {
if (true /*[_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange*/) then
{
// ["_building","_skillLevel","_noStatics","_typesStatics","_noUnits"];
private _group = [_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits] call blck_fnc_sm_spawnBuildingGarrison_relPos;
_timesSpawned = _timesSpawned + 1;
_groupSpawned = 1;
_respawnAt = 0;
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned];
_element set[respawnAt,_respawnAt];
blcl_sm_garrisonBuilding_relPos set[blcl_sm_garrisonBuilding_relPos find _x,_element];
};
};
case 2: {
_groupSpawned = 0;
_respawnAt = diag_tickTime + _respawnTime;
_element set[respawnAt,_respawnAt];
_element set[groupSpawned,_groupSpawned];
blcl_sm_garrisonBuilding_relPos set[blcl_sm_garrisonBuilding_relPos find _x,_element];
};
default {};
};
} else {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
blcl_sm_garrisonBuilding_relPos set[(blcl_sm_garrisonBuilding_relPos find _x), _element];
};
};
};
}forEach _sm_groups;

View File

@ -1,111 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorInfantry(12): time %2 | blck_sm_Infantry %1",blck_sm_Infantry,diag_tickTime];
if (blck_sm_Infantry isEqualTo []) exitWith {};
private["_element"];
for "_i" from 0 to (count blck_sm_Infantry) do
{
if (_i >= count(blck_sm_Infantry)) exitWith {};
_element = blck_sm_Infantry deleteAt 0;
//diag_log format["(18) element = %1",_element];
//diag_log format["_fnc_monitorInfantry(20): _element %1 | _i = %2",_element,_i];
if !(_element isEqualTo []) then
{
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["_fnc_monitorInfantry(21): _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorInfantry (22): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
//diag_log format["_fnc_monitorInfantry(28): _pos = %1 | _difficulty = 2 | _units = %3 | _patrolRadius = %4 | _respawnTime = %5",_pos,_difficulty,_units,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {
//diag_log format["_fnc_sm_monitorInfantry(46): no further respawns requested for %1",_element];
};
case 1: { // Spawn Group Now
//diag_log format["_fnc_sm_monitorInfantry(49): spawning infantry group with element = %1",_element];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
private _numAI = [_units] call blck_fnc_getNumberFromRange;
//params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ];
_group = [
_pos,_pos,_numAI,_numAI,_difficulty,_patrolRadius-1,_patrolRadius,true,
[_difficulty] call blck_fnc_selectAIUniforms,
[_difficulty] call blck_fnc_selectAIHeadgear,
[_difficulty] call blck_fnc_selectAIVests,
[_difficulty] call blck_fnc_selectAIBackpacks,
[_difficulty] call blck_fnc_selectAILoadout,
[_difficulty] call blck_fnc_selectAISidearms
] call blck_fnc_spawnGroup;
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
//diag_log format["_fnc_monitorInfantry (67): _element %1",_element];
//diag_log format["_fnc_monitorInfantry (69): blck_sm_Infantry %1",blck_sm_Infantry];
};
blck_sm_Infantry pushBack _element;
};
case 2: { // Spawn Group at a Later Time.
blck_liveMissionAI pushBack[units _group,diag_tickTime]; // schedule units of group for deletion now.
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_Infantry pushBack _element;
//diag_log format["_fnc_monitorInfantry(77): update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorInfantry(81) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorInfantry(83): diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorInfantry(87): playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_Infantry pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorInfantry(92): despanwing patrol for _element %1",_element];
_groupParameters set [2, {alive _x} count (units _group)];
{[_x] call blck_fnc_deleteAI} forEach (units _group);
deleteGroup _group;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
//diag_log format["_fnc_monitorInfantry (101): _element %1",_element];
//diag_log format["_fnc_monitorInfantry (102): blck_sm_Infantry %1",blck_sm_Infantry];
};
blck_sm_Infantry pushBack _element;
};
};
};
//blck_sm_Infantry pushBack _element;
};

View File

@ -1,92 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorScubaGroups: time %2 | blck_sm_scubaGroups %1",blck_sm_scubaGroups,diag_tickTime];
if (blck_sm_scubaGroups isEqualTo []) exitWith {};
for "_i" from 0 to (count blck_sm_scubaGroups) do
{
if (_i >= (count blck_sm_scubaGroups)) exitWith {};
private _element = blck_sm_scubaGroups deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorScubaGroups: _element %1 | _i = %2",_element,_i];
//diag_log format["_fnc_monitorScubaGroups: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorScubaGroups (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["_fnc_monitorScubaGroups: _pos = %1 | _difficulty = 2 | _units = %3 | _patrolRadius = %4 | _respawnTime = %5",_pos,_difficulty,_units,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {
//diag_log format["_fnc_sm_monitorInfantry(46): no further respawns requested for %1",_element];
};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
private _numAI = [_units] call blck_fnc_getNumberFromRange;
//params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ];
_group = [_pos,_difficulty,_units,_patrolRadius] call blck_fnc_spawnScubaGroup;
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
};
blck_sm_scubaGroups pushBack _element;
};
case 2: {
blck_liveMissionAI pushBack[units _group,diag_tickTime]; // schedule units of group for deletion now.
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_scubaGroups pushBack _element;
//diag_log format["_fnc_monitorScubaGroups: update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorScubaGroups(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorScubaGroups: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
blck_sm_scubaGroups pushBack _element;
//diag_log format["_fnc_monitorScubaGroups: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorScubaGroups: despanwing patrol for _element %1",_element];
_groupParameters set [2, {alive _x} count (units _group)];
{[_x] call blck_fnc_deleteAI} forEach (units _group);
deleteGroup _group;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_scubaGroups pushBack _element;
};
};
};

View File

@ -1,94 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorShips: time %2 | blck_sm_surfaceShips %1",blck_sm_surfaceShips,diag_tickTime];
for "_i" from 0 to (count blck_sm_surfaceShips) do
{
if (_i >= (count blck_sm_surfaceShips)) exitWith {};
private _element = blck_sm_surfaceShips deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorShips: _element %1",_element];
//diag_log format["_fnc_monitorShips: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorShips (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"];
_groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["_fnc_monitorVehicles: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_return = [_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols;
//diag_log format["_fnc_monitorShips: _return = %1",_return];
_group = group ((_return select 1) select 0);
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
//blck_sm_surfaceShips pushBack _element;
};
blck_sm_surfaceShips pushBack _element;
};
case 2: {
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_surfaceShips pushBack _element;
//diag_log format["_fnc_monitorShips: update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorShips(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorShips: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorShips: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_surfaceShips pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorShips: despanwing patrol for _element %1",_element];
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_surfaceShips pushBack _element;
};
};
};

View File

@ -1,236 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private _triggerRange = 2000;
_fnc_updateGroupSpawnTimerFields = {
//diag_log format["_fnc_updateGroupSpawnTimerFields::-> _this = %1",_this];
params["_array","_element",["_group",grpNull],["_spawnTime",0]];
private["_index"];
_index = _array find _element;
_element set[1,_group];
_element set[2,_spawnTime];
_array set[_index,_element];
};
private["_group","_groupParameters","_numAI","_return"];
_sm_groups = +blck_sm_Groups;
{
// [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/, _respawnTime, _group, _spawnAt]
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["<_sm_monitorStaticUnits::Group spawning routine:: _units = %1 | _x = %2 |_forEachIndex = %3",_units,_x,_forEachIndex];
private _groupSpawned = false;
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ((isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one.
{
//diag_log format["[blckeagls static group spawner] evaluating _x = %1 ",_x];
_numAI = [_units] call blck_fnc_getNumberFromRange;
//diag_log format["[blckeagls static group spawner] _units = %1 and _numAI = %2",_units,_numAI];
// // params["_pos", "_center", _numai1, _numai2, _skillLevel, _minDist, _maxDist, _configureWaypoints, _uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms, _scuba ];
_group = [_pos,_pos,_numAI,_numAI,_difficulty,_patrolRadius-2,_patrolRadius,true] call blck_fnc_spawnGroup;
//diag_log format["[blckeagls static group spawner] _group %1",_group];
[blck_sm_Groups,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn Group step :: blck_sm_Groups updated to %1",blck_sm_Groups];
};
if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0)) then // a group was spawned and all units are dead and we should rspawn them after a certain interval
{
[blck_sm_Groups,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Groups updated to %1",blck_sm_Groups];
};
if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead but we should not do a respawn
{
blck_sm_Groups deleteAt (blck_sm_Groups find _x);
};
};
}forEach _sm_groups;
_sm_scubaGroups = +blck_sm_scubaGroups;
{
// [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/, _respawnTime, _group, _spawnAt]
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"];
//diag_log format["<_sm_monitorScubaUnits:: _group = %1 | _x = %2 |_forEachIndex = %3",_group,_x,_forEachIndex];
private _groupSpawned = false;
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ((isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one.
{
//diag_log format["[blckeagls static scubaGroup spawner] evaluating _x = %1 ",_x];
_numAI = [_units] call blck_fnc_getNumberFromRange;
//diag_log format["[blckeagls static scubaGroup spawning routine] _units = %1 and _numAI = %2",_units,_numAI];
//params["_pos", "_numUnits", ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_UMS_uniforms], ["_headGear",blck_UMS_headgear],["_configureWaypoints",true],["_weapons",blck_UMS_weapons],["_vests",blck_UMS_vests]];
_group = [_pos,_difficulty,_units,_patrolRadius] call blck_fnc_spawnScubaGroup;
//diag_log format["[blckeagls static scubaGroup spawner] _group %1",_group];
[blck_sm_scubaGroups,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn Group step :: blck_sm_Groups updated to %1",blck_sm_Groups];
};
if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0)) then // a group was spawned and all units are dead and we should rspawn them after a certain interval
{
[blck_sm_scubaGroups,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set scubaGroup respawn time step :: blck_sm_Groups updated to %1",blck_sm_scubaGroups];
};
if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead but we should not do a respawn
{
blck_sm_scubaGroups deleteAt (blck_sm_scubaGroups find _x);
};
};
}forEach _sm_scubaGroups;
_sm_Emplaced = +blck_sm_Emplaced;
{
// ["B_G_Mortar_01_F",[22944.3,16820.5,3.14243],"green",0,0,_group,_spawnAt]
//diag_log format["_sm_monitorEmplacedUnits::-> _x = %1",_x];
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"];
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one.
{
//diag_log format["[blckeagls static Emplaced spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty];
// params["_coords","_missionEmplacedWeapons","_useRelativePos","_noEmplacedWeapons","_aiDifficultyLevel",["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols]];
_group = [_pos,[_groupParameters],false,1,_difficulty] call blck_fnc_spawnEmplacedWeaponArray;
[blck_sm_Emplaced,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Emplaced updated to %1",blck_sm_Emplaced];
};
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead
{
[blck_sm_Emplaced,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Emplaced updated to %1",blck_sm_Emplaced];
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0)) then // a group was spawned and all units are dead
{
blck_sm_Emplaced deleteAt (blck_sm_Emplaced find _x);
};
}forEach _sm_Emplaced;
_sm_Vehicles = +blck_sm_Vehicles;
{
// ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt],
//diag_log format["_sm_monitorVehicles::-> _x = %1",_x];
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime"];
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one.
{
//params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]];
_return = [_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols;
// _return = [_vehicles, _missionAI, _abort];
_group = group (_return select 1 select 0);
[blck_sm_Vehicles,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead
{
[blck_sm_Vehicles,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead
{
blck_sm_Vehicles deleteAt (blck_sm_Vehicles find _x);
};
}forEach _sm_Vehicles;
_sm_surfaceVehicles = +blck_sm_surfaceShips;
{
// ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt],
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"];
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one.
{
//diag_log format["[blckeagls static vehiclePatrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty];
[_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols;
_return params ["_vehicles", "_missionAI", "_abort"];
_group = group (_missionAI select 0);
[blck_sm_surfaceShips,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead
{
[blck_sm_surfaceShips,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead
{
blck_sm_surfaceShips deleteAt (blck_sm_surfaceShips find _x);
};
}forEach _sm_surfaceVehicles;
_sm_SDVVehicles = +blck_sm_submarines;
{
// ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt],
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"];
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one.
{
//diag_log format["[blckeagls static sub patrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty];
//params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]];
_return = [_pos,1,_difficulty,[_groupParameters],false,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,blck_backpacks,blck_UMS_weapons,blck_Pistols,true] call blck_fnc_spawnMissionVehiclePatrols;
_return params ["_vehicles", "_missionAI", "_abort"];
_group = group (_missionAI select 0);
[blck_sm_submarines,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead
{
[blck_sm_submarines,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles];
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead
{
blck_sm_submarines deleteAt (blck_sm_submarines find _x);
};
}forEach _sm_SDVVehicles;
_sm_Aircraft = +blck_sm_Aircraft;
{
// ["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red",1000,0],
_x params["_groupParameters","_group","_spawnAt"];
_groupParameters params["_aircraftType","_pos","_difficulty","_patrolRadius","_respawnTime"];
if ([_pos,_triggerRange] call blck_fnc_playerInRange) then
{
if ( (isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one.
{
_weapon = [toLower _difficulty] call blck_fnc_selectAILoadout;
//params["_coords","_skillAI","_helis",["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_Launcher","none"],["_weaponList",[]],["_sideArms",[]]]
//diag_log format["[blckeagls static aircraftePatrol spawner] _weapon = %1 and _difficulty = %2",_weapon,_difficulty];
_return = [_pos,_difficulty,[_aircraftType]] call blck_fnc_spawnMissionHeli; // Allow the spawner to fit the default AI Loadouts for blckeagls; revisit at a later time when custom uniforms are set up for these AI.
//diag_log format["[blckeagls] static aircraftePatrol spawner -> _return = %1",_return];
_return params ["_patrolHeli","_ai","_abort"];
_group = group (_ai select 0);
[blck_sm_Aircraft,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Aircraft updated to %1",blck_sm_Aircraft];
};
};
if ( (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead
{
[blck_sm_Aircraft,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields;
//diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Aircraft updated to %1",blck_sm_Aircraft];
};
if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead
{
blck_sm_Aircraft deleteAt (blck_sm_Aircraft find _x);
};
}forEach _sm_Aircraft;

View File

@ -1,94 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorSubs: time %2 | blck_sm_submarines %1",blck_sm_submarines,diag_tickTime];
for "_i" from 0 to (count blck_sm_submarines) do
{
if (_i >= (count blck_sm_submarines)) exitWith {};
private _element = blck_sm_submarines deleteAt 0;
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorSubs: _element %1",_element];
//diag_log format["_fnc_monitorSubs: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorSubs (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
//_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"];
_groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["_fnc_monitorVehicles: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_return = [_pos,1,_difficulty,[_groupParameters],false,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,blck_backpacks,blck_UMS_weapons,blck_Pistols,true] call blck_fnc_spawnMissionVehiclePatrols;
//diag_log format["_fnc_monitorSubs: _return = %1",_return];
_group = group ((_return select 1) select 0);
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
//blck_sm_submarines pushBack _element;
};
blck_sm_submarines pushBack _element;
};
case 2: {
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
bblck_sm_submarines pushBack _element;
//diag_log format["_fnc_monitorSubs: update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorSubs(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorSubs: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorSubs: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_submarines pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorSubs: despanwing patrol for _element %1",_element];
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_submarines pushBack _element;
};
};
};

View File

@ -1,96 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//diag_log format["_fnc_monitorVehicles: time %2 | blck_sm_Vehicles %1",blck_sm_Vehicles,diag_tickTime];
for "_i" from 0 to (count blck_sm_Vehicles) do
{
if (_i >= (count blck_sm_Vehicles)) exitWith {};
private _element = blck_sm_Vehicles deleteAt 0;
//diag_log format["_fnc_monitorVehicles(18): _element %1",_element];
_element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"];
//diag_log format["_fnc_monitorVehicles: _groupParameters = %1",_groupParameters];
//diag_log format["_fnc_monitorVehicles (21): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt];
_groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"];
//diag_log format["_fnc_monitorVehicles(23): _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime];
if (!(isNull _group) && {alive _x} count (units _group) == 0) then
{
deleteGroup _group;
_group = grpNull;
};
if (isNull _group) then
{
_mode = -1;
if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn
if (_timesSpawned > 0) then
{
if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation
if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0};
if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time
if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1};
};
switch (_mode) do
{
case 0: {};
case 1: {
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
// params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_isScubaGroup",false]];
_return = [_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols;
//diag_log format["_fnc_monitorVehicles(50): _return = %1",_return];
_group = group ((_return select 1) select 0);
// _element [[""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90],O Alpha 1-1,1,1,0,-1]"
// _groupParameters = [""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90]"
_element set[patrolGroup,_group];
_element set[groupSpawned,1];
_element set[timesSpawned,_timesSpawned + 1];
_element set[respawnAt,0];
};
blck_sm_Vehicles pushBack _element;
};
case 2: {
_element set[respawnAt,diag_tickTime + _respawnTime];
_element set[groupSpawned,0];
blck_sm_Vehicles pushBack _element;
//diag_log format["_fnc_monitorVehicles(63): update respawn time to %1",_respawnAt];
};
default {};
};
//diag_log format["_fnc_monitorVehicles(67) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned];
} else {
//diag_log format["_fnc_monitorVehicles(69): diag_tickTime = %1 | playerNearAt = %2 | _playerInRange = %3",diag_tickTime,_group getVariable["playerNearAt",-1],[_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange];
if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then
{
_group setVariable["playerNearAt",diag_tickTime];
//diag_log format["_fnc_monitorVehicles(73): playerNearAt updated to %1",_group getVariable["playerNearAt",-1]];
blck_sm_Vehicles pushBack _element;
} else {
if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then
{
//diag_log format["_fnc_monitorVehicles(78): despanwing patrol for _element %1",_element];
// _element [[""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90],O Alpha 1-1,1,1,0,-1]"
// _groupParameters = [""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90]"
//_groupParameters set [2, {alive _x} count (units _group)];
private _veh = vehicle (leader _group);
{deleteVehicle _x} forEach (units _group);
deleteGroup _group;
[_veh] call blck_fnc_destroyVehicleAndCrew;
_element set[groupParameters,_groupParameters];
_element set[patrolGroup ,grpNull];
_element set[timesSpawned,(_timesSpawned - 1)];
_element set[groupSpawned,0];
};
blck_sm_Vehicles pushBack _element;
};
};
};

View File

@ -1,31 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
diag_log format["_fnc_sm_spawnAirPatrols: _this = %1",_this];
params["_airPatrols"];
private["_aircraft","_pos","_difficulty","_uniforms","_headGear"];
_aircraft = _x select 0;
_pos = _x select 1;
_difficulty = _x select 2;
_uniforms = blck_SkinList;
_headGear = blck_headgearList;
switch (_difficulty) do
{
case "blue": {_weapons = blck_WeaponList_Blue;};
case "red": {_weapons = blck_WeaponList_Red};
case "green": {_weapons = blck_WeaponList_Green};
case "orange": {_weapons = blck_WeaponList_Orange};
};
_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnMissionHeli;
_group = group (_return select 1 select 0);
_group

View File

@ -1,50 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
/*
_coords = _this select 0;
_skillAI = _this select 1;
_weapons = _this select 2;
_uniforms = _this select 3;
_headGear = _this select 4;
_helis = _this select 5;
*/
params["_airPatrols","_noAirPatrols","_heliTypes","_center","_difficulty","_uniforms","_headGear","_weapons"];
diag_log format["_sm_spawnAirPatrols:: _this = %1",_this];
diag_log format["_sm_spawnAirPatrols:: _airPatrols = %1",_airPatrols];
if (_airPatrols isEqualTo []) then
{
for "_i" from 1 to _noAirPatrols do
{
/*
_coords = _this select 0;
_skillAI = _this select 1;
_weapons = _this select 2;
_uniforms = _this select 3;
_headGear = _this select 4;
_helis = _this select 5;
*/
[_center,_difficulty,_weapons,_uniforms,_headGear,_heliTypes,0] call blck_fnc_spawnMissionHeli;
};
} else {
{
/*
/*[aircraft classname, position, difficulty(blue, red etc)]*/
_aircraft = _x select 0;
_pos = _x select 1;
_difficulty = _x select 2;
[_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnMissionHeli;
}forEach _airPatrols;
};

View File

@ -1,8 +0,0 @@
params["_building","_aiDifficultyLevel","_statics","_units"];
diag_log format["_fnc_sm_spawnBuildingGarrisonASL: handling _building = %1 | at location = %2",_building,position _building];
private _group = [] call blck_fnc_create_AI_Group;
//params["_building","_group","_statics","_men","_aiDifficultyLevel","_uniforms","_headGear","_vests","_backpacks",["_launcher","none"],"_weaponList","_sideArms"];
[_building,_group,_statics,_units,_aiDifficultyLevel] call blck_fnc_spawnGarrisonInsideBuilding_ATL;
_group

View File

@ -1,8 +0,0 @@
params["_building","_skillLevel","_noStatics","_typesStatics","_noUnits"];
diag_log format["_fnc_sm_spawnBuildingGarrison_relPos: handling _building = %1 | at location = %2",_building,position _building];
private _group = [] call blck_fnc_create_AI_Group;
// ["_building","_group","_noStatics","_typesStatics","_noUnits",["_aiDifficultyLevel","Red"],
[_building,_group,_noStatics,[],_noUnits,_skillLevel] call blck_fnc_spawnGarrisonInsideBuilding_relPos;
_group

View File

@ -1,58 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
private["_return","_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"];
_emplacedWeps = [];
_emplacedAI = [];
_units = [];
_abort = false;
_pos = [];
//diag_log format["_sm_spawnEmplaced <Line 26>:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons];
// Define _missionEmplacedWeapons if not already configured.
if (_missionEmplacedWeapons isEqualTo []) then
{
_missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
{
_static = selectRandom blck_staticWeapons;
//diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x];
_missionEmplacedWeapons pushback [_static,_coords vectorAdd _x,_aiDifficultyLevel];
//diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons];
} forEach _missionEmplacedWeaponPositions;
};
//diag_log format["_sm_spawnEmplaced<Line 38>:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons];
{
_wepnClassName = _x select 0;
_pos = _x select 1;
_difficulty = _x select 2;
// params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
_empGroup = [_pos,1,1,_difficulty,_pos,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup;
_empGroup setcombatmode "RED";
_empGroup setBehaviour "COMBAT";
[_pos,0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints;
//if (isNull _empGroup) exitWith {_abort = _true};
_wep = [_wepnClassName,[0,0,0],false] call blck_fnc_spawnVehicle;
//_empGroup setVariable["groupVehicle",_wep];
_wep setVariable["vehicleGroup",_empGroup];
_wep setVariable["GRG_vehType","emplaced"];
_wep setPosATL _pos;
[_wep,false] call blck_fnc_configureMissionVehicle;
_units = units _empGroup;
_gunner = _units select 0;
_gunner moveingunner _wep;
} forEach _missionEmplacedWeapons;
blck_monitoredVehicles append _emplacedWeps;
true

View File

@ -1,58 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
private["_return","_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"];
_emplacedWeps = [];
_emplacedAI = [];
_units = [];
_abort = false;
_pos = [];
//diag_log format["_sm_spawnEmplaced <Line 26>:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons];
// Define _missionEmplacedWeapons if not already configured.
if (_missionEmplacedWeapons isEqualTo []) then
{
_missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
{
_static = selectRandom blck_staticWeapons;
//diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x];
_missionEmplacedWeapons pushback [_static,_coords vectorAdd _x,_aiDifficultyLevel];
//diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons];
} forEach _missionEmplacedWeaponPositions;
};
//diag_log format["_sm_spawnEmplaced<Line 38>:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons];
{
_wepnClassName = _x select 0;
_pos = _x select 1;
_difficulty = _x select 2;
/// params["_pos", "_center", _numai1, _numai2, _skillLevel, _minDist, _maxDist, _configureWaypoints, _uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms, _scuba ];
__empGroup = [_pos,_pos,1,1,_difficulty,1,2,false,_uniforms,_headGear] call blck_fnc_spawnGroup;
_empGroup setcombatmode "RED";
_empGroup setBehaviour "COMBAT";
[_pos,0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints;
//if (isNull _empGroup) exitWith {_abort = _true};
_wep = [_wepnClassName,[0,0,0],false] call blck_fnc_spawnVehicle;
//_empGroup setVariable["groupVehicle",_wep];
_wep setVariable["vehicleGroup",_empGroup];
_wep setVariable["GRG_vehType","emplaced"];
_wep setPosATL _pos;
[_wep,false] call blck_fnc_configureMissionVehicle;
_units = units _empGroup;
_gunner = _units select 0;
_gunner moveingunner _wep;
} forEach _missionEmplacedWeapons;
blck_monitoredVehicles append _emplacedWeps;
true

View File

@ -1,37 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
// params["_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]];
params["_patrols","_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_weapons",blck_WeaponList_Orange],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]];
//diag_log format["_sm_spawnInfantryPatrols:: _this = %1",_this];
//diag_log format["_sm_spawnInfantryPatrols:: patrols = %1",_patrols];
if (_patrols isEqualTo []) then
{
// Use the random spawn logic from the regular dyanmic mission system.
//params[_coords,"_maxNoAI,_missionGroups,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weapons,sideArms,_isScubaGroup];
[_coords,_minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI
} else {
{
//diag_log format["_sm_spawnInfantryPatrols.sqf:: _x = %1",_x];
// Use the pre-defined spawn positions and other parameters for each group.
// [[22819.4,16929.5,5.33892],"red",4, 75]
private["_pos","_difficulty","_noAI","_patrolRadius"];
_pos = _x select 0; // Position at which to spawn the group
_difficulty = _x select 1; // AI difficulty setting (blue, green etc)
_noAI = _x select 2; // Number of AI to spawn with the group
_patrolRadius = _x select 3; // Radius within which AI should patrol
// params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ];
[_pos,_pos,_noAI,_noAI,_difficulty,_patrolRadius,_patrolRadius,true,_uniforms,_headGear] call blck_fnc_spawnGroup;
}forEach _patrols;
};

View File

@ -1,40 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_objects","_coords"];
private["_object"];
if !(_objects isEqualTo []) exitWith
{ // Spawn loot crates where specified in _objects using the information for loot parameters provided for each location.
{
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format["_fnc_sm_spawnLootContainers (21):-> _x = %1",_x];
};
#endif
//diag_log format["_fnc_sm_spawnLootContainers (21):-> _x = %1",_x];
// [selectRandom blck_crateTypes,[22904.8,16742.5,6.30195],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts]
_x params["_crateClassName","_cratePosASL","_vectorDirUp","_allowDamageSim","_crateLoot","_lootCounts"];
_crate = [_cratePosASL, _crateClassName] call blck_fnc_spawnCrate;
[_crate, _crateLoot,_lootCounts] call blck_fnc_fillBoxes;
} forEach _objects;
};
// In the case where no loot crate parameters are defined in _objects just spawn 1 at the center of the mission.
if (_objects isEqualTo []) then
{
_crateType = selectRandom blck_crateTypes;
_crate = [_coords,_crateType] call blck_fnc_spawnCrate;
[_crate,blck_BoxLoot_Red,blck_lootCountsGreen] call blck_fnc_fillBoxes;
};

View File

@ -1,51 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_mission"];
// Spawn landscape
// params["_objects"];
[_missionLandscape] call blck_fnc_sm_spawnObjects;
uiSleep 10; // Let the objects 'settle' before placing anything on or around them.
// Spawn Air Patrols
// params["_airPatrols","_noAirPatrols","_heliTypes","_center","_difficulty","_uniforms","_headGear"];
[_airPatrols,_noAirPatrols,_aircraftTypes,_missionCenter,_difficulty,_uniforms,_headgear,_weapons] call blck_fnc_sm_spawnAirPatrols;
//uiSleep 1;
// Spawn Vehicle Patrols
// params["_coords","_noVehiclePatrols","_vehiclePatrolSpawns","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]];
[_missionCenter,_noVehiclePatrols,_vehiclePatrolParameters,_difficulty,_uniforms,_headGear] call blck_fnc_sm_spawnVehiclePatrols;
//uiSleep 1;
// spawn infantry
// params["_patrols","_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_weapons",blck_WeaponList_Orange],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]];
[_aiGroupParameters, _missionCenter,_minNoAI,_maxNoAI,_difficulty,_weapons,_uniforms,_headGear] call blck_fnc_sm_spawnInfantryPatrols;
//uiSleep 1;
// spawn loot vehicles
// params["_objects","_coords","_loot","_lootCounts"];
[_missionLootVehicles,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers;
// Spawn static weapons
// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
[_missionEmplacedWeapons,_noEmplacedWeapons,_difficulty,_missionCenter,_uniforms,_headGear] call blck_fnc_sm_spawnEmplaceds;
// spawn loot chests
[_missionLootBoxes,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers;
_blck_localMissionMarker = ["",_missionCenter,"","",_markerColor,_markerType];
[_blck_localMissionMarker] call blck_fnc_spawnMarker;
diag_log format["[blckeagls] Static Mission Spawner: Mission %1 spawned",_mission];

View File

@ -1,21 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_buildingClassName","_posASL","_vectorDirUp","_enableDamSim"];
_object = createVehicle [_buildingClassName, [0,0,0], [], 0, "CAN_COLLIDE"];
_object setPosASL _posASL;
_object setVectorDirAndUp _vectorDirUp;
_object enableSimulationGlobal (_enableDamSim select 0);
_object allowDamage (_enableDamSim select 1);
_object

View File

@ -1,19 +0,0 @@
/*
by Ghostrider [GRG]
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_objects"];
private["_objects","_object"];
{
_object = [_x select 0, _x select 1, _x select 2, _x select 3] call blck_fnc_sm_spawnObjectASLVectorDirUp;
} forEach _objects;

View File

@ -1,33 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_airPatrols"];
private["_aircraft","_pos","_difficulty","_uniforms","_headGear"];
_aircraft = _x select 0;
_pos = _x select 1;
_difficulty = _x select 2;
_uniforms = blck_SkinList;
_headGear = blck_headgearList;
switch (_difficulty) do
{
case "blue": {_weapons = blck_WeaponList_Blue;};
case "red": {_weapons = blck_WeaponList_Red};
case "green": {_weapons = blck_WeaponList_Green};
case "orange": {_weapons = blck_WeaponList_Orange};
};
_vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup;
//params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]];
_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnVehiclePatrol;
_group = group (_return select 1 select 0);
_group

View File

@ -1,51 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_coords","_noVehiclePatrols","_vehiclePatrolSpawns","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]];
//diag_log format["_sm_spawnVehiclePatrols:: _vehiclePatrolSpawns = %1",_vehiclePatrolSpawns];
private["_vehGroup","_patrolVehicle","_missionAI","_missiongroups","_vehicles","_return","_vehiclePatrolSpawns","_randomVehicle","_return","_abort"];
//if (count _weapons isEqualTo 0) then {_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout};
if (_vehiclePatrolSpawns isEqualTo []) then
{
private["_spawnPoints","_vehType"];
_spawnPoints = [_coords,_noVehiclePatrols,75,100] call blck_fnc_findPositionsAlongARadius;
{
// ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red", 600],
_vehType = selectRandom blck_AIPatrolVehicles;
_vehiclePatrolSpawns pushBack [_vehType, _x, _aiDifficultyLevel, 150];
} forEach _spawnPoints;
};
{
private ["_vehicle","_spawnPos","_difficulty","_patrolRadius"];
_vehicle = _x select 0;
_spawnPos = _x select 1;
_difficulty = _x select 2;
_patrolRadius = _x select 3;
//_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup;
_vehGroup = [_spawnPos,_spawnPos,3,3,_difficulty,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup;
//params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]];
_patrolVehicle = [_spawnPos,_spawnPos,_vehicle,_patrolRadius,_patrolRadius,_vehGroup] call blck_fnc_spawnVehiclePatrol;
//_vehGroup setVariable["groupVehicle",_vehicle];
if !(isNull _patrolVehicle) then
{
_patrolVehicle setVariable["vehicleGroup",_vehGroup];
};
} forEach _vehiclePatrolSpawns;
true

View File

@ -1,27 +0,0 @@
/*
by Ghostrider [GRG]
for ghostridergaming
12/5/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
// GMS_fnc_sm_missionPatrolMonitor
[] call blck_fnc_sm_monitorInfantry;
[] call blck_fnc_sm_monitorScuba;
//uiSleep 0.1;
[] call blck_fnc_sm_monitorVehicles;
[] call blck_fnc_sm_monitorAircraft;
[] call blck_fnc_sm_monitorEmplaced;
[] call blck_fnc_sm_monitorShips;
[] call blck_fnc_sm_monitorSubs;
//[] call blck_fnc_sm_monitorGarrisonsASL;
//[] call blck_fnc_sm_monitorGarrisons_relPos;

View File

@ -1,21 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
// ["B_SDV_01_F",[22584.9,15304.8,-6.14801],"red",4, 75,0],
params["_SDV","_pos","_difficulty","_numAI","_patrolRadius","_respawnTime"];
//diag_log format["_fnc_spawnSDVPatrol: _this = %1",_this];
private["_vehicle","_group","_diveDepth"];
_group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius - 2,_patrolRadius,blck_UMS_uniforms,blck_UMS_headgear,true,blck_UMS_weapons,blck_UMS_vests,true] call blck_fnc_spawnGroup;
_vehicle = [[_pos select 0, _pos select 1,0],[_pos select 0, _pos select 1,0],_vehType,_patrolRadius - 2,_patrolRadius,_group] call blck_fnc_spawnVehiclePatrol;
_diveDepth = 0.5 * [_pos] call blck_fnc_findWaterDepth;
(driver _vehicle) swiminDepth (_diveDepth select 2);
_group

View File

@ -1,38 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
#define configureWaypoints true
#define isScubaGroup true
// [_pos,_difficulty,_units,_patrolRadius]
params["_pos",["_skillLevel","red"],["_numUnits",6],["_patrolRadius",15]];
//diag_log format["_fnc_spawnScubaGroup: _this = %1",_this];
private["_group","_diveDepth"];
_group = grpNull;
//params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ];
_group = [_pos,_pos,_numUnits,_numUnits,_skillLevel, _patrolRadius - 2, _patrolRadius, configureWaypoints, blck_UMS_uniforms, blck_UMS_headgear, blck_UMS_vests, [], blck_UMS_weapons, [], isScubaGroup] call blck_fnc_spawnGroup;
//diag_log format["_fnc_spawnScubaGroup (14): -> value returned for group = %1",_group];
private _waterDepth = [_pos] call blck_fnc_findWaterDepth;
_diveDepth = _waterDepth * 0.5;
{
_x swimInDepth (_diveDepth);
} forEach units _group;
#ifdef blck_debugMode
if (blck_debugLevel > 1) then
{
{
diag_log format["_fnc_spawnScubaGroup:: _this select %1 = %2",_forEachIndex,_this select _forEachIndex];
}forEach _this;
diag_log format["_fnc_spawnScubaGroup:: -->> group spawned = %1",_group];
};
#endif
_group;

View File

@ -1,22 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
// ["B_SDV_01_F",[22584.9,15304.8,-6.14801],"red",4, 75,0],
params["_SDV","_pos","_difficulty","_numAI","_patrolRadius","_respawnTime"];
//diag_log format["_fnc_spawnSurfacePatrol: _this = %1",_this];
private["_vehicle"];
_group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius - 2,_patrolRadius,blck_UMS_uniforms,blck_UMS_headgear,true,blck_UMS_weapons,blck_UMS_vests,true] call blck_fnc_spawnGroup;
// params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]];
_vehicle = [_pos,_pos,_vehType,_minDis,_maxDis,_group] call blck_fnc_spawnVehiclePatrol;
_vehicle

View File

@ -1,15 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_vehicle"];
blck_sm_submarines pushBack [_vehicle,grpNull,0];
true

View File

@ -1,16 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 20167
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_group"];
blck_sm_scubaGroups pushBack [_group,grpNull,0];
//diag_log format["_sm_AddScubaGroup:: blck_sm_scubaGroups = %1",blck_sm_scubaGroups];
true

View File

@ -1,15 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_vehicle"];
blck_sm_surfaceShips pushBack [_vehicle,grpNull,0];
true

View File

@ -1,71 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private["_mapCenter","_waterPos","_priorUMSpositions"];
switch (toLower worldName) do
{
case "altis": {_mapCenter = [15000,19000,0];_maxDistance = 20000};
case "tanoa": {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 10000};
case "malden": {_mapCenter = [6000,7000,0];_maxDistance = 5500};
case "namalsk": {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 5000};
case "taviana": {_mapCenter = [12000,12000,0];_maxDistance = 12000};
case "napf" : {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 12000};
case "lythium": {_mapCenter = [10000,10000,0]; _maxDistance = 6000;};
default {_mapCenter = [6000,6000,0]; _maxDistance = 6000;};
};
_evaluate = true;
while {_evaluate} do
{
_waterPos = [
_mapCenter, // center of search area
2, // min distance to search
20000, // max distance to search
0, // distance to nearest object
2, // water mode [2 = water only]
25, // max gradient
0 // shoreMode [0 = anywhere]
] call BIS_fnc_findSafePos;
/*
_priorUMSpositions = +blck_priorDynamicUMS_Missions;
{
if (diag_tickTime > ((_x select 1) + 1800) then
{
blck_priorDynamicUMS_Missions = blck_priorDynamicUMS_Missions - _x;
} else {
if (_waterPos distance2D (_x select 0) < 2000) exitWith {_evaluate = false};
};
} forEach _priorUMSpositions;
*/
if (_evaluate) then
{
if (abs(getTerrainHeightASL _waterPos) < 30) then
{
if (abs(getTerrainHeightASL _waterPos) > 1) then
{
//_waterMarker = createMarker [format["water mission %1",getTerrainHeightASL _waterPos],_waterPos];
//_waterMarker setMarkerColor "ColorRed";
//_waterMarker setMarkerType "mil_triangle";
//_waterMarker setMarkerText format["Depth %1",getTerrainHeightASL _waterPos];
_evaluate = false;
};
};
};
};
_waterPos

View File

@ -1,23 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
private["_depth"];
params["_pos"];
_depth = (getTerrainHeightASL _pos);
//diag_log format["_fnc_findWaterDepth: _depth = %1",_depth];
_depth

View File

@ -1,16 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 20167
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
blck_fnc_findShoreLocation = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_UMS_fnc_findShoreLocation.sqf";
blck_fnc_addDyanamicUMS_Mission = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_addDynamicUMS_Mission.sqf";
blck_fnc_findWaterDepth = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_UMS_fnc_findWaterDepth.sqf";
diag_log "[blckeagls] UMS functions Functions compiled";

View File

@ -1,33 +0,0 @@
/*
by Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
//params["_pos"];
private["_UMS_mission","_waitTime","_mission","_pos"];
if (count blck_dynamicUMS_MissionList == 0) exitWith
{
blck_numberUnderwaterDynamicMissions = -1;
diag_log "No Dynamic UMS Missions Listed <spawning disabled>";
};
_UMS_mission = selectRandom blck_dynamicUMS_MissionList;
_waitTime = (blck_TMin_UMS) + random(blck_TMax_UMS - blck_TMin_UMS);
_mission = format["%1%2","Mafia Pirates",floor(random(1000000))];
_pos = call blck_fnc_findShoreLocation;
#ifdef blck_debugMode
if (blck_debugLevel >= 2) then {diag_log format["_fnc_addDynamicUMS_Mission: blck_dynamicUMS_MissionsRuning = %1 | blck_missionsRunning = %2 | blck_UMS_ActiveDynamicMissions = %3",blck_dynamicUMS_MissionsRuning,blck_missionsRunning,blck_UMS_ActiveDynamicMissions]};;
#endif
blck_UMS_ActiveDynamicMissions pushBack _pos;
blck_missionsRunning = blck_missionsRunning + 1;
blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning + 1;
//diag_log format["[blckeagls] UMS Spawner:-> waiting for %1",_waitTime];
uiSleep _waitTime;
//diag_log format["[blckeagls] UMS Spawner:-> spawning mission %1",_UMS_mission];
[_pos,_mission] call compileFinal preprocessFileLineNumbers format["q\addons\custom_server\Missions\UMS\dynamicMissions\%1",_UMS_mission];

View File

@ -1,73 +0,0 @@
/*
By Ghostrider GRG
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_mission"];
// Spawn landscape
// params["_objects"];
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_missionLandscape") then {_missionLandscape = []};
if (isNil "_garrisonedBuilding_ASLsystem") then {_garrisonedBuilding_ASLsystem = []};
if (isNil "_garrisonedBuildings_BuildingPosnSystem") then {_garrisonedBuildings_BuildingPosnSystem = []};
if (isNil "_airPatrols") then {_airPatrols = []};
if (isNil "_aiGroupParameters") then {_aiGroupParameters = []};
if (isNil "_missionEmplacedWeapons") then {_missionEmplacedWeapons = []};
if (isNil "_vehiclePatrolParameters") then {_vehiclePatrolParameters = []};
if (isNil "_missionLootVehicles") then {_missionLootVehicles = []};
_markerClass = format["static%1",floor(random(1000000))];
_blck_localMissionMarker = [_markerClass,_missionCenter,"","",_markerColor,_markerType];
if (blck_labelMapMarkers select 0) then
{
_blck_localMissionMarker set [2, _markerMissionName];
};
if !(blck_preciseMapMarkers) then
{
_blck_localMissionMarker set [1,[_missionCenter,75] call blck_fnc_randomPosition];
};
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
[_blck_localMissionMarker] call blck_fnc_spawnMarker;
[_missionLandscape] call blck_fnc_sm_spawnObjects;
//diag_log format["_fnc_sm_initializeUMSStaticMission: count _airPatrols = %1 | _airPatrols = %2", count _airPatrols, _airPatrols];
{
[blck_sm_Aircraft,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _airPatrols;
//uiSleep 1;
{
[blck_sm_Infantry,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _aiGroupParameters;
{
[blck_sm_scubaGroups,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _aiScubaGroupParameters;
{
[blck_sm_Emplaced,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _missionEmplacedWeapons;
{
[blck_sm_surfaceShips,_x] call blck_fnc_sm_AddGroupToArray;
}forEach _vehiclePatrolParameters;
{
[blck_sm_submarines,_x] call blck_fnc_sm_AddGroupToArray;
} forEach _submarinePatrolParameters;
//uiSleep 30;
// spawn loot chests
[_missionLootBoxes,_missionCenter] call blck_fnc_sm_spawnLootContainers;
diag_log format["[blckeagls] UMS Mission Spawner: Static UMS Mission %1 spawned",_mission];

View File

@ -1,636 +0,0 @@
/*
Dynamic Underwater Mission Spawner
By Ghostrider GRG
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
#define isScubaMission true
#define delayTime 1
private ["_abort","_crates","_aiGroup","_objects","_mines","_blck_AllMissionAI","_blck_localMissionMarker",
"_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups","_loadCratesTiming","_spawnCratesTiming","_assetSpawned",
"_blck_AllMissionAI","_delayTime","_wait","_missionStartTime","_playerInRange","_missionTimedOut","_temp","_patrolVehicles","_vehToSpawn","_marker"];
params["_coords","_mission",["_allowReinforcements",false]];
_markerClass = _mission;
_aiDifficultyLevel = _difficulty; // _difficulty is defined in the mission description file. see \addons\custom_server\Missions\UMS\dynamicMissions\default.sqf for an example
diag_log format["[blckeagls Dynamic UMS] dynamicUMSspawner (34):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
//if (isNil "_timeOut") then {_timeOut = -1;};
if (isNil "_missionGroups") then {_missionGroups = []};
if (isNil "_endCondition") then {_endCondition = blck_missionEndCondition}; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear"};
if (isNil "_spawnCratesTiming") then {_spawnCratesTiming = blck_spawnCratesTiming}; // Choices: "atMissionSpawnGround","atMissionStartAir","atMissionEndGround","atMissionEndAir".
if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn";
if (isNil "_useMines") then {_useMines = blck_useMines;};
if (isNil "_weaponList") then {_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout};
if (isNil "_sideArms") then {_sideArms = [_aiDifficultyLevel] call blck_fnc_selectAISidearms};
if (isNil "_uniforms") then {_uniforms = [_aiDifficultyLevel] call blck_fnc_selectAIUniforms};
if (isNil "_headGear") then {_headGear = [_aiDifficultyLevel] call blck_fnc_selectAIHeadgear};
if (isNil "_vests") then {_vests = [_aiDifficultyLevel] call blck_fnc_selectAIVests};
if (isNil "_backpacks") then {_backpacks = [_aiDifficultyLevel] call blck_fnc_selectAIBackpacks};
if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = [_aiDifficultyLevel] call blck_fnc_selectChanceHeliPatrol};
if (isNil "_noChoppers") then {_noChoppers = [_aiDifficultyLevel] call blck_fnc_selectNumberAirPatrols};
if (isNil "_chancePara") then {_chancePara = [_aiDifficultyLevel] call blck_fnc_selectChanceParatroops};
if (isNil "_missionHelis") then {_missionHelis = [_aiDifficultyLevel] call blck_fnc_selectMissionHelis};
if (isNil "_noPara") then {_noPara = [_aiDifficultyLevel] call blck_fnc_selectNumberParatroops};
if (isNil "_chanceLoot") then {_chanceLoot = 0};
if (isNil "_paraTriggerDistance") then {_paraTriggerDistance = 400;};
if (isNil "_paraLoot") then {_paraLoot = blck_BoxLoot_Blue};
if (isNil "_paraLootCounts") then {_paraLootCounts = blck_lootCountsRed};
if (isNil "_vehicleCrewCount") then {_vehicleCrewCount = [_aiDifficultyLevel] call GMS_fnc_selectVehicleCrewCount};
_objects = [];
_mines = [];
_crates = [];
_aiGroup = [];
_missionAIVehicles = [];
_blck_AllMissionAI = [];
_AI_Vehicles = [];
_blck_localMissionMarker = [_markerClass,_coords,"","",_markerColor,_markerType];
_delayTime = 1;
_groupPatrolRadius = 50;
if (blck_labelMapMarkers select 0) then
{
_blck_localMissionMarker set [2, _markerMissionName];
};
if !(blck_preciseMapMarkers) then
{
_blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition];
};
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers;
_marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker;
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (91) message players and spawn a mission marker";};
if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (77) waiting for player to trigger the mission";};
#endif
////////
// All parameters are defined, let's wait until a player is nearby or the mission has timed out
////////
_missionStartTime = diag_tickTime;
_playerInRange = false;
_missionTimedOut = false;
_wait = true;
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (90) starting mission trigger loop"};
if (blck_debugLevel > 2) then {_wait = false};
#endif
while {_wait} do
{
#ifdef blck_debugMode
if (blck_debugLevel > 2) exitWith {_playerInRange = true;};
#endif
if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;};
if ([_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut) exitWith {_missionTimedOut = true;};
uiSleep 5;
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format["dynamicUMSspawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords];
diag_log format["dynamicUMSspawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers];
diag_log format["dynamicUMSspawner:: Trigger Loop - timeout = %1", [_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut];
};
#endif
};
if (_missionTimedOut) exitWith
{
// Deal with the case in which the mission timed out.
blck_priorDynamicUMS_Missions pushback [_coords,diag_tickTime];
blck_UMS_ActiveDynamicMissions = blck_UMS_ActiveDynamicMissions - [_coords];
blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning - 1;
diag_log format["_fnc_dynamicUMSSpawner (187): mission timed out"];
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission;
};
////////
// Spawn the mission objects, loot chest, and AI
////////
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (142) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate
{
_temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates;
if (typeName _temp isEqualTo "ARRAY") then
{
_objects append _temp;
};
};
uiSleep delayTime;
if (_useMines) then
{
_mines = [_coords] call blck_fnc_spawnMines;
//uiSleep _delayTime;;
};
uiSleep delayTime;
_temp = [];
//diag_log format["_dynamicUMSspawner"" _missionLandscape = %1 | _missionLandscapeMode = %2",_missionLandscape, _missionLandscapeMode];
if (_missionLandscapeMode isEqualTo "random") then
{
_temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape;
};
if (_missionLandscapeMode isEqualTo "precise") then
{
//params["_center","_objects"];
_temp = [_coords, _missionLandscape] call blck_fnc_spawnCompositionObjects;
//uiSleep 1;
};
//diag_log format["_fnc_dynamicUMSspawner: _temp = %1, typeName _temp = %2",_temp, typeName _temp];
if (typeName _temp isEqualTo "ARRAY") then
{
_objects append _temp;
};
//diag_log format["_fnc_dynamicUMSspawner:: (176)->> _objects = %1",_objects];
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (190) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
uiSleep delayTime;;
_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
//uisleep 1;
_crates append _temp;
uiSleep _delayTime;
_abort = false;
_temp = [[],[],false];
//diag_log format["_fnc_dynamicUMSspawner: spawning infantry using data in _missionGroups with _missionGroups = %1",_missionGroups];
// Require that the server admin define the location of any infantry patrols given that missions will be off-shore.
// AI could be spawned on a platform or floating structure.
if (count _missionGroups > 0) then
{
// params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]];
_temp = [_coords, _minNoAI,_maxNoAI,_missionGroups,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false] call blck_fnc_spawnMissionAI;
};
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1;
};
_abort = _temp select 1;
if (blck_debugLevel > 2) then
{
diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1;
};
#endif
if (count _scubaGroupParameters > 0) then
{
//diag_log format["_fnc_dynamicUMSspawner: spawning scuba groups with _scubaGroupParameters = %1",_scubaGroupParameters];
// params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]];
_temp = [_coords, _minNoAI,_maxNoAI,_scubaGroupParameters,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionAI;
};
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1;
};
_abort = _temp select 1;
if (blck_debugLevel > 2) then
{
diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1;
};
#endif
if (_abort) exitWith
{
if (blck_debugLevel > 1) then {
diag_log "dynamicUMSspawner:: (220) grpNull returned, mission termination criteria met, calling blck_fnc_endMission"
};
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission;
};
if !(_abort) then
{
_blck_AllMissionAI append (_temp select 0);
};
uiSleep _delayTime;
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (235) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
uiSleep _delayTime;
_temp = [[],[],false];
_abort = false;
private["_patrolVehicles","_vehToSpawn"];
//diag_log format["_fnc_dynamicUMSspawner (258): _noVehiclePatrols = %1",_noVehiclePatrols];
_vehToSpawn = 0;
//diag_log format["_dynamicUMSspawner:: _vehToSpawn = %1",_vehToSpawn];
// Spawn any surface patrols
if (blck_useVehiclePatrols && count _vehiclePatrolParameters > 0) then
{
// params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]];
_temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_vehiclePatrolParameters,true,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false,_vehicleCrewCount /*,blck_UMS_weapons,blck_UMS_vests,isScubaMission*/ ] call blck_fnc_spawnMissionVehiclePatrols;
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {
diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp];
};
#endif
if (typeName _temp isEqualTo "ARRAY") then
{
_abort = _temp select 2;
};
if !(_abort) then
{
_patrolVehicles = _temp select 0;
_blck_AllMissionAI append (_temp select 1);
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
};
};
// Spawn any submarine patrols
if (blck_useVehiclePatrols && count _submarinePatrolParameters > 0) then
{
// params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]];
_temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_submarinePatrolParameters,true,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionVehiclePatrols;
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {
diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp];
};
#endif
if (typeName _temp isEqualTo "ARRAY") then
{
_abort = _temp select 2;
};
if !(_abort) then
{
_patrolVehicles = _temp select 0;
//diag_log format["[blckeagls] dynamicUMSspawner:: Patrol vehicles = %1",_patrolVehicles];
_blck_AllMissionAI append (_temp select 1);
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
};
};
if (_abort) exitWith
{
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {
diag_log "dynamicUMSspawner:: (279) grpNull returned, mission termination criteria met, calling blck_endMission";
};
#endif
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission;
};
uiSleep delayTime;
_temp = [[],[],false];
_abort = false;
_noChoppers = [_noChoppers] call blck_fnc_getNumberFromRange;
_noPara = [_noPara] call blck_fnc_getNumberFromRange;
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["_dynamicUMSspawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]};
#endif
if (_noChoppers > 0) then
{
for "_i" from 1 to (_noChoppers) do
{
if (random(1) < _chanceHeliPatrol) then
{
//_temp = [_coords,_missionHelis,spawnHeli,_aiDifficultyLevel,_chancePara,_noPara,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnMissionReinforcements;
_temp = [_coords,_aiDifficultyLevel,_missionHelis] call blck_fnc_spawnMissionHeli;
if (typeName _temp isEqualTo "ARRAY") then
{
_abort = _temp select 2;
blck_monitoredVehicles pushBack (_temp select 0);
_blck_AllMissionAI append (_temp select 1);
};
if (_abort) then
{
_objects pushback (_temp select 0);
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission;
};
};
};
};
//////////////////////////
// Spawn Crates and Emplaced Weapons Last to try to force them to correct positions relative to spawned buildinga or other objects.
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {diag_log format["dynamicUMSspawner:: (361) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];};
#endif
uiSleep 15;
private["_noEmplacedToSpawn"];
_noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange;
//diag_log format["_dynamicUMSspawner:: _noEmplacedToSpawn = %1",_vehToSpawn];
if (blck_useStatic && ((_noEmplacedToSpawn > 0)) || count _missionEmplacedWeapons > 0) then
{
// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
//_temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
_temp = [_coords,_missionEmplacedWeapons,true,_noEmplacedToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnEmplacedWeaponArray;
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format ["dynamicUMSspawner:: (375) blck_fnc_spawnEmplacedWeaponArray returned _temp = %1",_temp];
};
#endif
if (typeName _temp isEqualTo "ARRAY") then
{
_abort = _temp select 2;
};
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format ["dynamicUMSspawner:: (387) _abort = %1",_abort];
};
#endif
if !(_abort) then
{
_objects append (_temp select 0);
_blck_AllMissionAI append (_temp select 1);
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (400) Static Weapons Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
};
};
if (_abort) exitWith
{
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log "dynamicUMSspawner:: (410) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission";
};
#endif
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission;
};
uiSleep _delayTime;
if (_spawnCratesTiming isEqualTo "atMissionSpawnGround") then
{
if (count _missionLootBoxes > 0) then
{
_crates = [_coords,_missionLootBoxes,_loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
}
else
{
_crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
};
if (blck_cleanUpLootChests) then
{
_objects append _crates;
};
};
if (blck_cleanUpLootChests) then
{
_objects append _crates;
};
if (_noPara > 0 && (random(1) < _chancePara) && _paraTriggerDistance == 0) then
{
//diag_log format["_fnc_missionSpawner (435): spawning %1 paraunits at mission spawn",_noPara];
//private _paratroops = [_coords,_noPara,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnParaUnits;
// blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission
private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits;
if !(isNull _paratroops) then
{
_blck_AllMissionAI append (units _paratroops);
};
if (random(1) < _chanceLoot) then
{
private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
if (blck_cleanUpLootChests) then
{
_objects append _extraCrates;
};
};
};
//uisleep 2;
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
// Trigger for mission end
#ifdef blck_debugMode
diag_log format["[blckeagls] mission Spawner(436) _endCondition = %1",_endCondition];
#endif
private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"];
_missionComplete = -1;
_startTime = diag_tickTime;
if (blck_showCountAliveAI) then
{
//diag_log format["_dynamicUMSspawner(441): Adding Number Alive AI: _marker = %1 | _markerMissionName = %2",_marker,_markerMissionName];
//diag_log format["_dynamicUMSspawner(442): Alive AI = %1 | Current Marker Text = %2",{alive _x} count _blck_AllMissionAI, markerText _marker];
if !(_marker isEqualTo "") then
{
[_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount;
blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI];
//diag_log format["_dynamicUMSspawner: blck_missionMarkers = %1",blck_missionMarkers];
};
};
switch (_endCondition) do
{
case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;};
case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;};
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
};
#ifdef blck_debugMode
diag_log format["dynamicUMSspawner :: (449) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
#endif
private["_locations"];
_locations = [_coords];
{
_locations pushback (getPos _x);
_x setVariable["crateSpawnPos", (getPos _x)];
} forEach _crates;
#ifdef blck_debugMode
diag_log format["dynamicUMSspawner (458):: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations];
#endif
private _crateStolen = false;
#ifdef blck_debugMode
diag_log format["dynamicUMSspawner(462):: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled];
#endif
if (blck_showCountAliveAI) then
{
if !(_marker isEqualTo "") then
{
[_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount;
blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI];
};
};
private _spawnPara = if (random(1) < _chancePara) then {true} else {false};
_missionComplete = -1;
while {_missionComplete isEqualTo -1} do
{
#ifdef blck_debugMode
if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 10; diag_log "_fnc_dynamicUMSSpawner (574): scripted mission end";};
#endif
if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {};
if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {};
if (_spawnCratesTiming isEqualTo "atMissionSpawn") then
{
{
if ({[_x] call blck_fnc_crateMoved} count _crates > 0) exitWith
{
_missionComplete = 1;
_crateStolen = true;
};
}forEach _crates;
};
if (_spawnPara) then
{
if ([_coords,_paraTriggerDistance,true] call blck_fnc_playerInRange) then
{
_spawnPara = false; // The player gets one try to spawn these.
if (random(1) < _chancePara) then //
{
// blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits;] call blck_fnc_spawnParaUnits;
private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits;
if !(isNull _paratroops) then
{
_blck_AllMissionAI append (units _paratroops);
};
if (random(1) < _chanceLoot) then
{
private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
if (blck_cleanUpLootChests) then
{
_objects append _extraCrates;
};
};
};
};
};
//diag_log format["dynamicUMSspawner:: (483) missionCompleteLoop - > players near = %1 and ai alive = %2 and crates stolen = %3",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI, _crateStolen];
uiSleep 4;
};
if (_crateStolen) exitWith
{
//diag_log format["dynamicUMSspawner:: (542) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen];
[_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_mission,2,isScubaMission] call blck_fnc_endMission;
};
if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then
{
if (count _missionLootBoxes > 0) then
{
_crates = [_coords,_missionLootBoxes,_loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
}
else
{
_crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates;
};
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {diag_log format["_fnc_dynamicUMSspawner (531): _crates = %1", _crates]};
#endif
if (blck_cleanUpLootChests) then
{
_objects append _crates;
};
#ifdef blck_debugMode
if (blck_debugLevel > 0) then {diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]};
#endif
};
if (_spawnCratesTiming isEqualTo "atMissionSpawnGround" && _loadCratesTiming isEqualTo "atMissionCompletion") then
{
{
[_x] call blck_fnc_loadMissionCrate;
} forEach _crates;
};
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] dynamicUMSspawner:: (496) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
diag_log format["dynamicUMSspawner :: (497) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
diag_log format["[blckeagls] dynamicUMSspawner:: (498) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
private["_result"];
// Force passing the mission name for informational purposes.
_blck_localMissionMarker set [2, _markerMissionName];
if (blck_showCountAliveAI) then
{
//_marker setMarkerText format["%1: All AI Dead",_markerMissionName];
{
if ((_x select 1) isEqualTo _markerMissionName) exitWith{blck_missionMarkers deleteAt _forEachIndex};
}forEach blck_missionMarkers;
};
// params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_endCondition",0],["_vehicles",[]],["_isScubaMission",false]];
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0,_missionAIVehicles,isScubaMission] call blck_fnc_endMission;
#ifdef blck_debugMode
diag_log format["[blckeagls] dynamicUMSspawner:: (559) end of mission: blck_fnc_endMission has returned control to _fnc_dynamicUMSspawner"];
#endif
blck_missionsRun = blck_missionsRun + 1;
diag_log format["[blckeagls] dynamicUMSspawner:: Total Dyanamic Land and UMS Run = %1", blck_missionsRun];

View File

@ -8,23 +8,27 @@ A huge thank you to Ignaz-HeMan for many changes to resolve bugs and improve cod
Significant Changes:
=====================
v 6.92
1. Added code needed to use Claim Vehicle scripts on Exile Servers.
2. Added simulation management for dead AI when blck_useBlckeaglsSimulationManagement == true;
3. Deleted unused files.
4. A monitor to catch wandering units and send them back to the mission was added.
5. Some issues with vehicles not being unlocked when AI hop out.
6. Added a setting to disable deployment of smoke when AI heal.
blck_useSmokeWhenHealing = true; // when true, injured AI will toss a smoke when they attempt to heal.
TODO: distribute AI to clients (work in progress)
Settings for this:
6.92 Build 179
1. Support for claim-vehicle scripts is now built-in
blck_allowClaimVehicle = true; // To allow players to claim vehicles (Exile only).
Thanks to PRJX for the lead on the code.
2. Added a setting to disable having AI toss smoke before healing. Set:
blck_useSmokeWhenHealing=false; // to disable this
3. Added an option to display kill notices using Toasts
blck_aiKillUseToast=true; // in blckClient.sqf in the debug folder of your mission.pbo to enable these.
4. Added offloading of AI to clients
////////
// Client Offloading and Headless Client Configurations
blck_useHC = true; // Experimental (death messages and rewards not yet working).
// Credit to Defent and eraser for their excellent work on scripts to transfer AI to clients for which these settings are required.
blck_ai_offload_to_client = false; // forces AI to be transfered to player's PCs. Disable if you have players running slow PCs.
blck_ai_offload_to_client = true; // forces AI to be transfered to player's PCs. Disable if you have players running slow PCs.
blck_ai_offload_notifyClient = false; // Set true if you want notifications when AI are offloaded to a client PC. Only for testing/debugging purposes.
// TODO: set to false before release
blck_limit_ai_offload_to_blckeagls = true; // when true, only groups spawned by blckeagls are evaluated.
5.Changed - Monitoring of groups refined to route mission groups that have left the mission area back to it.
6. Fixed - Vehicle unlock when empty of crew through adding a getOut event handler.
7. Code for spawning vehicles redone to reduced redundancy.
V 6.90 Build 175
1. Added new settings to specify the number of crew per vehhicle to blck_config.sqf and blck_config_mil.sqf