Merge pull request #49 from Ghostrider-DbD-/Version-6.60-Build-66
Added hunting behavior for vehicles/choppers. cleaned up code in mission\debug.pbo.
This commit is contained in:
commit
365b4abc83
1
@ExileServer/addons/custom_server/$PBOPREFIX$
Normal file
1
@ExileServer/addons/custom_server/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
q\addons\custom_server
|
1
@ExileServer/addons/custom_server/$PREFIX$
Normal file
1
@ExileServer/addons/custom_server/$PREFIX$
Normal file
@ -0,0 +1 @@
|
||||
q\addons\custom_server
|
@ -0,0 +1,27 @@
|
||||
//This script sends Message Information to allplayers
|
||||
// Last modified 1/4/17 by Ghostrider-DBD-
|
||||
/*
|
||||
--------------------------
|
||||
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_Message = _this;
|
||||
params["_msg",["_players",playableUnits]];
|
||||
if (blck_debugLevel > 1) then {diag_log format["AIM.sqf ===] _this = %1 | _msg = %2 | _players = %3",_this,_msg, _players];};
|
||||
blck_Message = _msg;
|
||||
{
|
||||
//diag_log format["AIM.sqf ===] _ = %2, and (owner _x) = %1", (owner _x), _x];
|
||||
(owner _x) publicVariableClient "blck_Message";
|
||||
} forEach _players;
|
||||
/*
|
||||
if (_modType isEqualTo "Exile") then
|
||||
{
|
||||
[_blck_Message] remoteExec["fn_blck_MessageHandler",0];
|
||||
};
|
||||
*/
|
||||
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Determines the total number of spawned groups on the side used by the mission system and returns this value.
|
||||
By Ghostrider-DbD-
|
||||
Last updated 12/21/16
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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 _Groups_AI_Side = 0;
|
||||
|
||||
{
|
||||
if ( (side _x) isEqualTo blck_AI_Side) then {_Groups_AI_Side = _Groups_AI_Side + 1;};
|
||||
}forEach allGroups;
|
||||
//diag_log format["_fnc_groupsOnAISide:: -- >> allGroups = %1 | _Groups_AI_Side = %2",allGroups, _Groups_AI_Side];
|
||||
|
||||
// Return the number of groups used.
|
||||
_Groups_AI_Side
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
[_item,_crate] call blck_addItemToCrate;
|
||||
where
|
||||
_crate is a container such as ammo box or vehicle
|
||||
_item is a string or array.
|
||||
If _item is a string then add 1 of that item to the container.
|
||||
If _item is an array with 2 elements ["itemName",3] then assume that the first element is a string and is the name of the item, and the second is the number to add.
|
||||
if _item is an array with 3 elements ["itemName",2,6] assume that the first element is the item name (string), the second the min # to add and the third the max # to add.
|
||||
by Ghostrider-DbD-
|
||||
11/14/16
|
||||
|
||||
--------------------------
|
||||
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["_itemInfo","_crate",["_addAmmo",0]];
|
||||
private["_isRifle","_isMagazine","_isBackpack"];
|
||||
_isWeapon = false;
|
||||
_isMagazine = false;
|
||||
_isBackpack = false;
|
||||
_quant = 0;
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["blck_addItemToCrate:: -- >> itemInfo = %1 | _crate %2 | _addAmmo %3",_itemInfo, _crate, _addAmmo];
|
||||
#endif
|
||||
if (typeName _itemInfo isEqualTo "STRING") then {_item = _itemInfo; _quant = 1}; // case where only the item descriptor was provided
|
||||
if (typeName _itemInfo isEqualTo "ARRAY") then {
|
||||
|
||||
if (count _itemInfo isEqualTo 2) then {_item = _itemInfo select 0; _quant = _itemInfo select 1;}; // case where item descriptor and quantity were provided
|
||||
if (count _itemInfo isEqualto 3) then {
|
||||
_item = _itemInfo select 0;
|
||||
_quant = (_itemInfo select 1) + round(random((_itemInfo select 2) - (_itemInfo select 1)));
|
||||
}; // case where item descriptor, min number and max number were provided.
|
||||
};
|
||||
if (((typeName _item) isEqualTo "STRING") && (_item != "")) then
|
||||
{
|
||||
if (isClass(configFile >> "CfgWeapons" >> _item)) then {
|
||||
_crate addWeaponCargoGlobal [_item,_quant];
|
||||
_isWeapon = true;
|
||||
_count = 0;
|
||||
if (typeName _addAmmo isEqualTo "SCALAR") then
|
||||
{
|
||||
_count = _addAmmo;
|
||||
};
|
||||
if (typeName _addAmmo isEqualto "ARRAY") then
|
||||
{
|
||||
_count = (_addAmmo select 0) + (round(random((_addAmmo select 1) - (_addAmmo select 0))));
|
||||
};
|
||||
_ammo = getArray (configFile >> "CfgWeapons" >> _item >> "magazines");
|
||||
for "_i" from 1 to _count do
|
||||
{
|
||||
_crate addMagazineCargoGlobal [selectRandom _ammo,1];
|
||||
};
|
||||
};
|
||||
if (_item isKindOf ["Bag_Base", configFile >> "CfgVehicles"]) then {_crate addBackpackCargoGlobal [_item,_quant]; _isBackpack = true;};
|
||||
if (isClass(configFile >> "CfgMagazines" >> _item)) then {_crate addMagazineCargoGlobal [_item,_quant]; _isMagazine = true;};
|
||||
if (!_isWeapon && !_isMagazine && _isBackpack && isClass(configFile >> "CfgVehicles" >> _item)) then {_crate addItemCargoGlobal [_item,_quant]};
|
||||
};
|
@ -0,0 +1,24 @@
|
||||
//////////////////////////////////////////////////////
|
||||
// Returns an array of all players on the server
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 2/24/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 ["_result"];
|
||||
|
||||
_result = [];
|
||||
{
|
||||
if (isPlayer _x) then { _result pushback _x };
|
||||
} forEach playableUnits;
|
||||
_result
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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_serverFPS = diag_FPS;
|
||||
publicVariable "blck_serverFPS";
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
call as [] call blck_fnc_cleanEmptyGroups;
|
||||
Deletes any empty groups and thereby prevents errors resulting from createGroup returning nullGroup.
|
||||
By Ghostrider-DbD-
|
||||
11/16/16
|
||||
--------------------------
|
||||
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";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format ["_fnc_cleanEmptyGroups:: -- >> group count = %1 ",(count allGroups)];
|
||||
diag_log format ["_fnc_cleanEmptyGroups:: -- >> Group count AI side = %1", call blck_fnc_groupsOnAISide];
|
||||
};
|
||||
#endif
|
||||
|
||||
private _grp = +allGroups;
|
||||
{
|
||||
//diag_log format["_fnc_cleanEmptyGroups:: - >> type of object _x = %1",typeName _x];
|
||||
if ((count units _x) isEqualTo 0) then {deleteGroup _x};
|
||||
}forEach _grp;
|
||||
if (blck_debugLevel > 2) then {diag_log "_fnc_cleanEmptyGroups:: -- >> exiting function";};
|
||||
|
@ -0,0 +1,18 @@
|
||||
|
||||
/*
|
||||
Remove all inventory from an object.
|
||||
By Ghostrider-DbD0
|
||||
--------------------------
|
||||
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["_veh"];
|
||||
clearWeaponCargoGlobal _veh;
|
||||
clearMagazineCargoGlobal _veh;
|
||||
clearBackpackCargoGlobal _veh;
|
||||
clearItemCargoGlobal _veh;
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
Generates an array of equidistant positions along the circle of diameter _radius
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 1-22-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["_locs","_startDir","_currentDir","_Arc","_dist","_newpos"];
|
||||
params["_center","_num","_minDistance","_maxDistance"];
|
||||
|
||||
_locs = [];
|
||||
_startDir = round(random(360));
|
||||
_currentDir = _startDir;
|
||||
_Arc = 360/_num;
|
||||
|
||||
for "_i" from 1 to _num do
|
||||
{
|
||||
_currentDir = _currentDir + _Arc;
|
||||
//diag_log format["spawnEmplaced: _currentDir is %1 for cycle %2",_currentDir,_i];
|
||||
_dist = round(_minDistance + (random(_maxDistance - _minDistance)));
|
||||
_newpos = _center getPos [_dist, _currentDir];
|
||||
//diag_log format["findPositionAlongRadius:: distance of pos %1 from center is %2",_newpos, _newpos distance _center];
|
||||
_locs pushback _newpos;
|
||||
};
|
||||
//diag_log format["_fnc_findPositionsAlongARadius:: _locations = %1",_locations];
|
||||
_locs
|
||||
|
||||
|
||||
|
@ -0,0 +1,131 @@
|
||||
// self explanatory. Checks to see if the position is in either a black listed location or near a player spawn.
|
||||
// As written this relies on BIS_fnc_findSafePos to ensure that the spawn point is not on water or an excessively steep slope.
|
||||
//
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 1-22-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["_findNew","_coords","_dist","_xpos","_ypos","_newPos","_townPos","_pole"];
|
||||
|
||||
_findNew = true;
|
||||
|
||||
while {_findNew} do {
|
||||
_findNew = false;
|
||||
//[_centerForSearch,_minDistFromCenter,_maxDistanceFromCenter,_minDistanceFromNearestObj,_waterMode,_maxTerainGradient,_shoreMode] call BIS_fnc_findSafePos
|
||||
// https://community.bistudio.com/wiki/BIS_fnc_findSafePos
|
||||
_coords = [blck_mapCenter,0,blck_mapRange,30,0,5,0] call BIS_fnc_findSafePos;
|
||||
//diag_log format["<<--->> _coords = %1",_coords];
|
||||
|
||||
{
|
||||
if ((_x distance2D _coords) < blck_MinDistanceFromMission) then {
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach DBD_HeliCrashSites;
|
||||
|
||||
{
|
||||
if ( ((_x select 0) distance2D _coords) < (_x select 1)) exitWith
|
||||
{
|
||||
_findNew = true;
|
||||
};
|
||||
} forEach blck_locationBlackList;
|
||||
|
||||
//diag_log format["#- findSafePosn -# blck_ActiveMissionCoords isEqualTo %1", blck_ActiveMissionCoords];
|
||||
{
|
||||
//diag_log format["#- findSafePosn -# blck_ActiveMissionCoords active mission item is %1", _x];
|
||||
if ( (_x distance2D _coords) < blck_MinDistanceFromMission) exitWith
|
||||
{
|
||||
_FindNew = true;
|
||||
};
|
||||
} forEach blck_ActiveMissionCoords;
|
||||
|
||||
//diag_log format["#- findSafePosn -# blck_recentMissionCoords isEqualTo %1", blck_recentMissionCoords];
|
||||
{
|
||||
private["_oldPos","_ignore"];
|
||||
_ignore = false;
|
||||
//diag_log format["-# findSafePosn.sqf -# Old Mission element is %1", _x];
|
||||
if (diag_tickTime > ((_x select 1) + 1200)) then // if the prior mission was completed more than 20 min ago then delete it from the list and ignore the check for this location.
|
||||
{
|
||||
_ignore = true;
|
||||
blck_recentMissionCoords= blck_recentMissionCoords - _x;
|
||||
//diag_log format["-# findSafePosn.sqf -# Removing Old Mission element: %1", _x];
|
||||
};
|
||||
if !(_ignore) then
|
||||
{
|
||||
//diag_log format["-# findSafePosn.sqf -# testing _coords against Old Mission coords is %1", _x select 0];
|
||||
if ( ((_x select 0) distance2D _coords) < blck_MinDistanceFromMission) then
|
||||
{
|
||||
_findNew = true;
|
||||
//diag_log format["-# findSafePosn.sqf -# Too Close to Old Mission element: %1", _x];
|
||||
};
|
||||
};
|
||||
} forEach blck_recentMissionCoords;
|
||||
|
||||
// test for water nearby
|
||||
private ["_i"];
|
||||
_dist = 100;
|
||||
for [{_i=0}, {_i<360}, {_i=_i+20}] do
|
||||
{
|
||||
_xpos = (_coords select 0) + sin (_i) * _dist;
|
||||
_ypos = (_coords select 1) + cos (_i) * _dist;
|
||||
_newPos = [_xpos,_ypos,0];
|
||||
if (surfaceIsWater _newPos) then
|
||||
{
|
||||
_findNew = true;
|
||||
_i = 361;
|
||||
};
|
||||
};
|
||||
// check that missions spawn at least 1 kkm from towns
|
||||
{
|
||||
_townPos = [((locationPosition _x) select 0), ((locationPosition _x) select 1), 0];
|
||||
if (_townPos distance2D _coords < 200) exitWith {
|
||||
_findNew = true;
|
||||
};
|
||||
} forEach blck_townLocations;
|
||||
|
||||
// check for nearby plot pole/freq jammer within 800 meters
|
||||
_mod = call blck_fnc_getModType;
|
||||
_pole = "";
|
||||
if (_mod isEqualTo "Epoch") then {_pole = "PlotPole_EPOCH"};
|
||||
if (_mod isEqualTo "Exile") then {_pole = "Exile_Construction_Flag_Static"};
|
||||
//diag_log format["_fnc_findSafePosn:: -- >> _mod = %1 and _pole = %2",_mod,_pole];
|
||||
{
|
||||
if ((_x distance2D _coords) < 600) then
|
||||
{
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach nearestObjects[player, [_pole], 800];
|
||||
|
||||
// check to be sure we do not spawn a mission on top of a player.
|
||||
{
|
||||
if (isPlayer _x && (_x distance2D _coords) < 600) then
|
||||
{
|
||||
_findNew = true;
|
||||
};
|
||||
}forEach playableUnits;
|
||||
|
||||
if (toLower(worldName) isEqualTo "taviana") then
|
||||
{
|
||||
_tavTest = createVehicle ["SmokeShell",_coords,[], 0, "CAN_COLLIDE"];
|
||||
_tavHeight = (getPosASL _tavTest) select 2;
|
||||
deleteVehicle _tavTest;
|
||||
if (_tavHeight > 100) then {_FindNew = true;};
|
||||
};
|
||||
};
|
||||
|
||||
if ((count _coords) > 2) then
|
||||
{
|
||||
private["_temp"];
|
||||
_temp = [_coords select 0, _coords select 1];
|
||||
_coords = _temp;
|
||||
};
|
||||
_coords;
|
@ -0,0 +1,67 @@
|
||||
/*
|
||||
Determine the map name, set the map center and size, and return the map name.
|
||||
Trader coordinates were pulled from the config.cfg
|
||||
Inspired by the Vampire and DZMS
|
||||
Last Modified 9/3/16
|
||||
--------------------------
|
||||
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["_blck_WorldName"];
|
||||
|
||||
_blck_WorldName = toLower format ["%1", worldName];
|
||||
_blck_worldSize = worldSize;
|
||||
|
||||
diag_log format["[blckeagls] Loading Map-specific settings with worldName = %1",_blck_WorldName];
|
||||
|
||||
switch (_blck_WorldName) do
|
||||
{// These may need some adjustment - including a test for shore or water should help as well to avoid missions spawning on water.
|
||||
case "altis":{
|
||||
diag_log "[blckeagls] Altis-specific settings for Epoch loaded";
|
||||
blck_mapCenter = [6322,7801,0];
|
||||
blck_mapRange = 21000;
|
||||
};
|
||||
case "stratis":{
|
||||
diag_log "[blckeagls] Stratis-specific settings loaded";
|
||||
blck_mapCenter = [6322,7801,0];
|
||||
blck_mapRange = 4500;
|
||||
}; // Add Central, East and West respawns/traders
|
||||
case "chernarus":{
|
||||
diag_log "[blckeagls] Chernarus-specific settings loaded";
|
||||
blck_mapCenter = [7100, 7750, 0]; //centerPosition = {7100, 7750, 300};
|
||||
blck_mapRange = 5300;
|
||||
};
|
||||
case "chernarus_summer":{blck_mapCenter = [7100, 7750, 0]; blck_mapRange = 6000;};
|
||||
case "bornholm":{
|
||||
//diag_log "Bornholm-specific settings loaded";
|
||||
blck_mapCenter = [11240, 11292, 0];
|
||||
blck_mapRange = 14400;
|
||||
};
|
||||
case "esseker":{
|
||||
diag_log "Esseker-specific settings loaded";
|
||||
blck_mapCenter = [6049.26,6239.63,0]; //centerPosition = {7100, 7750, 300};
|
||||
blck_mapRange = 6000;
|
||||
};
|
||||
case "taviana":{blck_mapCenter = [10370, 11510, 0];blck_mapRange = 14400;};
|
||||
case "namalsk":{blck_mapCenter = [4352, 7348, 0];blck_mapRange = 10000;};
|
||||
case "napf": {blck_mapCenter = [10240,10240,0]; blck_mapRange = 14000}; // {_centerPos = [10240, 10240, 0];_isMountainous = true;_maxHeight = 50;};
|
||||
case "australia": {blck_mapCenter = [20480,20480, 150];blck_mapRange = 40960;};
|
||||
case "panthera3":{blck_mapCenter = [4400, 4400, 0];blck_mapRange = 4400;};
|
||||
case "isladuala":{blck_mapCenter = [4400, 4400, 0];blck_mapRange = 4400;};
|
||||
case "sauerland":{blck_mapCenter = [12800, 12800, 0];blck_mapRange = 12800;};
|
||||
case "trinity":{blck_mapCenter = [6400, 6400, 0];blck_mapRange = 6400;};
|
||||
case "utes":{blck_mapCenter = [3500, 3500, 0];blck_mapRange = 3500;};
|
||||
case "zargabad":{blck_mapCenter = [4096, 4096, 0];blck_mapRange = 4096;};
|
||||
case "fallujah":{blck_mapCenter = [3500, 3500, 0];blck_mapRange = 3500;};
|
||||
case "tavi":{blck_mapCenter = [10370, 11510, 0];blck_mapRange = 14090;};
|
||||
case "lingor":{blck_mapCenter = [4400, 4400, 0];blck_mapRange = 4400;};
|
||||
case "takistan":{blck_mapCenter = [5500, 6500, 0];blck_mapRange = 5000;};
|
||||
default {_blck_WorldName = "default";blck_mapCenter = [6322,7801,0]; blck_mapRange = 6000};
|
||||
};
|
||||
|
||||
blck_worldSet = true;
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
Based on code by IT07 written for VEMF_r
|
||||
--------------------------
|
||||
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 "_mod";
|
||||
|
||||
_mod = "";
|
||||
|
||||
if not ( isNull ( configFile >> "CfgPatches" >> "exile_server" ) ) then { _mod = "Exile" };
|
||||
if not ( isNull ( configFile >> "CfgPatches" >> "a3_epoch_server" ) ) then { _mod = "Epoch" };
|
||||
|
||||
_mod
|
@ -0,0 +1,23 @@
|
||||
// pull trader cities from config
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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";
|
||||
|
||||
if !(blck_blacklistTraderCities) exitWith {};
|
||||
diag_log format["[blckeagls] Adding Trader Cities to blacklisted locations based on setting for blck_blacklistTraderCities = %1",blck_blacklistTraderCities];
|
||||
private _traderCites = allMapMarkers;
|
||||
|
||||
{
|
||||
if (_x in ["center","respawn_east","respawn_west","respawn_north"] && blck_blacklistTraderCities) then
|
||||
{
|
||||
blck_locationBlackList pushback [getMarkerPos _x,1000];
|
||||
//if (blck_debugON) then {diag_log format["[blckeagls] _fnc_getTraderCitiesEpoch:: -- >> Added epoch trader city location at %1", (getMarkerPos _x)];};
|
||||
};
|
||||
}forEach _traderCites;
|
@ -0,0 +1,31 @@
|
||||
// pull trader cities from config
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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 _traderCites = allMapMarkers;
|
||||
_tc = [];
|
||||
{
|
||||
if (blck_debugON) then {diag_log format["[blckeagls] _fnc_getExileLocations :: -- >> Evaluating Markertype of %1", (getMarkerType _x)];};
|
||||
if (getMarkerType _x isEqualTo "ExileTraderZone" && blck_blacklistTraderCities) then {
|
||||
blck_locationBlackList pushback [(getMarkerPos _x),1000];
|
||||
if (blck_debugON) then {diag_log format["[blckeagls] _fnc_getExileLocations :: -- >> Added Exile Trader location at %1", (getMarkerPos _x)];};
|
||||
};
|
||||
|
||||
if ((getMarkerType _x isEqualTo "ExileSpawnZone") && blck_blacklistSpawns) then {
|
||||
blck_locationBlackList pushback [(getMarkerPos _x),1000];
|
||||
if (blck_debugON) then {diag_log format["[blckeagls] _fnc_getExileLocations :: -- >> Added Exile Spawn location at %1", (getMarkerPos _x)];};
|
||||
};
|
||||
//
|
||||
if (getMarkerType _x isEqualTo "ExileConcreteMixerZone" && blck_listConcreteMixerZones) then {
|
||||
blck_locationBlackList pushback [(getMarkerPos _x),1000];
|
||||
if (blck_debugON) then {diag_log format["[blckeagls] _fnc_getExileLocations :: -- >> Added Exile Concrete Mixer location at %1", (getMarkerPos _x)];};
|
||||
};
|
||||
}forEach _traderCites;
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
Original Credit:
|
||||
Updated for Epoch 0.3.8.0 by He-Man
|
||||
http://epochmod.com/forum/index.php?/topic/34661-release-hs-blackmarket-16-new-trader-system-special-trader-blackmarket/&page=38
|
||||
HALV_takegive_crypto.sqf
|
||||
by Halv
|
||||
|
||||
Copyright (C) 2015 Halvhjearne & Suppe
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
Contact : halvhjearne@gmail.com
|
||||
*/
|
||||
params["_player","_nr"];
|
||||
private["_cIndex","_vars","_current_crypto","_current_cryptoRaw","_playerCryptoLimit"];
|
||||
_cIndex = EPOCH_customVars find "Crypto";
|
||||
_vars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar];
|
||||
_current_crypto = _vars select _cIndex;
|
||||
_current_cryptoRaw = _current_crypto;
|
||||
_playerCryptoLimit = EPOCH_customVarLimits select _cIndex;
|
||||
_playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"];
|
||||
_current_crypto = ((_current_cryptoRaw + _nr) min _playerCryptoLimitMax) max _playerCryptoLimitMin;
|
||||
_current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)];
|
||||
_vars set[_cIndex, _current_crypto];
|
||||
_player setVariable["VARS", _vars];
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
Depends on blck_fnc_addItemToCrate
|
||||
|
||||
call as:
|
||||
|
||||
[_item,_crate] call blck_fnc_loadLootFromItemsArray;
|
||||
|
||||
where
|
||||
_crate is a container such as ammo box or vehicle
|
||||
_loadout is an array containing either 2 or 3 elements. The first array is always an array of items to add. Items can be formated as ["item1","item1"], as [["item1",3],["item2",2]] or as [["item1",2,4],["item2",3,5]].
|
||||
See GMS_fnc_addItemToCrate for information about the acceptable formates for the items "item1" ... "itemN".
|
||||
|
||||
The second and optional third element in the array specify the number of times the script will randomly select an item from the array of items and load it into the crate.
|
||||
For example:
|
||||
case 1: [["item1",...,"itemN"],6]; The script will randomly select from the array of item names 6 times and call the loot loader each time.
|
||||
case 2: [["item1",...,"itemN"],6, 9]; As above except that an item will be selected a minimum of 6 and maximum of 9 times.
|
||||
|
||||
by Ghostrider-DbD-
|
||||
6/7/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["_loadout","_crate",["_addAmmo",0]];
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["blck_fnc_loadLootFromItemsArray:: _this %1",_this];
|
||||
diag_log format["blck_fnc_loadLootFromItemsArray:: _crate %1 | _addAmmo %2 | _loadout %3",_crate,_addAmmo,_loadout];
|
||||
#endif
|
||||
if ((_loadout select 0) isEqualTo []) exitWith {};
|
||||
{
|
||||
private["_tries","_q","_item"];
|
||||
_tries = 0;
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["blck_fnc_loadLootFromItemsArray:: -- >> now loading for %1",_x];
|
||||
#endif
|
||||
_q = _x select 1; // this can be a number or array.
|
||||
if ( (typeName _q) isEqualTo "ARRAY") then // Assume the array contains a min/max number to add
|
||||
{
|
||||
if ((count _q) isEqualTo 2) then {_tries = (_q select 0) + round(random(((_q select 1) - (_q select 0))));} else {_tries = 0;};
|
||||
};
|
||||
if ((typeName _q) isEqualTo "SCALAR") then
|
||||
{
|
||||
_tries = _q;
|
||||
};
|
||||
for "_i" from 1 to _tries do
|
||||
{
|
||||
_item = selectRandom (_x select 0);
|
||||
[_item,_crate,_addAmmo] call blck_fnc_addItemToCrate;
|
||||
};
|
||||
}forEach _loadout;
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
Last modified 4-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["starting _fnc_mainThread with time = %1",diag_tickTime];
|
||||
|
||||
#ifdef DBDserver
|
||||
diag_log "running DBDServer version of _fnc_mainThread";
|
||||
#endif
|
||||
|
||||
private["_modType","_timer1sec","_timer5sec","_timer20sec","_timer5min","_timer5min"];
|
||||
_timer1sec = diag_tickTime;
|
||||
_timer5sec = diag_tickTime;
|
||||
_timer20sec = diag_tickTime;
|
||||
_timer1min = diag_tickTime;
|
||||
_timer5min = diag_tickTime;
|
||||
_modType = [] call blck_fnc_getModType;
|
||||
while {true} do
|
||||
{
|
||||
uiSleep 1;
|
||||
//diag_log format["mainThread:: -- > time = %1",diag_tickTime];
|
||||
if (diag_tickTime - _timer1sec > 1) then
|
||||
{
|
||||
[] call blck_fnc_vehicleMonitor;
|
||||
#ifdef DBDserver
|
||||
[] call blck_fnc_broadcastServerFPS;
|
||||
#endif
|
||||
_timer1sec = diag_tickTime;
|
||||
};
|
||||
if (diag_tickTime - _timer5sec > 5) then
|
||||
{
|
||||
_timer5sec = diag_tickTime;
|
||||
[] call blck_fnc_missionGroupMonitor;
|
||||
};
|
||||
if (diag_tickTime - _timer20sec > 20) then
|
||||
{
|
||||
[] call blck_fnc_cleanupAliveAI;
|
||||
[] call blck_fnc_cleanupObjects;
|
||||
[] call blck_fnc_cleanupDeadAI;
|
||||
_timer20sec = diag_tickTime;
|
||||
//diag_log format["_mainThread::-->> diag_tickTime = %1",diag_tickTime];
|
||||
};
|
||||
if (diag_tickTime - _timer1min > 60) then
|
||||
{
|
||||
_timer1min = diag_tickTime;
|
||||
[] call blck_fnc_spawnPendingMissions;
|
||||
//[] call blck_fnc_missionGroupMonitor;
|
||||
if (_modType isEqualTo "Epoch") then
|
||||
{
|
||||
[] call blck_fnc_cleanEmptyGroups;
|
||||
}; // Exile cleans up empty groups automatically so this should not be needed with that mod.
|
||||
};
|
||||
if (blck_useTimeAcceleration) then
|
||||
{
|
||||
if (diag_tickTime - _timer5min > 30) then {
|
||||
[] call blck_fnc_timeAcceleration;
|
||||
_timer5min = diag_tickTime;
|
||||
};
|
||||
};
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
Check if an HC is connected and if so transfer some AI to it.
|
||||
By Ghostrider-DbD-
|
||||
Last modified 11-8-16
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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 _hc = missionNamespace getVariable["HC1","null"];
|
||||
diag_log format["monitorHC::->> _hc = %1",_hc];
|
||||
if !( (typeName _hc isEqualTo "OBJECT" || _hc isEqualTo "null") ) exitWith {};
|
||||
|
||||
if (typeOf _hc isEqualTo "HeadlessClient_F") then // a valid headless client is connected
|
||||
{
|
||||
private _hcOwner = owner _hc;
|
||||
private _xfered = 0;
|
||||
{
|
||||
if (!(isPlayer _x) && (groupOwner _x != _hcOwner) ) then {
|
||||
_x setGroupOwner (_hcOwner);
|
||||
_xfered = +1;
|
||||
diag_log format["monitorHC::-->> group %1 transfered to HC1",_x];
|
||||
};
|
||||
if (_xfered isEqualTo 6) exitWith {};
|
||||
}forEach allGroups;
|
||||
};
|
@ -0,0 +1,42 @@
|
||||
//////////////////////////////////////////////////////
|
||||
// Test whether one object (e.g., a player) is within a certain range of any of an array of other objects
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 2/24/17
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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 ["_result","_players"];
|
||||
params["_pos","_dist",["_onFootOnly",false]];
|
||||
_players = call blck_fnc_allPlayers;
|
||||
_result = false;
|
||||
|
||||
//diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result];
|
||||
if !(_onFootOnly) then
|
||||
{
|
||||
{
|
||||
//diag_log format["_fnc_playerInRange:: !_onFootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance _x];
|
||||
if ((_x distance2D _pos) < _dist) exitWith {_result = true;};
|
||||
} forEach _players;
|
||||
};
|
||||
|
||||
if (_onFootOnly) then
|
||||
{
|
||||
{
|
||||
//diag_log format["_fnc_playerInRange:: onfootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance2d _x];
|
||||
if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;};
|
||||
} forEach _players;
|
||||
};
|
||||
//diag_log format["_fnc_playerInRange:: returning with _result = %1",_result];
|
||||
_result
|
@ -0,0 +1,29 @@
|
||||
//////////////////////////////////////////////////////
|
||||
// Test whether one object (e.g., a player) is within a certain range of any of an array of other objects
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 2/24/17
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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 ["_result"];
|
||||
params["_locations","_dist",["_onFootOnly",false]];
|
||||
//diag_log format["_fnc_playerInRangeArray: _locations = %1 | _dist = %2 | _onFootOnly = %3",_locations,_dist, _onFootOnly];
|
||||
_result = false;
|
||||
{
|
||||
_result = [_x,_dist,_onFootOnly] call blck_fnc_playerInRange;
|
||||
if (_result) exitWith {};
|
||||
} forEach _locations;
|
||||
//diag_log format["_fnc_playerInRangeArray: _locations = %1 |_return = %2",_result];
|
||||
_result
|
@ -0,0 +1,30 @@
|
||||
//////////////////////////////////////////////
|
||||
// returns a position array at random position within a radius of _range relative to _pos.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 8-13-16
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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["_newX","_newY"];
|
||||
params["_pos","_range"];
|
||||
|
||||
_signs = [1,-1];
|
||||
_sign = selectRandom _signs;
|
||||
|
||||
_newX = ((_pos select 0) + (random(_range)) * (selectRandom _signs));
|
||||
_newY = ((_pos select 1) + (random(_range)) * (selectRandom _signs));
|
||||
|
||||
[_newX,_newY,0]
|
||||
|
@ -0,0 +1,22 @@
|
||||
//////////////////////////////////////////////////////
|
||||
// test if a timeout condition exists.
|
||||
// by Ghostrider-DBD-
|
||||
// Last modified 1/22/17
|
||||
// [_startTime] call blck_fnc_timedOut
|
||||
// Returns true (timed out) or false (not timed out)
|
||||
/*
|
||||
--------------------------
|
||||
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["_startTime"];
|
||||
private["_return"];
|
||||
if ((diag_tickTime - _startTime) > blck_MissionTimout ) then {_return = true} else {_return = false};
|
||||
//diag_log format["fnc_timedOut:: blck_MissionTimout = %2 || _return = %1",_return,blck_MissionTimout];
|
||||
_return;
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 8-13-16
|
||||
|
||||
Waits for a random period between _min and _max seconds
|
||||
Call as
|
||||
[_minTime, _maxTime] call blck_fnc_waitTimer
|
||||
Returns true;
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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["_wait","_Tstart"];
|
||||
params["_min","_max"];
|
||||
|
||||
_wait = round( _min + (_max - _min) );
|
||||
uiSleep _wait;
|
||||
|
||||
true
|
@ -0,0 +1,12 @@
|
||||
/*
|
||||
Based on code by IT07 written for VEMF_r
|
||||
*/
|
||||
|
||||
private "_mod";
|
||||
|
||||
_mod = "";
|
||||
|
||||
if not ( isNull ( configFile >> "CfgPatches" >> "exile_server" ) ) then { _mod = "Exile" };
|
||||
if not ( isNull ( configFile >> "CfgPatches" >> "a3_epoch_server" ) ) then { _mod = "Epoch" };
|
||||
|
||||
_mod
|
@ -0,0 +1,93 @@
|
||||
// Changes type of waypont0 for the specified group to "MOVE" and updates time stamps, WP postion and Timout parameters accordinglyD.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/23/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";
|
||||
#ifdef blck_debugMode
|
||||
//diag_log "_fnc_changeToMoveWaypoint: blck_debugMode enabled";
|
||||
#endif
|
||||
private["_group","_wp","_wpPos","_dis","_arc","_dir","_newPos","_marker","_center","_minDis","_maxDis"];
|
||||
|
||||
_group = group _this;
|
||||
_group setcombatmode "YELLOW";
|
||||
_group setBehaviour "COMBAT";
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_wp = [_group, 0];
|
||||
_wpPos = getPos ((units _group) select 0);
|
||||
_dir = _group getVariable["wpDir",0];
|
||||
_center = _group getVariable ["patrolCenter",_wpPos];
|
||||
if (_group getVariable["wpMode","random"] isEqualTo "random") then
|
||||
{
|
||||
_dir = random(360);
|
||||
} else {
|
||||
_dir = (_group getVariable["wpDir",0]) + 70;
|
||||
_group setVariable["wpDir",_dir];
|
||||
};
|
||||
_minDis = _group getVariable["minDis",25];
|
||||
_maxDis = _group getVariable["maxDis",30];
|
||||
_dis = (_minDis) + random( (_maxDis) - (_minDis) );
|
||||
_newPos = (_center) getPos[_dis,_dir];
|
||||
_wp setWPPos [_newPos select 0, _newPos select 1];
|
||||
_wp setWaypointCompletionRadius (_group getVariable["wpRadius",30]);
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointName "move";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "YELLOW";
|
||||
_wp setWaypointTimeout [1,1.1,1.2];
|
||||
_group setCurrentWaypoint _wp;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_changeToMoveWaypoint (4/25/17): _this = %1", _this];
|
||||
diag_log format["_fnc_changeToMoveWaypoint: typeName _this = %1", typeName _this];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:_group = %1",_group];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:_group timestamp updated to %1", _group getVariable "timeStamp"];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:: -- >> wpMode %1 _dir %2 _dis %3 _center %4",_group getVariable["wpMode","random"], _dir, _dis,_center];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:: -- >> group to update is %1 and new position is %2",_group, _newPos];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:: -- >> group to update is %1 and new Waypoint position is %2",_group, getWPPos _wp];
|
||||
diag_log format["_fnc_changeToMoveWaypoint:_group %1 basic waypoint parameters updates", _group getVariable "timeStamp"];
|
||||
_marker =_group getVariable["wpMarker",""];
|
||||
_marker setMarkerColor "ColorBlue";
|
||||
diag_log format["_fnc_changeToMoveWaypoint:: -- >> Waypoint marker for group %1 have been configured as %2",_group, _group getVariable "wpMarker"];
|
||||
};
|
||||
#endif
|
||||
if (_group getVariable["wpPatrolMode",""] isEqualTo "SAD") then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_changeToMoveWaypoint: seting waypoint script for group %1 to SAD Mode",_group];
|
||||
};
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToSADWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a SAD Waypoint',group this];"];
|
||||
#else
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToSADWaypoint;"];
|
||||
#endif
|
||||
};
|
||||
if (_group getVariable["wpPatrolMode",""] isEqualTo "SENTRY") then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_changeToMoveWaypoint: seting waypoint script for group %1 to SENTRY Mode",_group];
|
||||
};
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToSentryWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a SENTRY Waypoint',group this];"];
|
||||
#else
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToSentryWaypoint;"];
|
||||
#endif
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_changeToMoveWaypoint:: -- >> Waypoint statements for group %1 have been configured as %2",_group, waypointStatements _wp];
|
||||
};
|
||||
#endif
|
@ -0,0 +1,52 @@
|
||||
// Sets the WP type for WP for the specified group and updates other atributes accordingly.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/29/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";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log "_fnc_changeToSADWaypoint: blck_debugMode enabled";
|
||||
#endif
|
||||
|
||||
private["_group","_wp"];
|
||||
|
||||
_group = group _this;
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_group setcombatmode "RED";
|
||||
_group setBehaviour "COMBAT";
|
||||
_wp = [_group, 0];
|
||||
_group setCurrentWaypoint _wp;
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointName "sad";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointTimeout [10,15,20];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a Move Waypoint',group this];"];
|
||||
#else
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint;"];
|
||||
#endif
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
private ["_marker"];
|
||||
_marker = _group getVariable["wpMarker",""];
|
||||
_marker setMarkerColor "ColorRed";
|
||||
diag_log format["_fnc_changeToSADWaypoint:: -- :: _this = %1 and typName _this %2",_this, typeName _this];
|
||||
diag_log format["_fnc_changeToSADWaypoint:: -- >> group to update is %1 with typeName %2",_group, typeName _group];
|
||||
diag_log format["_fnc_changeToSADWaypoint:: -- >> Waypoint statements for group %1 have been configured as %2",_group, waypointStatements _wp];
|
||||
diag_log format["_fnc_changeToSADWaypoint:: -- >> Waypoint marker for group %1 have been configured as %2",_group, _group getVariable "wpMarker"];
|
||||
};
|
||||
#endif
|
@ -0,0 +1,49 @@
|
||||
// Sets the WP type for WP for the specified group and updates other atributes accordingly.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/29/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";
|
||||
#ifdef blck_debugMode
|
||||
diag_log "_fnc_changeToSADWaypoint: blck_debugMode enabled";
|
||||
#endif
|
||||
private["_group","_wp"];
|
||||
|
||||
_group = group _this;
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_wp = [_group, 0];
|
||||
_group setCurrentWaypoint _wp;
|
||||
_group setcombatmode "RED";
|
||||
_group setBehaviour "COMBAT";
|
||||
_wp setWaypointType "SENTRY";
|
||||
_wp setWaypointName "sentry";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointTimeout [10,15,20];
|
||||
#ifdef blck_debugMode
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a Move Waypoint',group this];"];
|
||||
#else
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint;"];
|
||||
#endif
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel >1) then
|
||||
{
|
||||
diag_log format["_fnc_changeToSentryWaypoint:: -- :: _this = %1 and typName _this %2",_this, typeName _this];
|
||||
diag_log format["_fnc_changeToSentryWaypoint:: -- >> group to update is %1 with typeName %2",_group, typeName _group];
|
||||
private ["_marker"];
|
||||
_marker = _group getVariable["wpMarker",""];
|
||||
_marker setMarkerColor "ColorYellow";
|
||||
diag_log format["_fnc_changeToSentryWaypoint:: -- >> Waypoint statements for group %1 have been configured as %2",_group, waypointStatements _wp];
|
||||
diag_log format["_fnc_changeToSentryWaypoint:: -- >> Waypoint marker for group %1 have been configured as %2",_group, _group getVariable "wpMarker"];
|
||||
};
|
||||
#endif
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
call as [] call blck_fnc_cleanEmptyGroups;
|
||||
Deletes any empty groups and thereby prevents errors resulting from createGroup returning nullGroup.
|
||||
By Ghostrider-DbD-
|
||||
3/18/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";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format ["_fnc_cleanEmptyGroups:: -- >> group count = %1 ",(count allGroups)];
|
||||
diag_log format ["_fnc_cleanEmptyGroups:: -- >> Group count AI side = %1", call blck_fnc_groupsOnAISide];
|
||||
};
|
||||
#endif
|
||||
|
||||
private _grp = allGroups;
|
||||
{
|
||||
//diag_log format["_fnc_cleanEmptyGroups:: - >> type of object _x = %1",typeName _x];
|
||||
if ((count units _x) isEqualTo 0) then {deleteGroup _x};
|
||||
}forEach _grp;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log "_fnc_cleanEmptyGroups:: -- >> exiting function";};
|
||||
#endif
|
@ -0,0 +1,26 @@
|
||||
// Sets the WP type for WP for the specified group and updates other atributes accordingly.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/23/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["_group","_wp"];
|
||||
|
||||
diag_log format["_fnc_changeToSADWaypoint:: -- :: _this = %1 and typName _this %2",_this, typeName _this];
|
||||
_group = group _this;
|
||||
diag_log format["_fnc_emplacedWeaponWaypoint:: -- >> group to update is %1 with typeName %2",_group, typeName _group];
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_wp = [_group, 0];
|
||||
_group setCurrentWaypoint _wp;
|
||||
diag_log format["_fnc_emplacedWeaponWaypoint:: -- >> group to update is %1 waypoints updated at %2",_group, (_group getVariable["timeStamp",diag_tickTime])];
|
||||
|
@ -0,0 +1,203 @@
|
||||
/*
|
||||
[] call blck_fnc_waypointMonitor;
|
||||
|
||||
Scans all groups in for those that have been stuck in a particular waypoint for an excessive time and checks if they are in combat.
|
||||
If not it directs them to the next waypoint.
|
||||
It uses a timestamp attached to the group that is cleared upon waypoint completion.
|
||||
|
||||
By Ghostrider-DbD-
|
||||
Last modified 3/14/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_missionGroupMonitor (4/29:4:09 PM)::-->> running function at diag_tickTime = %1 with blck_fnc_missionGroupMonitor = %2",diag_tickTime,blck_monitoredMissionAIGroups];
|
||||
#ifdef blck_debugMode
|
||||
//diag_log format["_fnc_missionGroupMonitor:: blck_debugMode defined"];
|
||||
#endif
|
||||
_fn_allPlayers = {
|
||||
private ["_players"];
|
||||
_players = [];
|
||||
{
|
||||
if (isPlayer _x) then {_players pushback _x};
|
||||
}forEach playableUnits;
|
||||
//diag_log format["_fn_allPlayers::-->> result s %1",_players];
|
||||
_players
|
||||
};
|
||||
|
||||
_fn_aliveGroupUnits = {
|
||||
private["_grp","_aliveUnits"];
|
||||
_grp = _this select 0;
|
||||
_aliveUnits = [];
|
||||
{
|
||||
if ( alive _x) then {_aliveUnits pushback _x};
|
||||
} forEach (units _grp);
|
||||
_aliveUnits
|
||||
};
|
||||
|
||||
_fn_inCombat = {
|
||||
private["_grp","_targets","_players","_aliveUnits"];
|
||||
_grp = _this select 0;
|
||||
_players = [] call _fn_allPlayers;
|
||||
_aliveUnits = [_grp] call _fn_aliveGroupUnits;
|
||||
_inCombat = false;
|
||||
{
|
||||
_targets = _x findNearestEnemy (position _x);
|
||||
if !(isNull _targets) exitWith {_inCombat = true};
|
||||
} forEach _aliveUnits;
|
||||
//diag_log format["_fn_inCombat::-->> _grp to test is %1 and result is %2",_grp,_inCombat];
|
||||
_inCombat;
|
||||
};
|
||||
|
||||
_fn_removeEmptyOrNullGroups = {
|
||||
//diag_log format["_fn_removeEmptyOrNullGroups::-->> excuting function at %1",diag_tickTime];
|
||||
// Remove any null groups (which will occur if all units in the group are dead) or groups with no alive AI.
|
||||
for "_i" from 0 to ((count blck_monitoredMissionAIGroups) - 1) do
|
||||
{
|
||||
private["_grp"];
|
||||
if (_i >= (count blck_monitoredMissionAIGroups)) exitWith {};
|
||||
_grp = blck_monitoredMissionAIGroups select _i;
|
||||
if (_grp isEqualTo grpNull) then {
|
||||
blck_monitoredMissionAIGroups set[_i, -1];
|
||||
blck_monitoredMissionAIGroups = blck_monitoredMissionAIGroups - [-1];
|
||||
//diag_log "_fnc_waypointMonitor::-->> deleting a NULL-GROUP";
|
||||
};
|
||||
if ({alive _x} count units _grp < 1) then {
|
||||
blck_monitoredMissionAIGroups = blck_monitoredMissionAIGroups - [_grp];
|
||||
//diag_log "_fnc_waypointMonitor::-->> deleting an empty group";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_fn_monitorGroupWaypoints = {
|
||||
{
|
||||
private["_timeStamp","_index","_unit","_soldierType"];
|
||||
|
||||
_timeStamp = _x getVariable ["timeStamp",0];
|
||||
if (_timeStamp isEqualTo 0) then {
|
||||
_x setVariable["timeStamp",diag_tickTime];
|
||||
//diag_log format["_fn_monitorGroupWaypoints::--> updating timestamp for group %1 at time %2",_x,diag_tickTime];
|
||||
};
|
||||
_soldierType = _x getVariable["soldierType","null"];
|
||||
//diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp];
|
||||
|
||||
if (_soldierType isEqualTo "infantry") then
|
||||
{
|
||||
if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
||||
{
|
||||
_units = [_x] call _fn_aliveGroupUnits;
|
||||
if (count _units > 0) then
|
||||
{
|
||||
private _leader = leader _x;
|
||||
(_leader) call blck_fnc_changeToMoveWaypoint;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: infantry group %1 stuck, waypoint reset",_x];};
|
||||
#endif
|
||||
/*
|
||||
if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then
|
||||
{
|
||||
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
if (_soldierType isEqualTo "vehicle") then
|
||||
{
|
||||
if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
||||
{
|
||||
_units = [_x] call _fn_aliveGroupUnits;
|
||||
if (count _units > 0) then
|
||||
{
|
||||
private _leader = leader _x;
|
||||
(_leader) call blck_fnc_changeToMoveWaypoint;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: vehicle group %1 stuck, waypoint reset",_x];};
|
||||
#endif
|
||||
/*
|
||||
if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then
|
||||
{
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
if (_soldierType isEqualTo "helicopter") then
|
||||
{
|
||||
if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
||||
{
|
||||
_units = [_x] call _fn_aliveGroupUnits;
|
||||
if (count _units > 0) then
|
||||
{
|
||||
private _leader = leader _x;
|
||||
(_leader) call blck_fnc_changeToMoveWaypoint;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: helicopter group %1 stuck, waypoint reset",_x];};
|
||||
#endif
|
||||
/*
|
||||
if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then
|
||||
{
|
||||
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
} forEach blck_monitoredMissionAIGroups;
|
||||
};
|
||||
|
||||
_fn_simulationMonitor = {
|
||||
_modType = call blck_fnc_getModType;
|
||||
if (_modType isEqualTo "Exile") then
|
||||
{
|
||||
_playerType = ["Exile_Unit_Player"];
|
||||
}else{
|
||||
_playerType = ["Epoch_Male_F","Epoch_Female_F"];
|
||||
};
|
||||
{
|
||||
// player nearEntities [["Car", "Motorcycle", "Tank"], 50];
|
||||
_players = (leader _x) nearEntities [_playerType, 1800];
|
||||
if (count _players > 0) then
|
||||
{
|
||||
// Be sure simulation is on for all units in the group
|
||||
if !(_x getVariable["blck_simulationStatus",false]) then
|
||||
{
|
||||
_x setVariable["blck_simulationStatus",true];
|
||||
{
|
||||
_x enableSimulationGlobal true;
|
||||
}forEach (units _x);
|
||||
};
|
||||
}else{
|
||||
// Be sure simulation is off for all units in the group.
|
||||
if !(_x getVariable["blck_simulationStatus",true]) then
|
||||
{
|
||||
_x setVariable["blck_simulationStatus",false];
|
||||
{
|
||||
_x enableSimulationGlobal false;
|
||||
}forEach (units _x);
|
||||
};
|
||||
};
|
||||
} forEach blck_monitoredMissionAIGroups;
|
||||
};
|
||||
////////
|
||||
// Start of main function
|
||||
////////
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: executing function at %1",diag_tickTime];};
|
||||
#endif
|
||||
[] call _fn_removeEmptyOrNullGroups;
|
||||
uiSleep 0.1;
|
||||
[] call _fn_monitorGroupWaypoints;
|
||||
|
||||
#ifndef useDynamicSimulation
|
||||
[] call _fn_simulationMonitor;
|
||||
#endif
|
@ -0,0 +1,95 @@
|
||||
// Sets the WP type for WP for the specified group and updates other atributes accordingly.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 3/14/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["_group","_wp","_index","_pattern","_mode","_arc","_dis","_wpPos"];
|
||||
|
||||
_group = group _this;
|
||||
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_group setcombatmode "YELLOW";
|
||||
_group setBehaviour "COMBAT"
|
||||
_wp = [_group, 0];
|
||||
|
||||
_pattern = _group getVariable["wpPattern",[]];
|
||||
_index = _group getVariable["wpIndex",0];
|
||||
_index = _index + 1;
|
||||
_minDis = _group getVariable["minDis",0];
|
||||
_maxDis = _group getVariable["maxDis",0];
|
||||
dir = (_group getVariable["wpDir",0]) + _group getVariable["wpArc",360/5];
|
||||
_group setVariable["wpDir",_dir];
|
||||
|
||||
diag_log format["_fnc_setNextWaypoint: -> _minDis = %1 | _maxDis = %2 | _arc = %3",_minDis,_maxDis,_arc];
|
||||
if (_index >= (count _pattern)) then
|
||||
{
|
||||
_index = 0;
|
||||
} else {
|
||||
diag_log format["_fnc_setNextWaypoint: -> waypoint index for group %1 is currently %2 with _pattern = %4 and count _pattern = %3",_group,_index, count _pattern,_pattern];
|
||||
};
|
||||
|
||||
_group setVariable["wpIndex",_index];
|
||||
_type = _pattern select _index;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_setNextWaypoint: -> waypoint for group %1 to be updated to mode %2 at position %3 with index %4",_group,_type,waypointPosition _wp, _index];
|
||||
#endif
|
||||
|
||||
// revisit this to account for dead units. use waypointPosition if possible.
|
||||
_wpPos = waypointPosition _wp;
|
||||
|
||||
_wp setWaypointType _type;
|
||||
_wp setWaypointName toLower _type;
|
||||
if (_type isEqualTo (toLower "move")) then
|
||||
{
|
||||
_dis = (_minDis) + random( (_maxDis) - (_minDis) );
|
||||
if (_group getVariable["wpMode",""] isEqualTo "random") then
|
||||
{
|
||||
_dir = random(360)
|
||||
} else {
|
||||
_dir = _group getVariable["wpDir",0] + _group getVariable["wpArc",360/5];
|
||||
};
|
||||
_group setVariable["wpDir",_dir];
|
||||
_oldPos = waypointPosition _wp;
|
||||
|
||||
_newPos = (_group getVariable ["patrolCenter",_wpPos]) getPos[_dis,_arc];
|
||||
_wp setWPPos [_newPos select 0, _newPos select 1];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_setNextWaypoint: -- > for group %5 | _dis = %1 | _arc = %2 _oldPos = %3 | _newPos = %4",_dis,_arc,_oldPos,_newPos,_group];
|
||||
#endif
|
||||
|
||||
_wp setWaypointTimeout [1.0,1.1,1.2];
|
||||
//_wp setWaypointTimeout [20,25,30];
|
||||
} else {
|
||||
_wp setWaypointTimeout [20,25,30];
|
||||
_newPos = _wpPos;
|
||||
_wp setWPPos _newPos;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_setNextWaypoint: - waypoint position for group %1 not changed",_group];
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_setNextWaypoint: -> waypoint for group %1 set to mode %2 at position %3 with index %4",_group,_type,waypointPosition _wp, _index];
|
||||
diag_log format["_fnc_setNextWaypoint:-> waypoint statements for group %1 = %2",_group, waypointStatements [_group,_index]];
|
||||
#endif
|
||||
|
||||
_wp setWaypointBehaviour blck_groupBehavior;
|
||||
_wp setWaypointCombatMode blck_combatMode;
|
||||
_group setCurrentWaypoint _wp;
|
||||
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
// Sets up waypoints for a specified group.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 3/22/17
|
||||
** Here for record keeping only; not used **
|
||||
--------------------------
|
||||
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["_dir","_arc","_noWp","_newpos","_wpradius","_wp"];
|
||||
params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]];
|
||||
|
||||
/*
|
||||
_pos = _this select 0; // center of the patrol area
|
||||
_minDis = _this select 1; // minimum distance from the center of a patrol area for waypoints
|
||||
_maxDis = _this select 2; // maximum distance from the center of a patrol area for waypoints
|
||||
_group = _this select 3;
|
||||
*/
|
||||
|
||||
|
||||
_group setVariable["patrolCenter",_pos];
|
||||
_group setVariable["minDis",_minDis];
|
||||
_group setVariable["maxDis",_maxDis];
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_group setVariable["arc",0];
|
||||
_group setVariable["wpRadius",30];
|
||||
_group setVariable["wpMode",_mode];
|
||||
_group setVariable["wpPattern",_pattern];
|
||||
_group setVariable["wpIndex",0];
|
||||
|
||||
_dir = 0;
|
||||
_arc = 30;
|
||||
_noWp = 1;
|
||||
_wpradius = 30;
|
||||
_newPos = _pos getPos [(_minDis+(random (_maxDis - _minDis))), _dir];
|
||||
_wp = [_group, 0];
|
||||
|
||||
#ifdef wpModeMove
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointName "move";
|
||||
_wp setWaypointTimeout [1,1.1,1.2];
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_setNextWaypoint;diag_log format['====Updating waypoint to for group %1',group this];"];
|
||||
#else
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointName "sad";
|
||||
_wp setWaypointTimeout [20,25,30];
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_setNextWaypoint;diag_log format['====Updating waypointfor group %1',group this];"];
|
||||
#endif
|
||||
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
//_wp setWaypointTimeout [1,1.1,1.2];
|
||||
_group setCurrentWaypoint _wp;
|
||||
|
||||
/*
|
||||
Code for Build 44 as a referemce/
|
||||
private["_dist","_dir","_arc","_xpos","_ypos","_newpos","_wpradius","_wpnum","_oldpos"];
|
||||
params["_pos","_minDis","_maxDis","_group"];
|
||||
|
||||
_wpradius = 30;
|
||||
_wpnum = 6;
|
||||
_dir = random 360;
|
||||
_arc = 360/_wpnum;
|
||||
|
||||
for "_i" from 0 to (_wpnum - 1) do
|
||||
{
|
||||
_dir = _dir + _arc;
|
||||
_dist = (_minDis+(random (_maxDis - _minDis)));
|
||||
_newpos = _pos getPos [_dist, _arc];
|
||||
|
||||
_wp = _group addWaypoint [_newpos, 0];
|
||||
_wp setWaypointTimeout [1, 1.1, 1.2];
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointName "move";
|
||||
_wp = _group addWaypoint [_newpos, 0];
|
||||
_wp setWaypointTimeout [15,20,25];
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointName "sad";
|
||||
};
|
||||
deleteWaypoint [_group, 0];
|
||||
_group setVariable["wpIndex",0];
|
||||
_wp = _group addWaypoint [_newpos, _wpradius];
|
||||
_wp setWaypointType "CYCLE";
|
@ -0,0 +1,92 @@
|
||||
// Sets up waypoints for a specified group.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 3/17/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["_dir","_arc","_noWp","_newpos","_wpradius","_wp"];
|
||||
params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_patrolMode","SAD"]];
|
||||
|
||||
/*
|
||||
_pos = _this select 0; // center of the patrol area
|
||||
_minDis = _this select 1; // minimum distance from the center of a patrol area for waypoints
|
||||
_maxDis = _this select 2; // maximum distance from the center of a patrol area for waypoints
|
||||
_group = _this select 3;
|
||||
*/
|
||||
|
||||
|
||||
_group setVariable["patrolCenter",_pos];
|
||||
_group setVariable["minDis",_minDis];
|
||||
_group setVariable["maxDis",_maxDis];
|
||||
_group setVariable["timeStamp",diag_tickTime];
|
||||
_group setVariable["arc",0];
|
||||
_group setVariable["wpRadius",30];
|
||||
_group setVariable["wpMode",_mode];
|
||||
|
||||
_dir = 0;
|
||||
_arc = 30;
|
||||
_noWp = 1;
|
||||
_wpradius = 30;
|
||||
_newPos = _pos getPos [(_minDis+(random (_maxDis - _minDis))), _dir];
|
||||
_wp = [_group, 0];
|
||||
|
||||
#ifdef wpModeMove
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointName "move";
|
||||
_wp setWaypointTimeout [1,1.1,1.2];
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToSADWaypoint;diag_log format['====Updating waypoint to SAD for group %1',group this];"];
|
||||
#else
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointName "sad";
|
||||
_wp setWaypointTimeout [20,25,30];
|
||||
_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint;diag_log format['====Updating waypoint to Move for group %1',group this];"];
|
||||
#endif
|
||||
|
||||
_wp setWaypointBehaviour blck_groupBehavior;
|
||||
_wp setWaypointCombatMode blck_combatMode;
|
||||
_group setCurrentWaypoint _wp;
|
||||
|
||||
/*
|
||||
Code for Build 44 as a referemce/
|
||||
private["_dist","_dir","_arc","_xpos","_ypos","_newpos","_wpradius","_wpnum","_oldpos"];
|
||||
params["_pos","_minDis","_maxDis","_group"];
|
||||
|
||||
_wpradius = 30;
|
||||
_wpnum = 6;
|
||||
_dir = random 360;
|
||||
_arc = 360/_wpnum;
|
||||
|
||||
for "_i" from 0 to (_wpnum - 1) do
|
||||
{
|
||||
_dir = _dir + _arc;
|
||||
_dist = (_minDis+(random (_maxDis - _minDis)));
|
||||
_newpos = _pos getPos [_dist, _arc];
|
||||
|
||||
_wp = _group addWaypoint [_newpos, 0];
|
||||
_wp setWaypointTimeout [1, 1.1, 1.2];
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointName "move";
|
||||
_wp = _group addWaypoint [_newpos, 0];
|
||||
_wp setWaypointTimeout [15,20,25];
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
_wp setWaypointName "sad";
|
||||
};
|
||||
deleteWaypoint [_group, 0];
|
||||
_group setVariable["wpIndex",0];
|
||||
_wp = _group addWaypoint [_newpos, _wpradius];
|
||||
_wp setWaypointType "CYCLE";
|
@ -0,0 +1,117 @@
|
||||
/*
|
||||
Spawn and configure a group
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/25/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["_numbertospawn","_groupSpawned","_safepos","_weaponList","_useLauncher","_launcherType"];
|
||||
|
||||
params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ];
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["[blckeagls] _fnc_spawnGroup called parameters: _numai1 %1, _numbai2 %2, _skillLevel %3, _center %4",_numai1,_numai2,_skillLevel,_center];
|
||||
};
|
||||
//Spawns correct number of AI
|
||||
if (_numai2 > _numai1) then
|
||||
{
|
||||
_numbertospawn = floor( (random (_numai2 - _numai1) + _numai1 ) );
|
||||
} else {
|
||||
_numbertospawn = _numai2;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
|
||||
};
|
||||
#endif
|
||||
|
||||
_groupSpawned = createGroup blck_AI_Side;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["spawnGroup.sqf: _groupSpawned = %1",_groupSpawned];
|
||||
};
|
||||
#endif
|
||||
if !(isNull _groupSpawned) then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnGroup:: -- >> Group created = %1",_groupSpawned]};
|
||||
#endif
|
||||
_groupSpawned setVariable["groupVehicle",objNull];
|
||||
|
||||
#ifdef useDynamicSimulation
|
||||
_groupSpawned enableDynamicSimulation true;
|
||||
#endif
|
||||
|
||||
_groupSpawned setcombatmode "RED";
|
||||
_groupSpawned setBehaviour "COMBAT";
|
||||
_groupSpawned allowfleeing 0;
|
||||
_groupSpawned setspeedmode "FULL";
|
||||
_groupSpawned setFormation blck_groupFormation;
|
||||
_groupSpawned setVariable ["blck_group",true];
|
||||
|
||||
//diag_log format["spawnGroup:: group is %1",_groupSpawned];
|
||||
// Determines whether or not the group has launchers
|
||||
_useLauncher = blck_useLaunchers;
|
||||
|
||||
// define weapons list for the group
|
||||
switch (_skillLevel) do {
|
||||
case "blue": {_weaponList = blck_WeaponList_Blue;};
|
||||
case "red": {_weaponList = blck_WeaponList_Red;};
|
||||
case "green": {_weaponList = blck_WeaponList_Green;};
|
||||
case "orange": {_weaponList = blck_WeaponList_Orange;};
|
||||
default {_weaponList = blck_WeaponList_Blue;};
|
||||
};
|
||||
|
||||
|
||||
//Spawns the correct number of AI Groups, each with the correct number of units
|
||||
//Counter variable
|
||||
_i = 0;
|
||||
while {_i < _numbertospawn} do {
|
||||
_i = _i + 1;
|
||||
if (blck_useLaunchers && _i <= blck_launchersPerGroup) then
|
||||
{
|
||||
_launcherType = selectRandom blck_launcherTypes;
|
||||
} else {
|
||||
_launcherType = "none";
|
||||
};
|
||||
|
||||
//Finds a safe positon to spawn the AI in the area given
|
||||
_safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos;
|
||||
|
||||
//Spawns the AI unit
|
||||
//diag_log format["spawnGroup:: spawning unit #%1",_i];
|
||||
// params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]];
|
||||
[_safepos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
|
||||
};
|
||||
_groupSpawned selectLeader (units _groupSpawned select 0);
|
||||
// params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]];
|
||||
if (_configureWaypoints) then
|
||||
{
|
||||
[_pos,_minDist,_maxDist,_groupSpawned,"random","SAD","infantry"] spawn blck_fnc_setupWaypoints;
|
||||
};
|
||||
//[_pos,_minDist,_maxDist,_groupSpawned,"random","SENTRY"] spawn blck_fnc_setupWaypoints;
|
||||
//diag_log format["_fnc_spawnGroup: blck_fnc_setupWaypoints called for group %1",_groupSpawned];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["fnc_spawnGroup:: Group spawned was %1 with units of %2",_groupSpawned, units _groupSpawned];
|
||||
};
|
||||
#endif
|
||||
|
||||
} else {
|
||||
diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED";
|
||||
};
|
||||
_groupSpawned
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Depends on blck_fnc_addItemToCrate
|
||||
|
||||
call as:
|
||||
|
||||
[_item,_crate] call blck_fnc_loadLootFromItemsArray;
|
||||
|
||||
where
|
||||
_crate is a container such as ammo box or vehicle
|
||||
_loadout is an array containing either 2 or 3 elements. The first array is always an array of items to add. Items can be formated as ["item1","item1"], as [["item1",3],["item2",2]] or as [["item1",2,4],["item2",3,5]].
|
||||
See GMS_fnc_addItemToCrate for information about the acceptable formates for the items "item1" ... "itemN".
|
||||
|
||||
The second and optional third element in the array specify the number of times the script will randomly select an item from the array of items and load it into the crate.
|
||||
For example:
|
||||
case 1: [["item1",...,"itemN"],6]; The script will randomly select from the array of item names 6 times and call the loot loader each time.
|
||||
case 2: [["item1",...,"itemN"],6, 9]; As above except that an item will be selected a minimum of 6 and maximum of 9 times.
|
||||
|
||||
by Ghostrider-DbD-
|
||||
11/14/16
|
||||
|
||||
--------------------------
|
||||
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["_loadout","_crate",["_addAmmo",0]];
|
||||
if ((_loadout select 0) isEqualTo []) exitWith {};
|
||||
{
|
||||
private["_tries","_q","_item"];
|
||||
_tries = 0;
|
||||
//diag_log format["_fn_loadLoot:: -- >> now loading for %1",_x];
|
||||
_q = _x select 1; // this can be a number or array.
|
||||
if ( (typeName _q) isEqualTo "ARRAY") then // Assume the array contains a min/max number to add
|
||||
{
|
||||
if ((count _q) isEqualTo 2) then {_tries = (_q select 0) + round(random(((_q select 1) - (_q select 0))));} else {_tries = 0;};
|
||||
};
|
||||
if ((typeName _q) isEqualTo "SCALAR") then
|
||||
{
|
||||
_tries = _q;
|
||||
};
|
||||
for "_i" from 1 to _tries do
|
||||
{
|
||||
_item = selectRandom (_x select 0);
|
||||
[_item,_crate,_addAmmo] call blck_fnc_addItemToCrate;
|
||||
};
|
||||
}forEach _loadout;
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
[_item,_crate] call blck_addItemToCrate;
|
||||
where
|
||||
_crate is a container such as ammo box or vehicle
|
||||
_item is a string or array.
|
||||
If _item is a string then add 1 of that item to the container.
|
||||
If _item is an array with 2 elements ["itemName",3] then assume that the first element is a string and is the name of the item, and the second is the number to add.
|
||||
if _item is an array with 3 elements ["itemName",2,6] assume that the first element is the item name (string), the second the min # to add and the third the max # to add.
|
||||
by Ghostrider-DbD-
|
||||
11/14/16
|
||||
|
||||
--------------------------
|
||||
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["_itemInfo","_crate",["_addAmmo",0]];
|
||||
private["_isRifle","_isMagazine","_isBackpack"];
|
||||
_isWeapon = false;
|
||||
_isMagazine = false;
|
||||
_isBackpack = false;
|
||||
_quant = 0;
|
||||
//diag_log format["_fn_addItemToCrate:: -- >> itemInfor = %1",_itemInfo];
|
||||
if (typeName _itemInfo isEqualTo "STRING") then {_item = _itemInfo; _quant = 1}; // case where only the item descriptor was provided
|
||||
if (typeName _itemInfo isEqualTo "ARRAY") then {
|
||||
|
||||
if (count _itemInfo isEqualTo 2) then {_item = _itemInfo select 0; _quant = _itemInfo select 1;}; // case where item descriptor and quantity were provided
|
||||
if (count _itemInfo isEqualto 3) then {
|
||||
_item = _itemInfo select 0;
|
||||
_quant = (_itemInfo select 1) + round(random((_itemInfo select 2) - (_itemInfo select 1)));
|
||||
}; // case where item descriptor, min number and max number were provided.
|
||||
};
|
||||
if (((typeName _item) isEqualTo "STRING") && (_item != "")) then
|
||||
{
|
||||
if (isClass(configFile >> "CfgWeapons" >> _item)) then {
|
||||
_crate addWeaponCargoGlobal [_item,_quant];
|
||||
_isWeapon = true;
|
||||
_count = 0;
|
||||
if (typeName _addAmmo isEqualTo "SCALAR") then
|
||||
{
|
||||
_count = _addAmmo;
|
||||
};
|
||||
if (typeName _addAmmo isEqualto "ARRAY") then
|
||||
{
|
||||
_count = (_addAmmo select 0) + (round(random((_addAmmo select 1) - (_addAmmo select 0))));
|
||||
};
|
||||
_ammo = getArray (configFile >> "CfgWeapons" >> _item >> "magazines");
|
||||
for "_i" from 1 to _count do
|
||||
{
|
||||
_crate addMagazineCargoGlobal [selectRandom _ammo,1];
|
||||
};
|
||||
};
|
||||
if (_item isKindOf ["Bag_Base", configFile >> "CfgVehicles"]) then {_crate addBackpackCargoGlobal [_item,_quant]; _isBackpack = true;};
|
||||
if (isClass(configFile >> "CfgMagazines" >> _item)) then {_crate addMagazineCargoGlobal [_item,_quant]; _isMagazine = true;};
|
||||
if (!_isWeapon && !_isMagazine && _isBackpack && isClass(configFile >> "CfgVehicles" >> _item)) then {_crate addItemCargoGlobal [_item,_quant]};
|
||||
};
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Adds a list of live AI associated with a mission to a que of live AI that will be deleted at a later time by the main thread
|
||||
call as [ [list of AI], time] call blck_fnc_addLiveAItoQue; where time is the time delay before deletion occurs
|
||||
|
||||
by Ghostrider-DbD-
|
||||
Last modified 3-13-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_addLiveAIToQue:: -> when called, blck_liveMissionAI = %1",blck_liveMissionAI];
|
||||
params["_aiList","_timeDelay"];
|
||||
//diag_log format["_fnc_addLiveAIToQue:: -->> _aiList = %1 || _timeDelay = %2",_aiList,_timeDelay];
|
||||
blck_liveMissionAI pushback [_aiList, (diag_tickTime + _timeDelay)];
|
||||
//diag_log format["_fnc_addLiveAIToQue:: -> blck_fnc_addLiveAI updated to %1",blck_liveMissionAI];
|
||||
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
Adds the basic list of parameters that define a mission such as the marker name, mission list, mission path, AI difficulty, and timer settings, to the arrays that the main thread inspects.
|
||||
|
||||
by Ghostrider-DbD-
|
||||
Last modified 1-21-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 _mission = _this;
|
||||
//diag_log format["_fnc_addMissionToQue:: -- >> _mission - %1",_mission];
|
||||
// 0 1 2 3 4 5
|
||||
// [_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange,]
|
||||
params["_missionList","_path","_marker","_difficulty","_tMin","_tMax",["_noMissions",1],["_allowReinforcements",true]];
|
||||
|
||||
for "_i" from 1 to _noMissions do
|
||||
{
|
||||
private _waitTime = diag_tickTime + (_tMin) + random((_tMax) - (_tMin));
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
private _mission = [_missionList,_path,format["%1%2",_marker,_i],_difficulty,_tMin,_tMax,_waitTime,[0,0,0],_allowReinforcements];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["-fnc_addMissionToQue::-->> _mission = %1",_mission];};
|
||||
#endif
|
||||
|
||||
blck_pendingMissions pushback _mission;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_addMissionToQue:: -- >> Result - blck_pendingMissions = %1",blck_pendingMissions];};
|
||||
#endif
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Adds a list of live AI associated with a mission to a que of live AI that will be deleted at a later time by the main thread
|
||||
call as [ [list of AI], time] call blck_fnc_addLiveAItoQue; where time is the time delay before deletion occurs
|
||||
|
||||
by Ghostrider-DbD-
|
||||
Last modified 10-14-16
|
||||
|
||||
--------------------------
|
||||
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["_objList","_timeDelay"];
|
||||
//diag_log format["_fnc_addObjToQue:: -- >> _objList = %1 || _timeDelay = %2",_objList,_timeDelay];
|
||||
//diag_log format["_fnc_addObjToQue:: (11) -- >> blck_oldMissionObjects prior to update = %1",blck_oldMissionObjects];
|
||||
blck_oldMissionObjects pushback [_objList, (diag_tickTime + _timeDelay)];
|
||||
//diag_log format["_fnc_addObjToQue:: (11) -- >> blck_oldMissionObjects after update = %1",blck_oldMissionObjects];
|
||||
|
@ -0,0 +1,63 @@
|
||||
// Delete objects in a list after a certain time.
|
||||
// code to delete any smoking or on fire objects adapted from kalania
|
||||
//http://forums.bistudio.com/showthread.php?165184-Delete-Fire-Effect/page1
|
||||
// http://forums.bistudio.com/showthread.php?165184-Delete-Fire-Effect/page2
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 4-11-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";
|
||||
|
||||
_fn_deleteObjects = {
|
||||
params["_objects"];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fn_deleteObjects:: -> _objects = %1",_objects];};
|
||||
#endif
|
||||
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_cleanUpObjects: -> deleting object %1",_x];};
|
||||
#endif
|
||||
|
||||
deleteVehicle _x;
|
||||
} forEach _objects;
|
||||
};
|
||||
|
||||
//diag_log format["_fnc_cleanUpObjects called at %1",diag_tickTime];
|
||||
private["_oldObjs"];
|
||||
for "_i" from 1 to (count blck_oldMissionObjects) do
|
||||
{
|
||||
if (_i <= count blck_oldMissionObjects) then
|
||||
{
|
||||
_oldObjs = blck_oldMissionObjects select (_i - 1);
|
||||
//diag_log format["_fnc_cleanUpObjects ::-->> evaluating missionObjects = %1 with delete time of %3 and diag_tickTime %2",_oldObjs,diag_tickTime, _oldObjs select 1];
|
||||
if (diag_tickTime > (_oldObjs select 1) ) then {
|
||||
//diag_log format["_fn_deleteObjects:: (50) cleaning up mission objects %1",_oldObjs];
|
||||
[_oldObjs select 0] call _fn_deleteObjects;
|
||||
uiSleep 0.1;
|
||||
blck_oldMissionObjects set[(_i - 1), -1];
|
||||
blck_oldMissionObjects = blck_oldMissionObjects - [-1];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
//diag_log format["_fn_deleteObjects:: blck_oldMissionObjects updated from %1",_obj];
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fn_deleteObjects:: (48) blck_oldMissionObjects updated to %1",blck_oldMissionObjects];};
|
||||
#endif
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
// removes mines in a region centered around a specific position.
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 8-13-16
|
||||
|
||||
--------------------------
|
||||
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 ["_mines"];
|
||||
//_mines = _this select 0; // array containing the mines to be deleted
|
||||
//diag_log format["deleting %1 mines----- >>>> ", count _mines];
|
||||
{
|
||||
deleteVehicle _x;
|
||||
} forEach _mines;
|
||||
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
|
||||
[_mines,_objects,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission] call blck_fnc_endMission;
|
||||
schedules deletion of all remaining alive AI and mission objects.
|
||||
Updates the mission que.
|
||||
Updates mission markers.
|
||||
By Ghostrider-DbD-
|
||||
3/17/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["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_aborted",false],["_vehicles",[]]];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log format["_fnc_endMission: _blck_localMissionMarker %1 | _coords %2 | _mission %3 | _aborted %4",_blck_localMissionMarker,_coords,_mission,_aborted];
|
||||
diag_log format["_fnc_endMission: _aborted = %1",_aborted];
|
||||
};
|
||||
#endif
|
||||
|
||||
private["_cleanupAliveAITimer","_cleanupCompositionTimer"];
|
||||
if (blck_useSignalEnd && !_aborted) then
|
||||
{
|
||||
//diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
|
||||
[_crates select 0] spawn blck_fnc_signalEnd;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] _fnc_endMission:: (18) SignalEnd called: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
if (_aborted) then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log format["_fnc_endMission: Mission Aborted, setting all timers to 0"];
|
||||
};
|
||||
#endif
|
||||
|
||||
_cleanupCompositionTimer = 0;
|
||||
_cleanupAliveAITimer = 0;
|
||||
} else {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log format["_fnc_endMission: Mission Completed without errors, setting all timers to default values"];
|
||||
};
|
||||
#endif
|
||||
|
||||
_cleanupCompositionTimer = blck_cleanupCompositionTimer;
|
||||
_cleanupAliveAITimer = blck_AliveAICleanUpTimer;
|
||||
[["end",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
|
||||
[_blck_localMissionMarker select 1, _markerClass] execVM "debug\missionCompleteMarker.sqf";
|
||||
};
|
||||
|
||||
// Using a variable attached to the crate rather than the global setting to be sure we do not fill a crate twice.
|
||||
// the "lootLoaded" loaded should be set to true by the crate filler script so we can use that for our check.
|
||||
{
|
||||
//diag_log format["_fnc_endMission: for crate %1 lootLoaded = %2",_x,_x getVariable["lootLoaded",false]];
|
||||
if !(_x getVariable["lootLoaded",false]) then
|
||||
{
|
||||
// _crateLoot,_lootCounts are defined above and carry the loot table to be used and the number of items of each category to load
|
||||
[_x,_crateLoot,_lootCounts] call blck_fnc_fillBoxes;
|
||||
};
|
||||
}forEach _crates;
|
||||
{
|
||||
private ["_v","_posnVeh"];
|
||||
_posnVeh = blck_monitoredVehicles find _x; // returns -1 if the vehicle is not in the array else returns 0-(count blck_monitoredVehicles -1)
|
||||
if (_posnVeh >= 0) then
|
||||
{
|
||||
//diag_log format["_fnc_endMission: setting missionCompleted for vehicle %1 to %2",_x,diag_tickTime];
|
||||
(blck_monitoredVehicles select _posnVeh) setVariable ["missionCompleted", diag_tickTime];
|
||||
} else {
|
||||
_x setVariable ["missionCompleted", diag_tickTime];
|
||||
blck_monitoredVehicles pushback _x;
|
||||
};
|
||||
} forEach _vehicles;
|
||||
|
||||
[_mines] spawn blck_fnc_clearMines;
|
||||
//diag_log format["_fnc_endMission: (23) _objects = %1",_objects];
|
||||
[_objects, _cleanupCompositionTimer] spawn blck_fnc_addObjToQue;
|
||||
//diag_log format["_fnc_endMission:: (26) _blck_AllMissionAI = %1",_blck_AllMissionAI];
|
||||
[_blck_AllMissionAI, (_cleanupAliveAITimer)] spawn blck_fnc_addLiveAItoQue;
|
||||
[_blck_localMissionMarker select 0] execVM "debug\deleteMarker.sqf";
|
||||
blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords];
|
||||
blck_recentMissionCoords pushback [_coords,diag_tickTime];
|
||||
//diag_log format["_fnc_endMission:: (34) _mission = %1",_mission];
|
||||
[_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue;
|
||||
blck_missionsRunning = blck_missionsRunning - 1;
|
||||
|
||||
_aborted
|
@ -0,0 +1,94 @@
|
||||
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 11-11-16
|
||||
Fill a crate with items
|
||||
|
||||
--------------------------
|
||||
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["_a1","_item","_diff"];
|
||||
params["_crate","_boxLoot","_itemCnts"];
|
||||
|
||||
_itemCnts params["_wepCnt","_magCnt","_opticsCnt","_materialsCnt","_itemCnt","_bkcPckCnt"];
|
||||
|
||||
if (_wepCnt > 0) then
|
||||
{
|
||||
_a1 = _boxLoot select 0; // choose the subarray of weapons and corresponding magazines
|
||||
// Add some randomly selected weapons and corresponding magazines
|
||||
for "_i" from 1 to _wepCnt do {
|
||||
_item = selectRandom _a1;
|
||||
if (typeName _item isEqualTo "ARRAY") then // Check whether weapon name is part of an array that might also specify an ammo to use
|
||||
{
|
||||
_crate addWeaponCargoGlobal [_item select 0,1]; // if yes then assume the first element in the array is the weapon name
|
||||
if (count _item >1) then { // if the array has more than one element assume the second is the ammo to use.
|
||||
_crate addMagazineCargoGlobal [_item select 1, 1 + round(random(3))];
|
||||
} else { // if the array has only one element then lets load random ammo for it
|
||||
_crate addMagazineCargoGlobal [selectRandom (getArray (configFile >> "CfgWeapons" >> (_item select 0) >> "magazines")), 1 + round(random(3))];
|
||||
};
|
||||
} else {
|
||||
if (_item isKindOf ["Rifle", configFile >> "CfgWeapons"]) then
|
||||
{
|
||||
_crate addWeaponCargoGlobal [_item, 1];
|
||||
_crate addMagazineCargoGlobal [selectRandom (getArray (configFile >> "CfgWeapons" >> _item >> "magazines")), 1 + round(random(3))];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
if (_magCnt > 0) then
|
||||
{
|
||||
// Add Magazines, grenades, and 40mm GL shells
|
||||
_a1 = _boxLoot select 1;
|
||||
for "_i" from 1 to _magCnt do {
|
||||
_item = selectRandom _a1;
|
||||
_diff = (_item select 2) - (_item select 1); // Take difference between max and min number of items to load and randomize based on this value
|
||||
_crate addMagazineCargoGlobal [_item select 0, (_item select 1) + round(random(_diff))];
|
||||
};
|
||||
};
|
||||
if (_opticsCnt > 0) then
|
||||
{
|
||||
// Add Optics
|
||||
_a1 = _boxLoot select 2;
|
||||
for "_i" from 1 to _opticsCnt do {
|
||||
_item = selectRandom _a1;
|
||||
_diff = (_item select 2) - (_item select 1);
|
||||
_crate additemCargoGlobal [_item select 0, (_item select 1) + round(random(_diff))];
|
||||
};
|
||||
};
|
||||
if (_materialsCnt > 0) then
|
||||
{
|
||||
// Add materials (cindar, mortar, electrical parts etc)
|
||||
_a1 = _boxLoot select 3;
|
||||
for "_i" from 1 to _materialsCnt do {
|
||||
_item = selectRandom _a1;
|
||||
_diff = (_item select 2) - (_item select 1);
|
||||
_crate additemCargoGlobal [_item select 0, (_item select 1) + round(random(_diff))];
|
||||
};
|
||||
};
|
||||
if (_itemCnt > 0) then
|
||||
{
|
||||
// Add Items (first aid kits, multitool bits, vehicle repair kits, food and drinks)
|
||||
_a1 = _boxLoot select 4;
|
||||
for "_i" from 1 to _itemCnt do {
|
||||
_item = selectRandom _a1;
|
||||
_diff = (_item select 2) - (_item select 1);
|
||||
_crate additemCargoGlobal [_item select 0, (_item select 1) + round(random(_diff))];
|
||||
};
|
||||
};
|
||||
if (_bkcPckCnt > 0) then
|
||||
{
|
||||
_a1 = _boxLoot select 5;
|
||||
for "_i" from 1 to _bkcPckCnt do {
|
||||
_item = selectRandom _a1;
|
||||
_diff = (_item select 2) - (_item select 1);
|
||||
_crate addbackpackcargoGlobal [_item select 0, (_item select 1) + round(random(_diff))];
|
||||
};
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
// removes mines in a region centered around a specific position.
|
||||
/*
|
||||
[_missionAIGroups] call blck_fnc_missionAIareDead; // _missionAIGroups is an array of groups.
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 3-13-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 ["_missionAIGroups"];
|
||||
private["_allAIDead","_group"];
|
||||
|
||||
_allAIDead = true;
|
||||
|
||||
{
|
||||
_group = _x; // done for coding clarity only - actually less efficient this way
|
||||
if ( {alive _x) count (units _group) > 0 ) exitWith {_allAIDead = false};
|
||||
} forEach _missionAIGroups;
|
||||
|
||||
_allAIDead;
|
||||
|
@ -0,0 +1,433 @@
|
||||
/*
|
||||
Generic Mission Spawner
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/11/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 ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel"];
|
||||
params["_coords","_mission",["_allowReinforcements",true]];
|
||||
diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements];
|
||||
|
||||
////////
|
||||
// set all variables needed for the missions
|
||||
// data is pulled either from the mission description or from the _mission variable passsed as a parameter
|
||||
// Deal with situations where some of these variables might not be defined as well.
|
||||
////////
|
||||
|
||||
// _mission params[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange];
|
||||
_markerClass = _mission select 2;
|
||||
_aiDifficultyLevel = _mission select 3;
|
||||
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fnc_mainThread:: -->> _markerClass = %1",_markerClass];};
|
||||
|
||||
[_mission,"active",_coords] call blck_fnc_updateMissionQue;
|
||||
blck_ActiveMissionCoords pushback _coords;
|
||||
diag_log format["[blckeagls] missionSpawner (17):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
|
||||
private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot","_heliCrew","_loadCratesTiming"];
|
||||
|
||||
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
|
||||
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
|
||||
//if (isNil "_timeOut") then {_timeOut = -1;};
|
||||
if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn";
|
||||
|
||||
private["_useMines","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"];
|
||||
if (isNil "_useMines") then {_useMines = blck_useMines;};
|
||||
|
||||
_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
|
||||
{
|
||||
//diag_log "labeling map markers *****";
|
||||
_blck_localMissionMarker set [2, _markerMissionName];
|
||||
};
|
||||
if !(blck_preciseMapMarkers) then
|
||||
{
|
||||
//diag_log "Map marker will be OFFSET from the mission position";
|
||||
_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?
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";};
|
||||
[["start",_startMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
|
||||
[_blck_localMissionMarker] execVM "debug\spawnMarker.sqf";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (94) waiting for player to trigger the mission";};
|
||||
#endif
|
||||
////////
|
||||
// All parameters are defined, lets wait until a player is nearby or the mission has timed out
|
||||
////////
|
||||
|
||||
private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"];
|
||||
_missionStartTime = diag_tickTime;
|
||||
_playerInRange = false;
|
||||
_missionTimedOut = false;
|
||||
_wait = true;
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (105) starting mission trigger loop"};
|
||||
|
||||
while {_wait} do
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
//diag_log "missionSpawner:: top of mission trigger loop";
|
||||
if (blck_debugLevel > 2) exitWith {_playerInRange = true;};
|
||||
#endif
|
||||
|
||||
if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;};
|
||||
if ([_missionStartTime] call blck_fnc_timedOut) exitWith {_missionTimedOut = true;};
|
||||
uiSleep 5;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["missionSpawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords];
|
||||
diag_log format["missionSpawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers];
|
||||
diag_log format["missionSpawner:: Trigger Loop - timeout = %1", [_missionStartTime] call blck_fnc_timedOut];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
if (_missionTimedOut) exitWith
|
||||
{
|
||||
/*
|
||||
|
||||
*/
|
||||
// Deal with the case in which the mission timed out.
|
||||
//["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
|
||||
blck_recentMissionCoords pushback [_coords,diag_tickTime];
|
||||
blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords];
|
||||
[_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue;
|
||||
blck_missionsRunning = blck_missionsRunning - 1;
|
||||
[_blck_localMissionMarker select 0] call compile preprocessfilelinenumbers "debug\deleteMarker.sqf";
|
||||
//_blck_localMissionMarker set [1,[0,0,0]];
|
||||
//_blck_localMissionMarker set [2,""];
|
||||
[_objects, 0.1] spawn blck_fnc_cleanupObjects;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (105) Mission Timed Out: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
////////
|
||||
// Spawn the mission objects, loot chest, and AI
|
||||
////////
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (112) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (count _missionLootBoxes > 0) then
|
||||
{
|
||||
_crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates;
|
||||
}
|
||||
else
|
||||
{
|
||||
_crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming] call blck_fnc_spawnMissionCrates;
|
||||
|
||||
};
|
||||
|
||||
if (blck_cleanUpLootChests) then
|
||||
{
|
||||
_objects append _crates;
|
||||
};
|
||||
|
||||
//uisleep 2;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (136) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
private ["_temp"];
|
||||
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 = [];
|
||||
if (_missionLandscapeMode isEqualTo "random") then
|
||||
{
|
||||
_temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape;
|
||||
} else {
|
||||
_temp = [_coords, floor(random(360)),_missionLandscape,true] call blck_fnc_spawnCompositionObjects;
|
||||
//uiSleep 1;
|
||||
};
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_objects append _temp;
|
||||
};
|
||||
//diag_log format["_fnc_missionSpawner:: (181)->> _objects = %1",_objects];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (170) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
uiSleep _delayTime;;
|
||||
|
||||
_temp = [_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
|
||||
//uisleep 1;
|
||||
_crates append _temp;
|
||||
|
||||
uiSleep _delayTime;
|
||||
|
||||
_abort = false;
|
||||
_temp = [[],[],false];
|
||||
_temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI;
|
||||
//[_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {
|
||||
diag_log format["missionSpawner :: (185) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1;
|
||||
};
|
||||
|
||||
_abort = _temp select 1;
|
||||
if (blck_debugLevel > 2) then {
|
||||
diag_log format["missionSpawner :: (190) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1;
|
||||
};
|
||||
#endif
|
||||
|
||||
if (_abort) exitWith
|
||||
{
|
||||
if (blck_debugLevel > 1) then {
|
||||
diag_log "missionSpawner:: (194) grpNull returned, mission termination criteria met, calling blck_fnc_endMission"
|
||||
};
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true] 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] missionSpawner:: (202) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
_temp = [[],[],false];
|
||||
_abort = false;
|
||||
private["_patrolVehicles"];
|
||||
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
|
||||
{
|
||||
_temp = [_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols;
|
||||
//[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {
|
||||
diag_log format["missionSpawner :: (216) 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] missionSpawner:: (272) 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 "missionSpawner:: (222) grpNull returned, mission termination criteria met, calling blck_endMission";
|
||||
};
|
||||
#endif
|
||||
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true] call blck_fnc_endMission;
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
_temp = [[],[],false];
|
||||
_abort = false;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (234) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];};
|
||||
#endif
|
||||
|
||||
if (blck_useStatic && (_noEmplacedWeapons > 0)) then
|
||||
{
|
||||
// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
|
||||
_temp = [_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format ["missionSpawner:: (232) 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 ["missionSpawner:: (241) _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] missionSpawner:: (253) 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 "missionSpawner:: (261) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission";
|
||||
};
|
||||
#endif
|
||||
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true,_patrolVehicles] call blck_fnc_endMission;
|
||||
};
|
||||
|
||||
if (_allowReinforcements) then
|
||||
{
|
||||
_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout;
|
||||
temp = [];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (268) calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
//params["_coords","_aiSkillsLevel","_weapons","_uniforms","_headgear"];
|
||||
_temp = [_coords,_aiDifficultyLevel,_weaponList,_uniforms,_headGear] call blck_fnc_spawnMissionReinforcements;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["missionSpawner:: _temp = %1",_temp];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_abort = _temp select 2;
|
||||
_objects pushback (_temp select 0);
|
||||
_blck_AllMissionAI append (_temp select 1);
|
||||
};
|
||||
if (_abort) then
|
||||
{
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log "missionSpawner:: (276) grpNul or ERROR in blck_fnc_spawnMissionReinforcements, mission termination criteria met, calling blck_endMission";
|
||||
};
|
||||
#endif
|
||||
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true,_patrolVehicles] call blck_fnc_endMission;
|
||||
};
|
||||
};
|
||||
// Trigger for mission end
|
||||
//diag_log format["[blckeagls] mission Spawner _endCondition = %1",_endCondition];
|
||||
private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"];
|
||||
_missionComplete = -1;
|
||||
_startTime = diag_tickTime;
|
||||
|
||||
switch (_endCondition) do
|
||||
{
|
||||
case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;};
|
||||
case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;};
|
||||
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
|
||||
};
|
||||
//diag_log format["missionSpawner :: (269) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
private["_locations"];
|
||||
_locations = [_coords];
|
||||
{
|
||||
_locations pushback (getPos _x);
|
||||
} forEach _crates;
|
||||
|
||||
//diag_log format["missionSpawner:: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations];
|
||||
//diag_log format["missionSpawner:: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
while {_missionComplete isEqualTo -1} do
|
||||
{
|
||||
//if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 300};
|
||||
if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {};
|
||||
if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1 /*[_blck_AllMissionAI] call blck_fnc_missionAIareDead*/ ) exitWith {};
|
||||
//diag_log format["missionSpawner:: (283) missionCompleteLoop - > players near = %1 and ai alive = %2",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI];
|
||||
uiSleep 4;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (414) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
diag_log format["missionSpawner :: (415) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
};
|
||||
#endif
|
||||
//diag_log format["[blckeagls] missionSpawner:: (418) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
|
||||
private["_result"];
|
||||
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,false,_patrolVehicles] call blck_fnc_endMission;
|
||||
|
||||
//diag_log format["[blckeagls] missionSpawner:: (420)end of mission: blck_fnc_endMission returned value of %1","pending"];
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
[
|
||||
_missionColor // ["blue","red","green","orange"]
|
||||
] call blck_fnc_selectAILoadout;
|
||||
|
||||
returns:
|
||||
_lootarray
|
||||
by Ghostrider-DbD-
|
||||
1/9-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["_weaponList","_missionColor"];
|
||||
|
||||
_missionColor = _this select 0;
|
||||
switch (_missionColor) do {
|
||||
case "blue": {_weaponList = blck_WeaponList_Blue;};
|
||||
case "red": {_weaponList = blck_WeaponList_Red;};
|
||||
case "green": {_weaponList = blck_WeaponList_Green;};
|
||||
case "orange": {_weaponList = blck_WeaponList_Orange;};
|
||||
default {_weaponList = blck_WeaponList_Blue;};
|
||||
};
|
||||
_weaponList
|
@ -0,0 +1,49 @@
|
||||
//////////////////////////////////////////////////////
|
||||
// Attach a marker of type _marker to an object _crate
|
||||
// by Ghostrider-DBD- based on code from Wicked AI for Arma 2 Dayz Epoch
|
||||
// Last modified 8/2/15
|
||||
/////////////////////////////////////////////////////
|
||||
/*
|
||||
--------------------------
|
||||
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 ["_start","_bbr","_p1","_p2","_maxHeight","_signalCrate","_smokeShell","_light","_lightSource"];
|
||||
params["_crate",["_time",60]];
|
||||
_start = diag_tickTime;
|
||||
//diag_log format["signalEnd.sqf: _this = %1, _crate = %2",_this, _crate];
|
||||
_smokeShell = selectRandom ["SmokeShellOrange","SmokeShellBlue","SmokeShellPurple","SmokeShellRed","SmokeShellGreen","SmokeShellYellow"];
|
||||
_lightSource = selectRandom ["Chemlight_green","Chemlight_red","Chemlight_yellow","Chemlight_blue"];
|
||||
//diag_log format["signalEnd.sqf: _smokeShell = %1",_smokeShell];
|
||||
// Determine crate height. Method is from:
|
||||
// https://community.bistudio.com/wiki/boundingBoxReal
|
||||
_bbr = boundingBoxReal _crate;
|
||||
_p1 = _bbr select 0;
|
||||
_p2 = _bbr select 1;
|
||||
_maxHeight = abs ((_p2 select 2) - (_p1 select 2));
|
||||
|
||||
while {diag_tickTime - _start < (_time)} do // loop for 5 min accounting for the fact that smoke grenades do not last very long
|
||||
{
|
||||
_smoke = _smokeShell createVehicle getPosATL _crate;
|
||||
_smoke setPosATL (getPosATL _crate);
|
||||
_smoke attachTo [_crate,[0,0,(_maxHeight + 0.35)]]; // put the smoke a fixed distance above the top of any object to make it as visible as possible
|
||||
if(sunOrMoon < 0.2) then
|
||||
{
|
||||
_light = _lightSource createVehicle getPosATL _crate;
|
||||
_light setPosATL (getPosATL _crate);
|
||||
_light attachTo [_crate,[0,0,(_maxHeight + 0.35)]];
|
||||
};
|
||||
uiSleep 120;
|
||||
detach _smoke;
|
||||
deleteVehicle _smoke;
|
||||
if(sunOrMoon < 0.2) then
|
||||
{
|
||||
detach _light;
|
||||
deleteVehicle _light;
|
||||
};
|
||||
};
|
@ -0,0 +1,66 @@
|
||||
/*
|
||||
Spawns a smoking wreck or object at a specified location and returns the objects spawn (wreck and the particle effects object)
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 8-14-16
|
||||
|
||||
--------------------------
|
||||
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 ["_objs","_wreckSelected","_smokeType","_fire","_posFire","_posWreck","_smoke","_dis","_minDis","_maxDis","_closest","_wrecks"];
|
||||
|
||||
_objs = [];
|
||||
|
||||
// http://www.antihelios.de/EK/Arma/index.htm
|
||||
_wrecks = ["Land_Wreck_Car2_F","Land_Wreck_Car3_F","Land_Wreck_Car_F","Land_Wreck_Offroad2_F","Land_Wreck_Offroad_F","Land_Tyres_F","Land_Pallets_F","Land_MetalBarrel_F"];
|
||||
|
||||
params["_pos","_mode",["_maxDist",12],["_wreckChoices",_wrecks],["_addFire",false]];
|
||||
|
||||
_wreckSelected = selectRandom _wreckChoices;
|
||||
//_smokeTrail = "test_EmptyObjectForSmoke"; // "options are "test_EmptyObjectForFireBig", "test_EmptyObjectForSmoke"
|
||||
_smokeType = if(_addFire) then {"test_EmptyObjectForFireBig"} else {"test_EmptyObjectForSmoke"};
|
||||
|
||||
switch (_mode) do {
|
||||
case "none": {if (true) exitWith {};};
|
||||
case "center": {_minDis = 5; _maxDis = 15; _closest = 5;};
|
||||
case "random": {_minDis = 15; _maxDis = 50; _closest = 10;};
|
||||
default {_minDis = 5; _maxDis = 15; _closest = 5;};
|
||||
};
|
||||
_dis = 0;
|
||||
//_posWreck = [_pos, 0, 30, 10, 0, 20, 0] call BIS_fnc_findSafePos; // Position the wreck within 30 meters of the position and 5 meters away from the nearest object
|
||||
// _minDis and _maxDis determine the spacing between the smoking item and the loot crate.
|
||||
_minDis = 5; // Minimum distance of
|
||||
//_maxDis = 50;
|
||||
_closest = 10;
|
||||
|
||||
while {_dis < _maxDist} do
|
||||
{
|
||||
_posWreck = [_pos, _minDis, 50, _closest, 0, 20, 0] call BIS_fnc_findSafePos; // find a safe spot near the location passed in the call
|
||||
_dis = _posWreck distance _pos;
|
||||
};
|
||||
|
||||
// spawn a wreck near the mission center
|
||||
_fire = createVehicle [_wreckSelected, [0,0,0], [], 0, "can_collide"];
|
||||
_fire setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
|
||||
_fire setPos _posWreck;
|
||||
_fire setDir random(360);
|
||||
//https://community.bistudio.com/wiki/setVectorUp
|
||||
//_fire setVectorUp surfaceNormal position _fire;
|
||||
|
||||
|
||||
// spawn asmoke or fire source near the wreck and attach it.
|
||||
_smoke = createVehicle [_smokeType, [0,0,0], [], 0, "can_collide"]; // "test_EmptyObjectForSmoke" createVehicle _posFire;
|
||||
_smoke setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
|
||||
_smoke setPos _posWreck;
|
||||
_smoke attachto [_fire, [0,0,1]];
|
||||
|
||||
_objs = _objs + [_fire,_smoke];
|
||||
//diag_log format ["--smokeAtCrate.sqf:: _objs = %1",_objs];
|
||||
_objs
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
Spawn objects from an array using offsects from a central location.
|
||||
The code provided by M3Editor EDEN has been addapted to add checks for vehicles, should they be present.
|
||||
Returns an array of spawned objects.
|
||||
version of 1/13/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["_center","_azi","_objects","_setVector"];
|
||||
|
||||
private ["_newObjs"];
|
||||
|
||||
_newObjs = [];
|
||||
|
||||
{
|
||||
//diag_log format["_fnc_spawnBaseObjects::-->> _x = %1",_x];
|
||||
private _obj = (_x select 0) createVehicle [0,0,0];
|
||||
_newObjs pushback _obj;
|
||||
_obj setDir ( (_x select 2) + _azi);
|
||||
_obj setPosATL (_center vectorAdd (_x select 1));
|
||||
_obj enableSimulationGlobal true;
|
||||
_obj allowDamage true;
|
||||
// Lock any vehicles placed as part of the mission landscape. Note that vehicles that can be taken by players can be added via the mission template.
|
||||
if ( (typeOf _obj) isKindOf "LandVehicle" || (typeOf _obj) isKindOf "Air" || (typeOf _obj) isKindOf "Sea") then
|
||||
{
|
||||
[_obj] call blck_fnc_configureMissionVehicle;
|
||||
};
|
||||
} forEach _objects;
|
||||
_newObjs
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
spawn a crate at a specific location and protect it against cleanup by Epoch
|
||||
returns the object (crate) that was created.
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 9-4-16
|
||||
|
||||
--------------------------
|
||||
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 ["_crate","_px","_py","_defaultCrate"];
|
||||
_defaultCrate = "Box_NATO_Wps_F";
|
||||
params["_coords",["_crateType",_defaultCrate]];
|
||||
|
||||
_px = _coords select 0;
|
||||
_py = _coords select 1;
|
||||
|
||||
_crate = objNull;
|
||||
_crate = createVehicle [_crateType,_coords,[], 0, "CAN_COLLIDE"];
|
||||
_crate setVariable ["LAST_CHECK", 100000];
|
||||
_crate setPosATL [_px, _py, 0.5];
|
||||
_crate allowDamage false;
|
||||
_crate enableRopeAttach true;
|
||||
[_crate] call blck_fnc_emptyObject;
|
||||
_crate;
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
|
||||
[_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
|
||||
Last modified 4/27/17
|
||||
By Ghostrider-DbD-
|
||||
|
||||
--------------------------
|
||||
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 = [];
|
||||
_mode = "vector";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
//diag_log "_fnc_spawnEmplacedWeaponArray start";
|
||||
#endif
|
||||
|
||||
// Define _missionEmplacedWeapons if not already configured.
|
||||
if (_missionEmplacedWeapons isEqualTo []) then
|
||||
{
|
||||
_mode = "world";
|
||||
_missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray: creating random spawn locations: _missionEmplacedWeaponsPositions = %1", _missionEmplacedWeaponPositions];
|
||||
};
|
||||
#endif
|
||||
{
|
||||
_static = selectRandom blck_staticWeapons;
|
||||
//diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x];
|
||||
_missionEmplacedWeapons pushback [_static,_x];
|
||||
//diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons];
|
||||
} forEach _missionEmplacedWeaponPositions;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: starting static weapon spawner with _missionEmplacedWeapons = %1", _missionEmplacedWeapons];
|
||||
};
|
||||
#endif
|
||||
|
||||
{
|
||||
if (_mode isEqualTo "vector") then
|
||||
{
|
||||
_pos = _coords vectorAdd (_x select 1);
|
||||
} else {
|
||||
_pos = (_x select 1);
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray: _coords = %1 | offset = %2 | final _pos = 53",_coords,_x select 1, _pos];
|
||||
};
|
||||
#endif
|
||||
|
||||
// params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
|
||||
_empGroup = [(_x select 1),1,1,_aiDifficultyLevel,(_x select 1),1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup;
|
||||
|
||||
_empGroup setcombatmode "RED";
|
||||
_empGroup setBehaviour "COMBAT";
|
||||
[(_x select 1),0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints;
|
||||
if (isNull _empGroup) exitWith {_abort = _true};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: typeName _empGroup = %1 and _empGroup = %2 and _x = %3",typeName _empGroup, _empGroup,_x];
|
||||
};
|
||||
#endif
|
||||
|
||||
// params["_vehType","_pos",["_clearInventory",true]];
|
||||
_wep = [(_x select 0),[0,0,0],false] call blck_fnc_spawnVehicle;
|
||||
_empGroup setVariable["groupVehicle",_wep];
|
||||
_wep setVariable["vehicleGroup",_empGroup];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray (23) spawnVehicle returned value of _wep = %1",_wep];
|
||||
};
|
||||
#endif
|
||||
|
||||
_wep setVariable["DBD_vehType","emplaced"];
|
||||
_wep setPosATL _pos;
|
||||
[_wep,false] call blck_fnc_configureMissionVehicle;
|
||||
_emplacedWeps pushback _wep;
|
||||
_units = units _empGroup;
|
||||
_gunner = _units select 0;
|
||||
_gunner moveingunner _wep;
|
||||
_emplacedAI append _units;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: position of emplaced weapon = %1 and targetd position is %2",getPos _wep, _pos];
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: _gunner = %1 and crew _wep = %2",_gunner, crew _wep];
|
||||
};
|
||||
#endif
|
||||
|
||||
} forEach _missionEmplacedWeapons;
|
||||
blck_monitoredVehicles append _emplacedWeps;
|
||||
_return = [_emplacedWeps,_emplacedAI,_abort];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnEmplacedWeaponArray:: returning with _return = _emplacedWeps = %1",_return];
|
||||
};
|
||||
#endif
|
||||
|
||||
_return
|
@ -0,0 +1,46 @@
|
||||
// Spawns mines in a region centered around a specific position and returns an array with the spawned mines for later use, i.e. deletion
|
||||
/*
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 8-14-16
|
||||
|
||||
--------------------------
|
||||
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 ["_noMines","_mineTypes","_minesPlaced","_minDis","_maxDis","_closest","_radius","_xpos","_ypos","_dir","_incr","_i","_j","_posMine","_mine"];
|
||||
|
||||
params["_pos"];
|
||||
|
||||
_noMines = 50;
|
||||
_mineTypes = ["ATMine","SLAMDirectionalMine"];
|
||||
_minesPlaced = [];
|
||||
_minDis = 50;
|
||||
_maxDis = 150;
|
||||
_closest = 5;
|
||||
_dir = 0;
|
||||
_incr = 360/ (_noMines/2);
|
||||
for "_i" from 1 to _noMines/2 do
|
||||
{
|
||||
for "_j" from 1 to 2 do
|
||||
{
|
||||
_radius = _maxDis - floor(random(_maxDis - _minDis));
|
||||
_xpos = (_pos select 0) + sin (_dir) * _radius;
|
||||
_ypos = (_pos select 1) + cos (_dir) * _radius;
|
||||
_posMine = [_xpos,_ypos,0];
|
||||
//_posMine = [[_xpos,_ypos,0],0,10,_closest,0,20,0] call BIS_fnc_findSafePos; // find a random loc
|
||||
_mine = createMine ["ATMine", _posMine, [], 0];
|
||||
_mine setVariable ["LAST_CHECK", (diag_tickTime + 14400)];
|
||||
_mine setPos _posMine;
|
||||
//https://community.bistudio.com/wiki/setVectorUp
|
||||
_minesPlaced = _minesPlaced + [_mine];
|
||||
//diag_log format["[spawnMines.sqf] mine # %2 spawned at %1",_posMine,_i];
|
||||
};
|
||||
_dir = _dir + _incr;
|
||||
};
|
||||
_minesPlaced
|
@ -0,0 +1,222 @@
|
||||
/*
|
||||
blck_fnc_spawnMissionAI
|
||||
by Ghostrider-DbD-
|
||||
3/17/17
|
||||
[_coords, // center of the area within which to spawn AI
|
||||
_minNoAI, // minimum number of AI to spawn
|
||||
_maxNoAI, // Max number of AI to spawn
|
||||
_aiDifficultyLevel, // AI level [blue, red, etc]
|
||||
_uniforms, // Uniforms to use - note default is blck_sSkinList
|
||||
_headGear // headgear to use - blck_BanditHeager is the default
|
||||
] call blck_fnc_spawnMissionAI
|
||||
returns an array of the units spawned
|
||||
|
||||
--------------------------
|
||||
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]];
|
||||
private["_unitsToSpawn","_unitsPerGroup","_ResidualUnits","_newGroup","_blck_AllMissionAI","_abort"];
|
||||
_unitsToSpawn = round(_minNoAI + round(random(_maxNoAI - _minNoAI)));
|
||||
_unitsPerGroup = floor(_unitsToSpawn/_noAIGroups);
|
||||
_ResidualUnits = _unitsToSpawn - (_unitsPerGroup * _noAIGroups);
|
||||
_blck_AllMissionAI = [];
|
||||
_abort = false;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI (30):: _unitsToSpawn %1 ; _unitsPerGroup %2 _ResidualUnits %3",_unitsToSpawn,_unitsPerGroup,_ResidualUnits];
|
||||
};
|
||||
#endif
|
||||
|
||||
switch (_noAIGroups) do
|
||||
{
|
||||
case 1: { // spawn the group near the mission center
|
||||
|
||||
#ifdef blck_debugMode
|
||||
//params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ];
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1"];
|
||||
};
|
||||
#endif
|
||||
|
||||
_newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,25,30,_uniforms,_headGear,true] call blck_fnc_spawnGroup;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI (37):: case 1 - > _newGroup = %1",_newGroup];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_newAI = units _newGroup;
|
||||
blck_monitoredMissionAIGroups pushback _newGroup;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(41): Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
|
||||
};
|
||||
#endif
|
||||
|
||||
_blck_AllMissionAI append _newAI;
|
||||
|
||||
};
|
||||
};
|
||||
case 2: {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(47): Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area
|
||||
};
|
||||
#endif
|
||||
|
||||
_groupLocations = [_coords,_noAIGroups,15,30] call blck_fnc_findPositionsAlongARadius;
|
||||
{
|
||||
private["_adjusttedGroupSize"];
|
||||
if (_ResidualUnits > 0) then
|
||||
{
|
||||
_adjusttedGroupSize = _unitsPerGroup + _ResidualUnits;
|
||||
_ResidualUnits = 0;
|
||||
} else {
|
||||
_adjusttedGroupSize = _unitsPerGroup;
|
||||
};
|
||||
_newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,15,25,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_newAI = units _newGroup;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(61): case 2: _newGroup=%1",_newGroup];
|
||||
};
|
||||
#endif
|
||||
|
||||
_blck_AllMissionAI append _newAI;
|
||||
};
|
||||
}forEach _groupLocations;
|
||||
|
||||
};
|
||||
case 3: { // spawn one group near the center of the mission and the rest on the perimeter
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI (68): Spawning Groups: _noAIGroups=3"];
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,10,15,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_newAI = units _newGroup;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI (73): Case 3: _newGroup=%1",_newGroup];
|
||||
};
|
||||
#endif
|
||||
|
||||
_blck_AllMissionAI append _newAI;
|
||||
|
||||
_groupLocations = [_coords,2,20,35] call blck_fnc_findPositionsAlongARadius;
|
||||
{
|
||||
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_newAI = units _newGroup;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(78): Case 3: line 81: _newGroup = %1",_newGroup];
|
||||
};
|
||||
#endif
|
||||
|
||||
_blck_AllMissionAI append _newAI;
|
||||
};
|
||||
}forEach _groupLocations;
|
||||
};
|
||||
};
|
||||
default { // spawn one group near the center of the mission and the rest on the perimeter
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI (88): case 4:"];
|
||||
};
|
||||
#endif
|
||||
|
||||
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
};
|
||||
_newAI = units _newGroup;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(92): Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
|
||||
};
|
||||
#endif
|
||||
|
||||
_blck_AllMissionAI append _newAI;
|
||||
_groupLocations = [_coords,(_noAIGroups - 1),20,40] call blck_fnc_findPositionsAlongARadius;
|
||||
{
|
||||
_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
|
||||
if (isNull _newGroup) then
|
||||
{
|
||||
_abort = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_newAI = units _newGroup;
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(99): _newGroup=%1",_newGroup];
|
||||
};
|
||||
_blck_AllMissionAI append _newAI;
|
||||
};
|
||||
}forEach _groupLocations;
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionAI(133): _abort = %1 | _blck_AllMissionAI = %2",_abort,_blck_AllMissionAI];
|
||||
};
|
||||
#endif
|
||||
|
||||
private["_return"];
|
||||
_return = [_blck_AllMissionAI,_abort];
|
||||
_return
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
Spawn some crates using an array containing crate types and their offsets relative to a reference position and prevent their cleanup.
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 3-20-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 ["_objs","_pos","_offset"];
|
||||
params[ ["_coords", [0,0,0]], ["_crates",[]], ["_loadCrateTiming","atMissionSpawn"] ];
|
||||
|
||||
if ((count _coords) == 2) then // assume only X and Y offsets are provided
|
||||
{
|
||||
_coords pushback 0;; // calculate the world coordinates
|
||||
};
|
||||
_objs = [];
|
||||
{
|
||||
_x params["_crateType","_crateOffset","_lootArray","_lootCounts"];
|
||||
//_pos = [(_coords select 0)+(_crateOffset select 0),(_coords select 1) + (_crateOffset select 1),(_coords select 2)+(_crateOffset select 2)]; // calculate the world coordinates
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionCrates: _crateType = %1 | _crateOffset = %2 | _lootArray = %3 | _lootCounts = %4",_crateType,_crateOffset,_lootArray,_lootCounts];
|
||||
};
|
||||
#endif
|
||||
_pos = _coords vectorAdd _crateOffset;
|
||||
_crate = [_pos,_crateType] call blck_fnc_spawnCrate;
|
||||
_objs pushback _crate;
|
||||
if (_loadCrateTiming isEqualTo "atMissionSpawn") then
|
||||
{
|
||||
//diag_log format["_fnc_spawnMissionCrates::-> loading loot at mission spawn for crate %1",_x];
|
||||
[_crate,_lootArray,_lootCounts] call blck_fnc_fillBoxes;
|
||||
_crate setVariable["lootLoaded",true];
|
||||
}
|
||||
else
|
||||
{
|
||||
//diag_log format["_fnc_spawnMissionCrates::-> not loading crate loot at this time for crate %1",_x];
|
||||
};
|
||||
}forEach _crates;
|
||||
|
||||
_objs
|
@ -0,0 +1,75 @@
|
||||
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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","_grpPilot","_chanceLoot"];
|
||||
_chopperType = selectRandom blck_AIHelis;
|
||||
_grpPilot setVariable["groupVehicle",_chopperType];
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_missionSpawner:: _chopperType seleted = %1",_chopperType];
|
||||
#endif
|
||||
|
||||
_spawnVector = round(random(360));
|
||||
_spawnDistance = 1000; // + floor(random(1500)); // We need the heli to be on-site quickly to minimize the chance that a small mission has been completed before the paratroops are deployed and added to the list of live AI for the mission
|
||||
_dropLoot = (random(1) < _chanceLoot);
|
||||
|
||||
// Use the new functionality of getPos
|
||||
// https://community.bistudio.com/wiki/getPos
|
||||
_spawnPos = _coords getPos [_spawnDistance,_spawnVector];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_missionSpawner:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _coords of %4",_spawnVector,_spawnDistance,_spawnPos, (_coords distance2d _spawnPos)];
|
||||
#endif
|
||||
|
||||
_grpPilot setBehaviour "CARELESS";
|
||||
_grpPilot setCombatMode "RED";
|
||||
_grpPilot setSpeedMode "FULL";
|
||||
_grpPilot allowFleeing 0;
|
||||
|
||||
private["_supplyHeli"];
|
||||
//create helicopter and spawn it
|
||||
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
|
||||
blck_monitoredVehicles pushback _supplyHeli;
|
||||
[_supplyHeli] call blck_fnc_protectVehicle;
|
||||
_supplyHeli setVariable["vehicleGroup",_grpPilot];
|
||||
|
||||
_supplyHeli setDir (_spawnVector -180);
|
||||
_supplyHeli setFuel 1;
|
||||
_supplyHeli engineOn true;
|
||||
_supplyHeli flyInHeight 250;
|
||||
_supplyHeli setVehicleLock "LOCKED";
|
||||
_supplyHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
|
||||
|
||||
clearWeaponCargoGlobal _supplyHeli;
|
||||
clearMagazineCargoGlobal _supplyHeli;
|
||||
clearItemCargoGlobal _supplyHeli;
|
||||
clearBackpackCargoGlobal _supplyHeli;
|
||||
|
||||
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _supplyHeli, [], 0, "FORM"];
|
||||
_unitPilot setSkill 1;
|
||||
_unitPilot assignAsDriver _supplyHeli;
|
||||
_unitPilot moveInDriver _supplyHeli;
|
||||
_grpPilot selectLeader _unitPilot;
|
||||
_grpPilot setVariable["paraGroup",_paraGroup];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_missionSpawner:: heli spawned and pilot added"];
|
||||
#endif
|
||||
|
||||
//set waypoint for helicopter
|
||||
//params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ];
|
||||
[_coords,25,40,_grpPilot,"random","SAD","helicpoter"] spawn blck_fnc_setupWaypoints;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_missionSpawner:: initial pilot waypoints set"];
|
||||
#endif
|
||||
|
||||
_supplyHeli
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
[_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
|
||||
returns _vehs, an array of vehicles spawned.
|
||||
by Ghostridere-DbD-
|
||||
3/20/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["_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"]];
|
||||
private _vehs = [];
|
||||
{
|
||||
//diag_log format["spawnMissionCVehicles.sqf _x = %1",_x];
|
||||
_x params["_vehType","_vehOffset","_lootArray","_lootCounts"];
|
||||
//diag_log format["spawnMissionCVehicles: _vehType = %1 | _vehOffset = %2 | _lootArray = %3 | _lootCounts = %4",_vehType,_vehOffset,_lootArray,_lootCounts];
|
||||
_pos = _coords vectorAdd _vehOffset;
|
||||
_veh = [_vehType, _pos] call blck_fnc_spawnVehicle;
|
||||
[_veh] call blck_fnc_emptyObject;
|
||||
_veh setVehicleLock "UNLOCKED";
|
||||
{
|
||||
_veh removeAllEventHandlers _x;
|
||||
}forEach ["getin","getout"];
|
||||
if (_loadCrateTiming isEqualTo "atMissionSpawn") then
|
||||
{
|
||||
//diag_log format["blck_fnc_spawnMissionLootVehicles::-> loading loot at mission spawn for veh %1",_x];
|
||||
[_veh,_lootArray,_lootCounts] call blck_fnc_fillBoxes;
|
||||
_veh setVariable["lootLoaded",true];
|
||||
}
|
||||
else
|
||||
{
|
||||
//diag_log format["blck_fnc_spawnMissionLootVehicles::-> not loading veh loot at this time for veh %1",_x];
|
||||
};
|
||||
_vehs pushback _veh;
|
||||
}forEach _missionLootVehicles;
|
||||
_vehs
|
@ -0,0 +1,94 @@
|
||||
/*
|
||||
[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionVehiclePatrols
|
||||
by Ghostrider-DbD-
|
||||
3/17/17
|
||||
returns [] if no groups could be created
|
||||
returns [_AI_Vehicles,_missionAI] otherwise;
|
||||
|
||||
--------------------------
|
||||
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","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols:: _coords = %1 | _noVehiclePatrols = %2 | _aiDifficultyLevel = %3 | _missionType = %4",_coords,_noVehiclePatrols,_aiDifficultyLevel,_missionType];
|
||||
};
|
||||
#endif
|
||||
|
||||
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns","_missionAI","_missiongroups","_vehicles","_return","_vehiclePatrolSpawns","_randomVehicle","_return","_abort"];
|
||||
_vehicles = [];
|
||||
_missionAI = [];
|
||||
_abort = false;
|
||||
|
||||
_vehiclePatrolSpawns = [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
|
||||
|
||||
{
|
||||
private ["_spawnPos"];
|
||||
_spawnPos = _x;
|
||||
_vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup;
|
||||
if (isNull _vehGroup) exitWith
|
||||
{
|
||||
_abort = true;
|
||||
};
|
||||
if !(isNull _vehGroup) then
|
||||
{
|
||||
blck_monitoredMissionAIGroups pushBack _vehGroup;
|
||||
};
|
||||
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols: group spawned = %1",_vehGroup];
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols (40):: -> _missionType = %3 _vehGroup = %1 and units _vehGroup = %2",_vehGroup, units _vehGroup,_missionType];
|
||||
};
|
||||
#endif
|
||||
|
||||
_randomVehicle = selectRandom blck_AIPatrolVehicles;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols: _randomVehicle = %1",_randomVehicle];
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols:: -> randomly selected vehicle = %1",_randomVehicle];
|
||||
};
|
||||
#endif
|
||||
|
||||
//params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]];
|
||||
_patrolVehicle = [_coords,_spawnPos,_randomVehicle,35,45,_vehGroup] call blck_fnc_spawnVehiclePatrol;
|
||||
_vehGroup setVariable["groupVehicle",_randomVehicle];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols (65):: - > patrol vehicle spawned was %1",_patrolVehicle];
|
||||
};
|
||||
#endif
|
||||
|
||||
if !(isNull _patrolVehicle) then
|
||||
{
|
||||
_patrolVehicle setVariable["vehicleGroup",_vehGroup];
|
||||
_vehicles pushback _patrolVehicle;
|
||||
_missionAI append (units _vehGroup);
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionVehiclePatrols:: -- > _vehicles updated to %1",_vehicles];
|
||||
};
|
||||
#endif
|
||||
|
||||
} forEach _vehiclePatrolSpawns;
|
||||
|
||||
blck_monitoredVehicles append _vehicles;
|
||||
_return = [_vehicles, _missionAI, _abort];
|
||||
|
||||
_return
|
@ -0,0 +1,67 @@
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last modified 4/29/17
|
||||
checks the status of each entry in
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
--------------------------
|
||||
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";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log format["_fnc_spawnPendingMissions:: blck_pendingMissions = %1", blck_pendingMissions];
|
||||
};
|
||||
diag_log format["_fnc_spawnPendingMissions: -- >> blck_missionsRunning = %1",blck_missionsRunning];
|
||||
#endif
|
||||
|
||||
if (blck_missionsRunning >= blck_maxSpawnedMissions) exitWith {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log "_fnc_spawnPendingMissions:: --- >> Maximum number of missions is running; function exited without attempting to find a new mission to spawn";
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
private["_coords","_missionName","_missionPath","_search","_readyToSpawnQue","_missionToSpawn","_allowReinforcements"];
|
||||
_readyToSpawnQue = [];
|
||||
{
|
||||
if ( (diag_tickTime > (_x select 6)) && ((_x select 6) > 0) ) then
|
||||
{
|
||||
_readyToSpawnQue pushback _x;
|
||||
};
|
||||
} forEach blck_pendingMissions;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["_fnc_spawnPendingMissions:: --- >> _readyToSpawnQue = %1",_readyToSpawnQue];
|
||||
};
|
||||
#endif
|
||||
if (count _readyToSpawnQue > 0) then
|
||||
{
|
||||
_missionToSpawn = selectRandom _readyToSpawnQue;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["_fnc_spawnPendingMissions:: -- >> blck_missionsRunning = %1 and blck_maxSpawnedMissions = %2 so _canSpawn = %3",blck_missionsRunning,blck_maxSpawnedMissions, (blck_maxSpawnedMissions - blck_missionsRunning)];
|
||||
};
|
||||
#endif
|
||||
|
||||
_coords = [] call blck_fnc_FindSafePosn;
|
||||
_coords pushback 0;
|
||||
_missionName = selectRandom (_missionToSpawn select 0);
|
||||
_missionPath = _missionToSpawn select 1;
|
||||
_allowReinforcements = _missionToSpawn select 8;
|
||||
[_coords,_missionToSpawn,_allowReinforcements] execVM format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName];
|
||||
blck_missionsRunning = blck_missionsRunning + 1;
|
||||
};
|
||||
true
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
spawn a group of objects in random locations aligned with the radial from the center of the region to the object.
|
||||
By Ghostrider-DbD-
|
||||
Last modified 1/22/17
|
||||
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["_coords","_missionLandscape",["_min",3],["_max",15],["_nearest",1]];
|
||||
private["_objects"];
|
||||
_objects = [];
|
||||
|
||||
{
|
||||
//Random Position Objects based on distance in array
|
||||
// https://community.bistudio.com/wiki/BIS_fnc_findSafePos
|
||||
_pos = [_coords,_min,_max,_nearest,0,5,0] call BIS_fnc_findSafePos;
|
||||
_wreck = createVehicle[_x, _pos, [], 25, "NONE"];
|
||||
_wreck setVariable ["LAST_CHECK", (diag_tickTime + 100000)];
|
||||
|
||||
private["_dir","_dirOffset"];
|
||||
|
||||
_dirOffset = random(30) * ([1,-1] call BIS_fnc_selectRandom);
|
||||
_dir = _dirOffset +([_wreck,_coords] call BIS_fnc_dirTo);
|
||||
_wreck setDir _dir;
|
||||
_objects pushback _wreck;
|
||||
sleep 0.1;
|
||||
} forEach _missionLandscape;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnRandomLandscape::-->> _objects = %1",_objects];};
|
||||
#endif
|
||||
|
||||
_objects
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
Update the parameters for a mission in the list of missions running at that time.
|
||||
Call with the name of the marker associated with the mission and either "Active" or "Completed"
|
||||
by Ghostrider-DbD-
|
||||
Last modified 1-22-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","_status",["_coords",[0,0,0]] ];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fnc_updateMissionQue :: _mission = %1 | _status = %2 | _coords = %3",_mission,_status,_coords];};
|
||||
#endif
|
||||
|
||||
private["_index","_element","_waitTime"];
|
||||
|
||||
_index = blck_pendingMissions find _mission;
|
||||
if (_index > -1) then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debuglevel > 0) then {diag_log format ["_fnc_updateMissionQue :: blck_pendingMissions began as %1",blck_pendingMissions];};
|
||||
#endif
|
||||
|
||||
_element = blck_pendingMissions select _index;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debuglevel > 0) then {diag_log format["_fnc_updateMissionQue:: -- >> _element before update = %1",_element];};
|
||||
#endif
|
||||
|
||||
if (toLower(_status) isEqualTo "active") then {
|
||||
_element set[6, -1];
|
||||
_element set[7,_coords];
|
||||
};
|
||||
if (toLower(_status) isEqualTo "inactive") then
|
||||
{
|
||||
_waitTime = (_element select 4) + random((_element select 5) - (_element select 4));
|
||||
_element set[6, diag_tickTime + _waitTime];
|
||||
_element set [7,[0,0,0]];
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debuglevel > 0) then {diag_log format["_fnc_updateMissionQue:: -- >> _element after update = %1",_element];};
|
||||
#endif
|
||||
|
||||
blck_pendingMissions set [_index, _element];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debuglevel > 0) then {diag_log format ["_fnc_updateMissionQue :: blck_pendingMissions after update = %1",blck_pendingMissions];};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
Pulled from Arma
|
||||
version of 11/9/16
|
||||
*/
|
||||
|
||||
params["_center","_azi","_objs","_setVector"];
|
||||
|
||||
|
||||
private ["_newObjs"];
|
||||
|
||||
//If the object array is in a script, call it.
|
||||
//_objs = call (compile (preprocessFileLineNumbers _script));
|
||||
|
||||
_newObjs = [];
|
||||
|
||||
{
|
||||
private _object = (_x select 0) createVehicle [0,0,0];
|
||||
_newObjs pushback _object;
|
||||
_object setDir ( (_x select 2) + _azi);
|
||||
_object setPosATL (_center vectorAdd (_x select 1));
|
||||
_object enableSimulationGlobal true;
|
||||
_object allowDamage true;
|
||||
// Lock any vehicles placed as part of the mission landscape. Note that vehicles that can be taken by players can be added via the mission template.
|
||||
if ( (typeOf _object) isKindOf "LandVehicle" || (typeOf _object) isKindOf "Air" || (typeOf _object) isKindOf "Sea") then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["MAP ADDONS:: Locking vehicle of type %1",typeOf _object];
|
||||
#endif
|
||||
//_object = _x select 0;
|
||||
_object setVehicleLock "LOCKEDPLAYER";
|
||||
_object addEventHandler ["GetIn",{ // forces player to be ejected if he/she tries to enter the vehicle
|
||||
private ["_theUnit"];
|
||||
_theUnit = _this select 2;
|
||||
_theUnit action ["Eject", vehicle _theUnit];
|
||||
hint "Use of this vehicle is forbidden";
|
||||
}];
|
||||
|
||||
clearItemCargoGlobal _object;
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
clearBackpackCargoGlobal _object;
|
||||
};
|
||||
} forEach _objects;
|
||||
_newObjs
|
||||
|
||||
|
||||
_newObjs
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
Last Modified 1/23/17
|
||||
*/
|
||||
params["_grpPilot"];
|
||||
private["_heli","_pilot"];
|
||||
_pilot = (units _grpPilot) select 0;
|
||||
_heli = vehicle _pilot;
|
||||
diag_log "reinforcements deployed:: send heli back to spawn";
|
||||
[[_heli], 300 /* 5 min*/] spawn blck_fnc_addObjToQue;
|
||||
// select a random location abotu 2K from the mission
|
||||
_spawnVector = round(random(360));
|
||||
_spawnDistance = 2000;
|
||||
_pos = getPos _heli;
|
||||
|
||||
// Use the new functionality of getPos
|
||||
// https://community.bistudio.com/wiki/getPos
|
||||
_home = _pos getPos [_spawnDistance,_spawnVector];
|
||||
|
||||
// Send the heli back to base
|
||||
_grpPilot = group this;
|
||||
[_grpPilot, 0] setWPPos _pos;
|
||||
[_grpPilot, 0] setWaypointType "MOVE";
|
||||
[_grpPilot, 0] setWaypointSpeed "FULL";
|
||||
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
|
||||
[_grpPilot, 0] setWaypointCompletionRadius 200;
|
||||
[_grpPilot, 0] setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
|
||||
[_grpPilot, 0] setWaypointName "GoHome";
|
||||
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
|
||||
|
||||
|
||||
diag_log "reinforcements:: sending Heli Home";
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
call with
|
||||
[
|
||||
_supplyHeli, // heli from which they should para
|
||||
_lootCounts,
|
||||
_lootSetting // [blue, red, green, orange]
|
||||
] call blck_spawnHeliParaCrate
|
||||
*/
|
||||
|
||||
params["_supplyHeli","_lootCounts"];
|
||||
|
||||
private ["_chute","_crate"];
|
||||
_crate = "";
|
||||
_chute = "";
|
||||
|
||||
diag_log "_fnc_spawnParaCrate:: spawning crate";
|
||||
|
||||
private["_dir","_offset"];
|
||||
_dir = getDir _supplyHeli;
|
||||
_dir = if (_dir < 180) then {_dir + 210} else {_dir - 210};
|
||||
_offset = _supplyHeli getPos [10, _dir];
|
||||
|
||||
//open parachute and attach to crate
|
||||
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 100], [], 0, "FLY"];
|
||||
[_chute] call blck_fnc_protectVehicle;
|
||||
_chute setPos [_offset select 0, _offset select 1, 100 ]; //(_offset select 2) - 10];
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: chute spawned yielding object %1 at postion %2", _chute, getPos _chute];
|
||||
|
||||
//create the parachute and crate
|
||||
private["_crateSelected"];
|
||||
_crateSelected = selectRandom["Box_FIA_Ammo_F","Box_FIA_Support_F","Box_FIA_Wps_F","I_SupplyCrate_F","Box_IND_AmmoVeh_F","Box_NATO_AmmoVeh_F","Box_East_AmmoVeh_F","IG_supplyCrate_F"];
|
||||
_crate = [getPos _chute, _crateSelected] call blck_fnc_spawnCrate;
|
||||
//_crate = createVehicle [_crateSelected, position _chute, [], 0, "CAN_COLLIDE"];
|
||||
_crate setPos [position _supplyHeli select 0, position _supplyHeli select 1, 250]; //(position _supplyHeli select 2) - 10];
|
||||
_crate attachTo [_chute, [0, 0, -1.3]];
|
||||
_crate allowdamage false;
|
||||
_crate enableRopeAttach true; // allow slingloading where possible
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: crate spawned %1 at position %2 and attached to %3",_crate, getPos _crate, attachedTo _crate];
|
||||
|
||||
|
||||
switch (_lootSetting) do
|
||||
{
|
||||
case "orange": {[_crate, blck_BoxLoot_Orange, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "green": {[_crate, blck_BoxLoot_Green, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "red": {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "blue": {[_crate, blck_BoxLoot_Blue, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
default {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
};
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: crate loaded and now at position %1 and attached to %2", getPos _crate, attachedTo _crate];
|
||||
|
||||
_fn_monitorCrate = {
|
||||
params["_crate","_chute"];
|
||||
uiSleep 30;
|
||||
private["_crateOnGround"];
|
||||
_crateOnGround = false;
|
||||
while {!_crateOnGround} do
|
||||
{
|
||||
uiSleep 1;
|
||||
diag_log format["_fnc_spawnParaCrate:: Crate Altitude: %1 Crate Velocity: %2 Crate Position: %3 Crate attachedTo %4", getPos _crate select 2, velocityModelSpace _crate select 2, getPosATL _crate, attachedTo _crate];
|
||||
if ( (((velocity _crate) select 2) < 0.1) || ((getPosATL _crate select 2) < 0.1) ) exitWith
|
||||
{
|
||||
uiSleep 10; // give some time for everything to settle
|
||||
detach _crate;
|
||||
deleteVehicle _chute;
|
||||
if (surfaceIsWater (getPos _crate)) then
|
||||
{
|
||||
deleteVehicle _crate;
|
||||
} else
|
||||
{
|
||||
[_crate] call blck_fnc_signalEnd;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[_crate,_chute] call _fn_monitorCrate;
|
||||
[[_crate], 1200 /* 20 min*/] spawn blck_fnc_addObjToQue;
|
@ -0,0 +1,72 @@
|
||||
// GMS_fnc_time.sqf
|
||||
// by Ghostrider-DBD_
|
||||
// Last Updated 12/21/16
|
||||
// Creds to AWOL, A3W, LouD and Creampie for insights.
|
||||
|
||||
//if (!isServer) exitWith {};
|
||||
|
||||
/*
|
||||
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below
|
||||
// which can be set using the corresponding variables in the config file for that mod.
|
||||
|
||||
blck_timeAccelerationDay = 1; // Daytime time accelearation
|
||||
blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation
|
||||
blck_timeAccelerationNight = 6; // Nighttim time acceleration
|
||||
--------------------------
|
||||
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 ["_arr","_sunrise","_sunset","_time"];
|
||||
_arr = date call BIS_fnc_sunriseSunsetTime;
|
||||
_sunrise = _arr select 0;
|
||||
_sunset = _arr select 1;
|
||||
_time = dayTime;
|
||||
|
||||
|
||||
// blck_debugMode3
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log "fnc_Time:: Debug settings ON";
|
||||
diag_log format["_fnc_Time:: -- > _sunrise = %1 | _sunset = %2 | _time = %3",_sunrise,_sunset,_time];
|
||||
};
|
||||
#endif
|
||||
|
||||
// Night
|
||||
if (_time > (_sunset + 0.5) || _time < (_sunrise - 0.5)) exitWith {
|
||||
setTimeMultiplier blck_timeAccelerationNight;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["NIGHT TIMGE ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
// Day
|
||||
if (_time > (_sunrise + 0.5) && _time < (_sunset - 0.5)) exitWith {
|
||||
setTimeMultiplier blck_timeAccelerationDay;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
|
||||
diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
// default
|
||||
setTimeMultiplier blck_timeAccelerationDusk;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["DUSK ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
Deals with instances in which a unit is damaged (not in use).
|
||||
By Ghostrider-DbD-
|
||||
Last modified 4-11-17
|
||||
|
||||
unit: Object - Object the event handler is assigned to.
|
||||
selectionName: String - Name of the selection where the unit was damaged. "" for over-all structural damage, "?" for unknown selections.
|
||||
damage: Number - Resulting level of damage for the selection.
|
||||
source: Object - The source unit that caused the damage.
|
||||
projectile: String - Classname of the projectile that caused inflicted the damage. ("" for unknown, such as falling damage.)
|
||||
|
||||
(Since Arma 3 v 1.49.131802)
|
||||
|
||||
hitPartIndex: Number - Hit part index of the hit point, -1 otherwise.
|
||||
--------------------------
|
||||
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 ["_unit","_killer","_group","_deleteAI_At"];
|
||||
_unit = _this select 0;
|
||||
_source = _this select 3;
|
||||
|
||||
if (isPlayer _source) then {
|
||||
[_unit,_source] call GRMS_fnc_alertGroup;
|
||||
};
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
By Ghostrider-DbD-
|
||||
Last Modified 7-27-17
|
||||
|
||||
Handles the case where a unit is hit.
|
||||
|
||||
--------------------------
|
||||
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 ["_unit","_instigator","_group","_wp"];
|
||||
//diag_log format["_EH_AIHit::-->> _this = %1",_this];
|
||||
_unit = _this select 0 select 0;
|
||||
_instigator = _this select 0 select 3;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (!(alive _unit)) exitWith {};
|
||||
if (!(isPlayer _instigator)) exitWith {};
|
||||
[_unit,_instigator] call blck_fnc_alertGroupUnits;
|
||||
[_instigator] call blck_fnc_alertNearbyVehicles;
|
||||
_group = group _unit;
|
||||
//_group setBehavior "COMBAT";
|
||||
_wp = [_group, currentWaypoint _group];
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_group setCombatMode "RED";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
|
||||
if (_unit getVariable ["hasHealed",false]) exitWith {};
|
||||
if ((damage _unit) > 0.1 ) then
|
||||
{
|
||||
//diag_log format["_EH_AIHit::-->> Healing unit %1",_unit];
|
||||
_unit setVariable["hasHealed",true,true];
|
||||
_unit addMagazine "SmokeShellOrange";
|
||||
_unit fire "SmokeShellMuzzle";
|
||||
_unit addItem "FAK";
|
||||
_unit action ["HealSoldierSelf", _unit];
|
||||
_unit setDamage 0;
|
||||
_unit removeItem "FAK";
|
||||
};
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
/*
|
||||
Killed handler for _units
|
||||
By Ghostrider-DbD
|
||||
Last Modified 4-11-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["_unit","_killer"];
|
||||
|
||||
//diag_log format["EH_AIKilled:: _units = %1 and _killer = %2",_unit,_killer];
|
||||
[_unit,_killer] remoteExec ["blck_fnc_processAIKill",2];
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
|
||||
Handle case where a unit reloads weapon.
|
||||
This was used in place of fired event handlers to add realism and deal with issues with the arma engine post v1.64
|
||||
By Ghostrider-DbD-
|
||||
Last modified 4-11-17
|
||||
|
||||
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/Reloaded
|
||||
|
||||
The EH returns array in _this variable of the following format [entity, weapon, muzzle, newMagazine, (oldMagazine)], where:
|
||||
|
||||
entity: Object - unit or vehicle to which EH is assigned
|
||||
weapon: String - weapon that got reloaded
|
||||
muzzle: String - weapons muzzle that got reloaded
|
||||
newMagazine: Array - new magazine info in format [magazineClass, ammoCount, magazineID, magazineCreator], where:
|
||||
magazineClass: String - class name of the magazine
|
||||
ammoCount: Number - amount of ammo in magazine
|
||||
magazineID: Number - global magazine id
|
||||
magazineCreator: Number - owner of the magazine creator
|
||||
|
||||
--------------------------
|
||||
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 ["_unit","_mag"];
|
||||
//_unit = _this select 0;
|
||||
//_mag = _this select 3 select 0;
|
||||
(_this select 0) addMagazine (_this select 3 select 0);
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugON) then {
|
||||
//diag_log format["_EH_unitWeaponReloaded:: unit %1 reloaded weapon %2 with magazine %3",_this select 0, (_this select 3 select 0)];
|
||||
//diag_log format["_EH_unitWeaponReloaded:: unit %1 currently has the following magazines 2",_this select 0,magazines (_this select 0)];
|
||||
};
|
||||
#endif
|
||||
//if (blck_debugLevel > 2) then (diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit];
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
7-27-17
|
||||
Alerts the leader of a group of the location of an enemy.
|
||||
|
||||
--------------------------
|
||||
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["_knowsAbout","_intelligence","_group"];
|
||||
params["_unit","_target"];
|
||||
_intelligence = _unit getVariable ["intelligence",1];
|
||||
_group = group _unit;
|
||||
{
|
||||
_knowsAbout = _x knowsAbout _target;
|
||||
_x reveal [_target,_knowsAbout + _intelligence];
|
||||
}forEach units _group;
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
4-5-17
|
||||
Alerts the leader of a group of the location of an enemy.
|
||||
|
||||
--------------------------
|
||||
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["_knowsAbout","_intelligence","_group"];
|
||||
params["_unit","_target"];
|
||||
_intelligence = _unit getVariable ["intelligence",1];
|
||||
_group = group _unit;
|
||||
{
|
||||
_knowsAbout = _x knowsAbout _target;
|
||||
_x reveal [_target,_knowsAbout + _intelligence];
|
||||
}forEach units _group;
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
9-20-15
|
||||
Allerts all units within a certain radius of the location of a killer.
|
||||
** Not in use at this time; reserved for the future **
|
||||
--------------------------
|
||||
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["_alertDist","_intelligence"];
|
||||
params["_unit","_killer"];
|
||||
|
||||
//diag_log format["#-alertNearbyUnits.sqf-# alerting nearby units of killer of unit %1",_unit];
|
||||
_alertDist = _unit getVariable ["alertDist",300];
|
||||
_intelligence = _unit getVariable ["intelligence",1];
|
||||
if (_alertDist > 0) then {
|
||||
//diag_log format["+----+ alerting units close to %1",_unit];
|
||||
{
|
||||
if (((position _x) distance2D (position _unit)) <= _alertDist) then {
|
||||
_knowsAbout = _x knowsAbout _killer;
|
||||
_x reveal [_killer, _knowsAbout + _intelligence];
|
||||
//diag_log "Killer revealed";
|
||||
}
|
||||
} forEach allUnits;
|
||||
};
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
4-5-17
|
||||
Alerts the units of nearby vehicles of the location of an enemy.
|
||||
|
||||
--------------------------
|
||||
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["_target"];
|
||||
|
||||
_fn_alertGroupUnits = {
|
||||
params["_group","_target"];
|
||||
private["_intelligence","_knowsAbout"];
|
||||
_intelligence = (leader _group) getVariable ["intelligence",1];
|
||||
{
|
||||
_knowsAbout = _x knowsAbout _target;
|
||||
_x reveal [_target,_knowsAbout + _intelligence];
|
||||
}forEach (units _group);
|
||||
};
|
||||
|
||||
_fn_allertNearbyVehicleGroups = {
|
||||
params["_vehicles","_target"];
|
||||
private["_vehGroup"];
|
||||
{
|
||||
_vehGroup = _x getVariable["vehicleGroup",grpNull];
|
||||
if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call _fn_alertGroupUnits;};
|
||||
}forEach _vehicles;
|
||||
};
|
||||
|
||||
[blck_monitoredVehicles,_target] call _fn_allertNearbyVehicleGroups;
|
||||
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Delete alive AI.
|
||||
Now called from the main thread which tracks the time elapsed so that we no longer spawn a wait timer for each completed mission.
|
||||
by Ghostrider
|
||||
Last updated 4/11/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";
|
||||
|
||||
/*
|
||||
_fn_deleteAIfromList = {
|
||||
params["_aiList"];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fn_deleteAIfromList:: _aiList = %1",_aiList];};
|
||||
#endif
|
||||
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fn_deleteAIfromList:: -> deleteing AI Unit %1",_x];};
|
||||
#endif
|
||||
|
||||
[_x] call blck_fnc_deleteAI;
|
||||
}forEach _aiList;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_cleanupAliveAI called at %1",diag_tickTime];};
|
||||
#endif
|
||||
*/
|
||||
for "_i" from 1 to (count blck_liveMissionAI) do
|
||||
{
|
||||
if ((_i) <= count blck_liveMissionAI) then
|
||||
{
|
||||
_units = blck_liveMissionAI select (_i - 1);
|
||||
//diag_log format["_fnc_cleanupAliveAI:: (34) evaluating with delete time = %2 and diag_tickTime %1", diag_tickTime, _units select 1];
|
||||
if (diag_tickTime > (_units select 1) ) then
|
||||
{
|
||||
//diag_log format["_fnc_cleanupAliveAI:: cleaning up AI group %1",_units];
|
||||
{
|
||||
|
||||
//diag_log format["_fnc_cleanupAliveAI:: deleting unit %1",_x];
|
||||
//diag_log format["_fnc_cleanupAliveAI:: vehicle _x = %1",vehicle _x];
|
||||
//diag_log format["_fnc_cleanupAliveAI:: objectParent _x = %1",objectParent _x];
|
||||
|
||||
if ((alive _x) && !(isNull objectParent _x)) then // mark the vehicle for deletion
|
||||
{
|
||||
//diag_log format["_fnc_cleanupAliveAI: deleteing objectParent %1 [%3] for unit %2",objectParent _x, _x, typeName (objectParent _x), typeOf (objectParent _x)];
|
||||
[objectParent _x] call blck_fn_deleteAIvehicle;
|
||||
};
|
||||
[_x] call blck_fnc_deleteAI;
|
||||
}forEach (_units select 0);
|
||||
uiSleep 0.1;
|
||||
blck_liveMissionAI set[(_i - 1), -1];
|
||||
blck_liveMissionAI = blck_liveMissionAI - [-1]; // Remove that list of live AI from the list.
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_mainTread:: blck_liveMissionAI updated to %1",blck_liveMissionAI];};
|
||||
#endif
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Delete Dead AI and nearby weapons after an appropriate period.
|
||||
by Ghostrider
|
||||
Last updated 1/24/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";
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["fnc_cleanupDeadAI called at time %1",diag_tickTime];};
|
||||
#endif
|
||||
|
||||
private["_aiList","_ai"];
|
||||
_aiList = +blck_deadAI;
|
||||
{
|
||||
if ( diag_tickTime > _x getVariable ["blck_cleanupAt",0] ) then // DBD_DeleteAITimer
|
||||
{
|
||||
_ai = _x;
|
||||
{
|
||||
deleteVehicle _x;
|
||||
}forEach nearestObjects [getPos _ai,["WeaponHolderSimulated","GroundWeapoonHolder"],3];
|
||||
blck_deadAI = blck_deadAI - [_ai];
|
||||
deleteVehicle _ai;
|
||||
};
|
||||
} forEach _aiList;
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Delete a unit.
|
||||
by Ghostrider
|
||||
Last updated 1/22/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["_ai","_group"];
|
||||
params["_unit"];
|
||||
|
||||
//if (blck_debugLevel > 2) then {diag_log format["_fnc_deleteAI::-> deleting unit = %1",_unit];};
|
||||
|
||||
{
|
||||
_unit removeAllEventHandlers _x;
|
||||
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear"];
|
||||
private _group = (group _unit);
|
||||
[_unit] joinSilent grpNull;
|
||||
deleteVehicle _unit;
|
||||
if (count units _group isEqualTo 0) then
|
||||
{
|
||||
deletegroup _group;
|
||||
};
|
||||
|
@ -0,0 +1,74 @@
|
||||
/*
|
||||
Handle AI Deaths
|
||||
Last Modified 7/27/17
|
||||
By Ghostrider-DBD-
|
||||
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["_group","_isLegal","_weapon","_lastkill","_kills","_message","_killstreakMsg"];
|
||||
params["_unit","_killer","_isLegal"];
|
||||
|
||||
_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer, true];
|
||||
|
||||
blck_deadAI pushback _unit;
|
||||
_group = group _unit;
|
||||
[_unit] joinSilent grpNull;
|
||||
if (count(units _group) < 1) then {
|
||||
#ifdef useDynamicSimulation
|
||||
_group enableDynamicSimulation false;
|
||||
#endif
|
||||
deleteGroup _group;
|
||||
};
|
||||
if (blck_launcherCleanup) then {[_unit] spawn blck_fnc_removeLaunchers;};
|
||||
if (blck_removeNVG) then {[_unit] spawn blck_fnc_removeNVG;};
|
||||
if !(isPlayer _killer) exitWith {};
|
||||
[_unit,_killer] call blck_fnc_alertGroupUnits;
|
||||
[_killer] call blck_fnc_alertNearbyVehicles;
|
||||
_group = group _unit;
|
||||
_wp = [_group, currentWaypoint _group];
|
||||
_wp setWaypointBehaviour "COMBAT";
|
||||
_group setCombatMode "RED";
|
||||
_wp setWaypointCombatMode "RED";
|
||||
{
|
||||
_unit removeAllEventHandlers _x;
|
||||
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear","Hit"];
|
||||
|
||||
_isLegal = [_unit,_killer] call blck_fnc_processIlleagalAIKills;
|
||||
|
||||
if !(_isLegal) exitWith {};
|
||||
|
||||
_lastkill = _killer getVariable["blck_lastkill",diag_tickTime];
|
||||
_killer setVariable["blck_lastkill",diag_tickTime];
|
||||
_kills = (_killer getVariable["blck_kills",0]) + 1;
|
||||
if ((diag_tickTime - _lastkill) < 240) then
|
||||
{
|
||||
_killer setVariable["blck_kills",_kills];
|
||||
} else {
|
||||
_killer setVariable["blck_kills",0];
|
||||
};
|
||||
|
||||
if (blck_useKillMessages) then
|
||||
{
|
||||
_weapon = currentWeapon _killer;
|
||||
_killstreakMsg = format[" %1X KILLSTREAK",_kills];
|
||||
|
||||
if (blck_useKilledAIName) then
|
||||
{
|
||||
_message = format["[blck] %2: killed by %1 from %3m",name _killer,name _unit,round(_unit distance _killer)];
|
||||
}else{
|
||||
_message = format["[blck] %1 killed with %2 from %3 meters",name _killer,getText(configFile >> "CfgWeapons" >> _weapon >> "DisplayName"), round(_unit distance _killer)];
|
||||
};
|
||||
_message =_message + _killstreakMsg;
|
||||
//diag_log format["[blck] unit killed message is %1",_message,""];
|
||||
[["aikilled",_message,"victory"],playableUnits] call blck_fnc_messageplayers;
|
||||
};
|
||||
[_unit,_killer] call blck_fnc_rewardKiller;
|
||||
|
||||
|
@ -0,0 +1,97 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
6-1-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["_missionType","_wasRunover","_launcher","_legal"];
|
||||
params["_unit","_killer"];
|
||||
//diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit];
|
||||
_launcher = _unit getVariable ["Launcher",""];
|
||||
_legal = true;
|
||||
|
||||
_fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped
|
||||
params["_unit","_vk"];
|
||||
private["_unit"];
|
||||
{
|
||||
if ( ( (getPos _vk) distance2d (getPos _x) ) < 500 ) then
|
||||
{
|
||||
_x reveal [_vk, 4];
|
||||
_x dowatch _vk;
|
||||
_x doTarget _vk;
|
||||
if (_unit getVariable ["Launcher",""] != "") then
|
||||
{
|
||||
_x selectWeapon (secondaryWeapon _unit);
|
||||
_x fireAtTarget [_vk,_unit getVariable ["Launcher"]];
|
||||
} else {
|
||||
_x doTarget _vk;
|
||||
_x doFire _vk;
|
||||
};
|
||||
};
|
||||
} forEach (call blck_fnc_allPlayers);
|
||||
};
|
||||
|
||||
_fn_applyVehicleDamage = { // apply a bit of damage
|
||||
private["_vd"];
|
||||
params["_vk"];
|
||||
_vd = getDammage _vk;
|
||||
_vk setDamage (_vd + blck_RunGearDamage);
|
||||
};
|
||||
|
||||
_fn_deleteAIGear = {
|
||||
params["_ai"];
|
||||
{deleteVehicle _x}forEach nearestObjects [(getPosATL _ai), ['GroundWeaponHolder','WeaponHolderSimulated','WeaponHolder'], 3]; //Adapted from the AI cleanup logic by KiloSwiss
|
||||
[_ai] call blck_fnc_removeGear;
|
||||
};
|
||||
|
||||
_fn_msgIED = {
|
||||
params["_killer"];
|
||||
//diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)];
|
||||
[["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers;
|
||||
};
|
||||
|
||||
if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehicle
|
||||
{
|
||||
if(_killer == driver(vehicle _killer))then{ // The AI was runover
|
||||
if(blck_RunGear) then { // If we are supposed to delete gear from AI that were run over then lets do it.
|
||||
[_unit] call _fn_deleteAIGear;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["<<--->> Unit %1 was run over by %2",_unit,_killer];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
if (blck_VK_RunoverDamage) then {//apply vehicle damage
|
||||
[vehicle _killer] call _fn_applyVehicleDamage;
|
||||
if (blck_debugON) then{diag_log format[">>---<< %1's vehicle has had damage applied",_killer];};
|
||||
[_killer] call _fn_msgIED;
|
||||
};
|
||||
[_unit, vehicle _killer] call _fn_targetVehicle;
|
||||
_legal = false;
|
||||
};
|
||||
};
|
||||
|
||||
if ( blck_VK_GunnerDamage &&((typeOf vehicle _killer) in blck_forbidenVehicles or (currentWeapon _killer) in blck_forbidenVehicleGuns) ) then {
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["!!---!! Unit was killed by a forbidden vehicle or gun",_unit];
|
||||
};
|
||||
#endif
|
||||
if (blck_VK_Gear) then {[_unit] call _fn_deleteAIGear;};
|
||||
[_unit, vehicle _killer] call _fn_targetVehicle;
|
||||
[vehicle _killer] call _fn_applyVehicleDamage;
|
||||
|
||||
[_killer] call _fn_msgIED;
|
||||
|
||||
_legal = false;
|
||||
};
|
||||
|
||||
_legal
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Remove all gear from an AI _unit
|
||||
By Ghostrider-DbD-
|
||||
|
||||
--------------------------
|
||||
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["_unit"];
|
||||
|
||||
removeVest _unit;
|
||||
removeHeadgear _unit;
|
||||
removeGoggles _unit;
|
||||
removeAllItems _unit;
|
||||
removeAllWeapons _unit;
|
||||
removeBackpackGlobal _unit;
|
||||
removeUniform _unit;
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
1-22-17
|
||||
Removes an AI launcher and ammo
|
||||
--------------------------
|
||||
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["_launcher","_launcherRounds"];
|
||||
params["_unit"]; // = _this select 0;
|
||||
_launcher = _unit getVariable ["Launcher",""];
|
||||
_unit removeWeapon _Launcher;
|
||||
if (_launcher != "") then
|
||||
{
|
||||
_unit removeWeapon _Launcher;
|
||||
{
|
||||
if (_launcher in weaponCargo _x) exitWith {
|
||||
deleteVehicle _x;
|
||||
};
|
||||
} forEach ((getPosATL _unit) nearObjects ["WeaponHolderSimulated",10]);
|
||||
_launcherRounds = getArray (configFile >> "CfgWeapons" >> _Launcher >> "magazines"); //0;
|
||||
{
|
||||
if(_x in _launcherRounds) then {_unit removeMagazine _x;};
|
||||
} count magazines _unit;
|
||||
};
|
||||
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
by Ghostrider
|
||||
8-13-16
|
||||
Remove NVG from AI
|
||||
--------------------------
|
||||
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["_unit"];
|
||||
//diag_log format["+--+ removing NVG for unit %1",_unit];
|
||||
|
||||
if (blck_useNVG) then
|
||||
{
|
||||
if (_unit getVariable ["hasNVG",false]) then
|
||||
{
|
||||
|
||||
_unit unassignitem "NVGoggles"; _unit removeweapon "NVGoggles";
|
||||
};
|
||||
};
|
@ -0,0 +1,120 @@
|
||||
|
||||
/*
|
||||
calculate a reward player for AI Kills in crypto.
|
||||
Code fragment adapted from VEMF
|
||||
call as [_unit,_killer] call blck_fnc_rewardKiller;
|
||||
Last modified 6/3/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["_unit","_killer"];
|
||||
//diag_log format["rewardKiller:: _unit = %1 and _killer %2",_unit,_killer];
|
||||
|
||||
private["_modType","_reward","_maxReward","_dist","_killstreakReward","_distanceBonus","_newKillerScore","_newKillerFrags","_money"];
|
||||
_modType = call blck_fnc_getModType;
|
||||
|
||||
//diag_log format["[blckeagles] rewardKiller:: - _modType = %1",_modType];
|
||||
//if (_modType isEqualTo "Epoch") exitWith {}; // Have players pull crypto from AI bodies now that this feature is available.
|
||||
|
||||
if (_modType isEqualTo "Epoch") then
|
||||
{
|
||||
//diag_log "calculating reward for Epoch";
|
||||
|
||||
if ( (vehicle _killer) in blck_forbidenVehicles || (currentWeapon _killer) in blck_forbidenVehicleGuns ) then
|
||||
{
|
||||
_reward = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Give the player money for killing an AI
|
||||
_maxReward = 50;
|
||||
_dist = _unit distance _killer;
|
||||
_reward = 0;
|
||||
|
||||
if (_dist < 50) then { _reward = _maxReward - (_maxReward / 1.25); _reward };
|
||||
if (_dist < 100) then { _reward = _maxReward - (_maxReward / 1.5); _reward };
|
||||
if (_dist < 800) then { _reward = _maxReward - (_maxReward / 2); _reward };
|
||||
if (_dist > 800) then { _reward = _maxReward - (_maxReward / 4); _reward };
|
||||
|
||||
private _killstreakReward=+(_kills*2);
|
||||
//diag_log format["fnd_rewardKiller:: _bonus returned will be %1",_reward];
|
||||
if (blck_addAIMoney) then
|
||||
{
|
||||
[_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto;
|
||||
};
|
||||
if (blck_useKillScoreMessage) then
|
||||
{
|
||||
[["showScore",[_reward,"",_kills],""],[_killer]] call blck_fnc_messageplayers;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
_player setVariable ["ExileHunger", _data select 4];
|
||||
_player setVariable ["ExileThirst", _data select 5];
|
||||
_player setVariable ["ExileAlcohol", _data select 6];
|
||||
_player setVariable ["ExileTemperature", _data select 44];
|
||||
_player setVariable ["ExileWetness", _data select 45];
|
||||
*/
|
||||
|
||||
if (_modType isEqualTo "Exile") then
|
||||
{
|
||||
private["_distanceBonus","_overallRespectChange","_newKillerScore","_newKillerFrags","_maxReward","_money","_message"];
|
||||
/*
|
||||
// Temporary fix for the Loss of Respect Bug.
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer name = %2 | ExileScore = %1 | Kills %3",_killer getVariable [ "ExileScore", 0 ], name _killer, _killer getVariable["ExileKills",0]];
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer = %1 | vehicle _killer = %2 | objectParent _killer %3",_killer, vehicle _killer, objectParent _killer];
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer is gunner = %1 | killer is driver = %2",_killer isEqualTo gunner objectParent _killer,_killer isEqualTo driver objectParent _killer];
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileOwnerUID = %1 ",_killer getVariable["ExileOwnerUID",0]]; // ExileOwnerUID
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileHunger = %1 ",_killer getVariable["ExileHunger",0]]; // ExileOwnerUID
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileThirst = %1 ",_killer getVariable["ExileThirst",0]]; // ExileOwnerUID
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileAlcohol = %1 ",_killer getVariable["ExileAlcohol",0]]; // ExileOwnerUID
|
||||
diag_log format["GMS_fnc_rewardKiller.sqf:: _killer ExileWetness = %1 ",_killer getVariable["ExileWetness",0]]; // ExileOwnerUID
|
||||
*/
|
||||
if ( (isPlayer _killer) && (_killer getVariable["ExileHunger",0] > 0) && (_killer getVariable["ExileThirst",0] > 0) ) then
|
||||
{
|
||||
_distanceBonus = floor((_unit distance _killer)/100);
|
||||
_killstreakBonus = 3 * (_killer getVariable["blck_kills",0]);
|
||||
_respectGained = 25 + _distanceBonus + _killstreakBonus;
|
||||
_score = _killer getVariable ["ExileScore", 0];
|
||||
//diag_log format["GMS_fnc_rewardKiller.sqf:: ExileScore = %1",_killer getVariable ["ExileScore", 0]];
|
||||
_score = _score + (_respectGained);
|
||||
//diag_log format["GMS_fnc_rewardKiller.sqf:: _new = %1",_score];
|
||||
_killer setVariable ["ExileScore", _score];
|
||||
format["setAccountScore:%1:%2", _score,getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
|
||||
_newKillerFrags = _killer getVariable ["ExileKills", 0];
|
||||
_newKillerFrags = _newKillerFrags + 1;
|
||||
_killer setVariable ["ExileKills", _newKillerFrags];
|
||||
format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
|
||||
//_message = ["showFragRequest",_respectGained];
|
||||
_killer call ExileServer_object_player_sendStatsUpdate;
|
||||
if (blck_useKillScoreMessage) then
|
||||
{
|
||||
[["showScore",[_respectGained,_distanceBonus,_kills]], [_killer]] call blck_fnc_messageplayers;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
if (_overallRespectChange > 0) then {
|
||||
_score = _killer getVariable ["ExileScore", 0];
|
||||
_score = _score + _overallRespectChange;
|
||||
_killer setVariable ["ExileScore", _score];
|
||||
format["setAccountScore:%1:%2", _score,_killerPlayerUID] call ExileServer_system_database_query_fireAndForget;
|
||||
[_killer, "showFragRequest", [_killerRespectPoints]] call A3XAI_sendExileMessage;
|
||||
};
|
||||
|
||||
//["systemChatRequest", [_killMessage]] call ExileServer_system_network_send_broadcast; //To-do: Non-global version
|
||||
_newKillerFrags = _killer getVariable ["ExileKills", 0];
|
||||
_killer setVariable ["ExileKills", _newKillerFrags + 1];
|
||||
format["addAccountKill:%1", _killerPlayerUID] call ExileServer_system_database_query_fireAndForget;
|
||||
|
||||
_killer call ExileServer_object_player_sendStatsUpdate;
|
||||
};
|
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Set skills for an AI Unit
|
||||
by Ghostrider
|
||||
Last updated 8/14/16
|
||||
--------------------------
|
||||
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";
|
||||
|
||||
// Self explanatory
|
||||
// [_group, _skill] call blck_setSkill;
|
||||
params ["_unit","_skillsArrray"];
|
||||
|
||||
{
|
||||
_unit setSkill [(_x select 0),(_x select 1)];
|
||||
} forEach _skillsArrray;
|
@ -0,0 +1,184 @@
|
||||
/*
|
||||
Original Code by blckeagls
|
||||
Modified by Ghostrider
|
||||
Logic for adding AI Ammo, GL Shells and Attachments addapted from that by Buttface (A3XAI).
|
||||
Everything having to do with spawning and configuring an AI should happen here
|
||||
Last Modified 1/22/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";
|
||||
|
||||
//Defines private variables so they don't interfere with other scripts
|
||||
private ["_i","_weap","_skin","_ai1","_skillLevel","_aiSkills",
|
||||
"_launcherRound","_index","_ammoChoices"];
|
||||
|
||||
params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_underwater",false]];
|
||||
//_pos = _this select 0; // Position at which to spawn AI
|
||||
//_weaponList = _this select 1; // List of weapons with which to arm the AI
|
||||
//_aiGroup = _this select 2; // Group to which AI belongs
|
||||
//_skillLevel = [_this,3,"red"] call BIS_fnc_param; // Assign a skill level in case one was not passed."blue", "red", "green", "orange"
|
||||
//_Launcher = [_this, 4, "none"] call BIS_fnc_param; // Set launchers to "none" if no setting was passed.
|
||||
//_uniforms = [_this, 5, blck_SkinList] call BIS_fnc_param; // skins to add to AI
|
||||
//_headGear = [_this, 6, _shemag] call BIS_fnc_param;// headGear to add to AI
|
||||
|
||||
if (isNull _aiGroup) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnUnit"};
|
||||
|
||||
_ai1 = ObjNull;
|
||||
private _modType = call blck_fnc_getModType;
|
||||
if (_modType isEqualTo "Epoch") then
|
||||
{
|
||||
"I_Soldier_EPOCH" createUnit [_pos, _aiGroup, "_ai1 = this", 0.7, "COLONEL"];
|
||||
switch(_skillLevel) do
|
||||
{
|
||||
case "blue":{_ai1 setVariable["Crypto",1 + floor(random(blck_maxMoneyBlue)),true];};
|
||||
case "red":{_ai1 setVariable["Crypto",2 + floor(random(blck_maxMoneyRed)),true];};
|
||||
case "green":{_ai1 setVariable["Crypto",3 + floor(random(blck_maxMoneyGreen)),true];};
|
||||
case "orange":{_ai1 setVariable["Crypto",4 + floor(random(blck_maxMoneyOrange)),true];};
|
||||
};
|
||||
};
|
||||
if (_modType isEqualTo "Exile") then
|
||||
{
|
||||
"i_g_soldier_unarmed_f" createUnit [_pos, _aiGroup, "_ai1 = this", blck_baseSkill, "COLONEL"];
|
||||
switch(_skillLevel) do
|
||||
{
|
||||
case "blue":{_ai1 setVariable["ExileMoney",2 + floor(random(blck_maxMoneyBlue)),true];};
|
||||
case "red":{_ai1 setVariable["ExileMoney",4 + floor(random(blck_maxMoneyRed)),true];};
|
||||
case "green":{_ai1 setVariable["ExileMoney",6 + floor(random(blck_maxMoneyGreen)),true];};
|
||||
case "orange":{_ai1 setVariable["ExileMoney",8 + floor(random(blck_maxMoneyOrange)),true];};
|
||||
};
|
||||
};
|
||||
[_ai1] call blck_fnc_removeGear;
|
||||
_skin = "";
|
||||
_counter = 1;
|
||||
while {_skin isEqualTo "" && _counter < 10} do
|
||||
{
|
||||
_skin = selectRandom _uniforms;
|
||||
_ai1 forceAddUniform _skin;
|
||||
_skin = uniform _ai1;
|
||||
//diag_log format["_fnc_spawnUnit::-->> for unit _ai1 % uniform is %2",_ai1, uniform _ai1];
|
||||
_counter =+1;
|
||||
};
|
||||
//Stops the AI from being cleaned up
|
||||
_ai1 setVariable["DBD_AI",1];
|
||||
|
||||
//Sets AI Tactics
|
||||
_ai1 enableAI "TARGET";
|
||||
_ai1 enableAI "AUTOTARGET";
|
||||
_ai1 enableAI "MOVE";
|
||||
_ai1 enableAI "ANIM";
|
||||
_ai1 enableAI "FSM";
|
||||
_ai1 allowDammage true;
|
||||
_ai1 setBehaviour "COMBAT";
|
||||
_ai1 setunitpos "AUTO";
|
||||
|
||||
if (_modType isEqualTo "Epoch") then
|
||||
{
|
||||
// do this so the AI or corpse hangs around on Epoch servers.
|
||||
_ai1 setVariable ["LAST_CHECK",28800,true];
|
||||
};
|
||||
|
||||
_ai1 addHeadgear (selectRandom _headGear);
|
||||
// Add a vest to AI for storage
|
||||
_ai1 addVest selectRandom blck_vests;
|
||||
|
||||
if ( random (1) < blck_chanceBackpack) then
|
||||
{
|
||||
//_bpck = selectRandom blck_backpack;
|
||||
_ai1 addBackpack selectRandom blck_backpacks;
|
||||
};
|
||||
|
||||
_weap = selectRandom _weaponList;
|
||||
private["_optics","_pointers","_muzzles","_underbarrel","_legalOptics"];
|
||||
_ai1 addWeaponGlobal _weap;
|
||||
_ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines");
|
||||
_optics = getArray (configfile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
|
||||
_pointers = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
|
||||
_muzzles = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
|
||||
_underbarrel = getArray (configFile >> "CfgWeapons" >> _weap >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
|
||||
_legalOptics = _optics - blck_blacklistedOptics;
|
||||
|
||||
_ai1 addMagazines [selectRandom _ammoChoices, 3];
|
||||
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _muzzles)};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _legalOptics);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _pointers);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _muzzles);};
|
||||
if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _underbarrel);};
|
||||
if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then {
|
||||
_ai1 addMagazine "1Rnd_HE_Grenade_shell";
|
||||
};
|
||||
|
||||
_weap = selectRandom blck_Pistols;
|
||||
//diag_log format["[spawnUnit.sqf] _weap os %1",_weap];
|
||||
_ai1 addWeaponGlobal _weap;
|
||||
_ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines");
|
||||
_ai1 addMagazines [selectRandom _ammoChoices, 2];
|
||||
|
||||
//add random items to AI. _other = ["ITEM","COUNT"]
|
||||
for "_i" from 1 to (1+floor(random(3))) do {
|
||||
_ai1 addItem (selectRandom blck_ConsumableItems);
|
||||
};
|
||||
|
||||
// Add an First Aid or Grenade 50% of the time
|
||||
if (round(random 10) <= 5) then
|
||||
{
|
||||
//_item = selectRandom blck_specialItems;
|
||||
//diag_log format["spawnUnit.sqf] -- Item is %1", _item];
|
||||
_ai1 addItem selectRandom blck_specialItems;
|
||||
};
|
||||
|
||||
if (_Launcher != "none") then
|
||||
{
|
||||
private["_bpck"];
|
||||
_ai1 addWeaponGlobal _Launcher;
|
||||
for "_i" from 1 to 3 do
|
||||
{
|
||||
_ai1 addItemToBackpack (getArray (configFile >> "CfgWeapons" >> _Launcher >> "magazines") select 0); // call BIS_fnc_selectRandom;
|
||||
};
|
||||
_ai1 setVariable["Launcher",_launcher];
|
||||
};
|
||||
|
||||
if(sunOrMoon < 0.2 && blck_useNVG)then
|
||||
{
|
||||
_ai1 addWeapon selectRandom blck_NVG;
|
||||
_ai1 setVariable ["hasNVG", true];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_ai1 setVariable ["hasNVG", false];
|
||||
};
|
||||
|
||||
// Infinite ammo
|
||||
//_ai1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1;}];
|
||||
_ai1 addEventHandler ["reloaded", {_this call compile preprocessfilelinenumbers blck_EH_unitWeaponReloaded;}];
|
||||
_ai1 addEventHandler ["killed",{ [(_this select 0), (_this select 1)] call compile preprocessfilelinenumbers blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }];
|
||||
_ai1 addEventHandler ["Hit",{ [_this] call compile preprocessFileLineNumbers blck_EH_AHHit;}];
|
||||
//_ai1 addEventHandler ["FiredNear",{diag_log "-------->>>>>>>> Weapon fired Near Unit";}];
|
||||
//_ai1 addEventHandler ["FiredNear",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIFiredNear;};];
|
||||
|
||||
switch (_skillLevel) do
|
||||
{
|
||||
case "blue": {_index = 0;_aiSkills = blck_SkillsBlue;};
|
||||
case "red": {_index = 1;_aiSkills = blck_SkillsRed;};
|
||||
case "green": {_index = 2;_aiSkills = blck_SkillsGreen;};
|
||||
case "orange": {_index = 3;_aiSkills = blck_SkillsOrange;};
|
||||
default {_index = 0;_aiSkills = blck_SkillsBlue;};
|
||||
};
|
||||
|
||||
//_alertDist = blck_AIAlertDistance select _index;
|
||||
//_intelligence = blck_AIIntelligence select _index;
|
||||
|
||||
[_ai1,_aiSkills] call blck_fnc_setSkill;
|
||||
_ai1 setVariable ["alertDist",blck_AIAlertDistance select _index,true];
|
||||
_ai1 setVariable ["intelligence",blck_AIIntelligence select _index,true];
|
||||
_ai1 setVariable ["GMS_AI",true,true];
|
||||
|
||||
_ai1
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
// Configures a mission vehicle
|
||||
/*
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 3-14-17
|
||||
|
||||
spawns a vehicle of _vehType and mans it with units in _group.
|
||||
returns _veh, the vehicle spawned.
|
||||
--------------------------
|
||||
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["_veh",["_clearInventory",true]];
|
||||
private["_unit"];
|
||||
if (_clearInventory) then
|
||||
{
|
||||
[_veh] call blck_fnc_emptyObject;
|
||||
};
|
||||
_veh setVehicleLock "LOCKEDPLAYER";
|
||||
_veh addEventHandler ["GetIn",{ // Note: only fires when vehicle is local to player
|
||||
private["_unit","_veh"];
|
||||
_unit = _this select 2;
|
||||
_veh = _this select 0;
|
||||
if (isPlayer _unit) then
|
||||
{
|
||||
_unit action ["eject",_veh];
|
||||
titleText ["You are not allowed to enter that vehicle at this time","PLAIN DOWN"];
|
||||
};
|
||||
}];
|
||||
|
||||
_veh
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 3-14-17
|
||||
|
||||
spawns a vehicle of _vehType and mans it with units in _group.
|
||||
returns _veh, the vehicle spawned.
|
||||
--------------------------
|
||||
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 "Vehicle Decommisioning handler activated";
|
||||
params["_veh"];
|
||||
|
||||
if (_veh getVariable["DBD_vehType","none"] isEqualTo "emplaced") then // Deal with a static weapon
|
||||
{
|
||||
if (blck_killEmptyStaticWeapons) then
|
||||
{
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_vehicleMonitor:: case of destroyed where vehicle = %1",_veh];};
|
||||
_veh setDamage 1;
|
||||
_veh setVariable["blck_DeleteAt",diag_tickTime + 60];
|
||||
} else {
|
||||
[_veh] call blck_fnc_releaseVehicleToPlayers;
|
||||
};
|
||||
}else { // Deal with vehicles
|
||||
if (blck_killEmptyAIVehicles) then
|
||||
{
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle destroyed where vehicle = %1",_veh];};
|
||||
{
|
||||
_veh setHitPointDamage [_x, 1];
|
||||
|
||||
} forEach ["HitLFWheel","HitLF2Wheel","HitRFWheel","HitRF2Wheel","HitEngine","HitLBWheel","HitLMWheel","HitRBWheel","HitRMWheel","HitTurret","HitGun","HitTurret","HitGun","HitTurret","HitGun","HitTurret","HitGun"];
|
||||
_veh setVariable["blck_DeleteAt",diag_tickTime + 60];
|
||||
} else {
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fnc_vehicleMonitor:: case of release vehicle = %1 to player with blck_monitoredVehicles = %2",_veh, blck_monitoredVehicles];};
|
||||
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fnc_vehicleMonitor:: blck_monitoredVehicles updated to %1", blck_monitoredVehicles];};
|
||||
[_veh] call blck_fnc_releaseVehicleToPlayers;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
_ai_veh = _this select 0;
|
||||
|
||||
_if (_ai_veh getVariable["disabled",false]) exitWith {};
|
||||
|
||||
_ai_veh setVariable["disabled",true];
|
||||
//_ai_veh_type = typeof _ai_veh;
|
||||
//_ai_veh_name = name _ai_veh;
|
||||
|
||||
_ai_veh setFuel 0;
|
||||
_ai_veh setVehicleAmmo 0;
|
||||
_ai_veh setAmmoCargo 0;
|
||||
|
||||
_s = ["MOTOR",
|
||||
"wheel_1_1_steering","wheel_2_1_steering","wheel_1_2_steering","wheel_2_2_steering",
|
||||
"wheel_1_3_steering","wheel_2_3_steering","wheel_1_4_steering","wheel_2_4_steering"];
|
||||
{_ai_veh setHit [_x,1]} forEach _s;
|
@ -0,0 +1,28 @@
|
||||
// Protect Vehicles from being cleaned up by the server
|
||||
// Last modified 2/26/16 by Ghostrider-DBD-
|
||||
/*
|
||||
--------------------------
|
||||
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"];
|
||||
|
||||
private["_modType"];
|
||||
_modType = call blck_fnc_getModType;
|
||||
switch (_ModType) do {
|
||||
case "Epoch":
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["GMS_fnc_protectVehicle:: Tokens set for vehicle %1",_Vehicle];};
|
||||
#endif
|
||||
//_Vehicle call EPOCH_server_vehicleInit;
|
||||
_Vehicle call EPOCH_server_setVToken;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
Handle the case that all AI assigned to a vehicle are dead.
|
||||
Allows players to enter and use the vehicle.
|
||||
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 3-24-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["_v"];
|
||||
//diag_log format["_fnc_releastVehicletoPlayers.sqf: removing vehicle %1 from ",_v,blck_monitoredVehicles];
|
||||
//blck_monitoredVehicles = blck_monitoredVehicles - [_v];
|
||||
_v removeAllEventHandlers "GetIn";
|
||||
_v removeAllEventHandlers "GetOut";
|
||||
_v removeAllEventHandlers "Fired";
|
||||
_v removeAllEventHandlers "Reloaded";
|
||||
_v setVehicleLock "UNLOCKED" ;
|
||||
_v setVariable["releasedToPlayers",true];
|
||||
[_v] call blck_fnc_emptyObject;
|
||||
|
||||
|
||||
//{
|
||||
//_v removealleventhandlers _x;
|
||||
//}forEach["Fired","Hit","HitPart","Reloaded","Dammaged","HandleDamage","GetIn","GetOut"];
|
||||
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1",_v];
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
Last Modified 1/23/17
|
||||
*/
|
||||
params["_grpPilot"];
|
||||
private["_heli","_pilot"];
|
||||
_pilot = (units _grpPilot) select 0;
|
||||
_heli = vehicle _pilot;
|
||||
diag_log "reinforcements deployed:: send heli back to spawn";
|
||||
[[_heli], 300 /* 5 min*/] spawn blck_fnc_addObjToQue;
|
||||
// select a random location abotu 2K from the mission
|
||||
_spawnVector = round(random(360));
|
||||
_spawnDistance = 2000;
|
||||
_pos = getPos _heli;
|
||||
|
||||
// Use the new functionality of getPos
|
||||
// https://community.bistudio.com/wiki/getPos
|
||||
_home = _pos getPos [_spawnDistance,_spawnVector];
|
||||
|
||||
// Send the heli back to base
|
||||
_grpPilot = group this;
|
||||
[_grpPilot, 0] setWPPos _pos;
|
||||
[_grpPilot, 0] setWaypointType "MOVE";
|
||||
[_grpPilot, 0] setWaypointSpeed "FULL";
|
||||
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
|
||||
[_grpPilot, 0] setWaypointCompletionRadius 200;
|
||||
[_grpPilot, 0] setWaypointStatements ["true", "{deleteVehicle _x} forEach units group this;deleteVehicle (vehicle this);diag_log ""helicopter and crew deleted"""];
|
||||
[_grpPilot, 0] setWaypointName "GoHome";
|
||||
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
|
||||
|
||||
|
||||
diag_log "reinforcements:: sending Heli Home";
|
||||
|
||||
|
@ -0,0 +1,199 @@
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 3-17-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","_skillAI","_weapons","_uniforms","_headGear","_helis"];
|
||||
_coords = _this select 0;
|
||||
_skillAI = _this select 1;
|
||||
_weapons = _this select 2;
|
||||
_uniforms = _this select 3;
|
||||
_headGear = _this select 4;
|
||||
_helis = _this select 5;
|
||||
|
||||
/*
|
||||
Handles upper level functions of reinforcements utilizing helicoptor patrols and/or spawned from a helicopter.
|
||||
Calls on functions that spawn paratroops and/or loot chests at the heli's location.
|
||||
|
||||
Tasks are:
|
||||
1) spawn a heli over the mission center.
|
||||
2) add crew and gunners
|
||||
3) spawn paratroops
|
||||
4) configure waypointScript
|
||||
5) return the _heli that was spawned.
|
||||
*/
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (38):: _helis = %1",_helis];
|
||||
};
|
||||
#endif
|
||||
|
||||
private["_grpPilot","_chopperType","_patrolHeli","_launcherType","_unitPilot","_unitCrew","_mags","_turret","_return","_abort"];
|
||||
_abort = false;
|
||||
_grpPilot = createGroup blck_AI_Side;
|
||||
if (isNull _grpPilot) then
|
||||
{
|
||||
diag_log "BLCK_ERROR: _fnc_spawnMissionHeli::_->> NULL GROUP Returned for _grpPilot";
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
_grpParatroops = createGroup blck_AI_Side;
|
||||
if (isNull _grpParatroops) then
|
||||
{
|
||||
diag_log "BLCK_ERROR: _fnc_spawnMissionHeli::_->> NULL GROUP Returned for _grpParatroops";
|
||||
_abort = true;
|
||||
};
|
||||
if (!(isNull _grpPilot) && !(isNull _grpParatroops)) then
|
||||
{
|
||||
_grpPilot setBehaviour "COMBAT";
|
||||
_grpPilot setCombatMode "RED";
|
||||
_grpPilot setSpeedMode "NORMAL";
|
||||
_grpPilot allowFleeing 0;
|
||||
_grpPilot setVariable["patrolCenter",_coords];
|
||||
_grpPilot setVariable["minDis",15];
|
||||
_grpPilot setVariable["maxDis",30];
|
||||
_grpPilot setVariable["timeStamp",diag_tickTime];
|
||||
_grpPilot setVariable["arc",0];
|
||||
_grpPilot setVariable["wpRadius",30];
|
||||
_grpPilot setVariable["wpMode","SAD"];
|
||||
|
||||
private["_supplyHeli"];
|
||||
//create helicopter and spawn it
|
||||
_chopperType = selectRandom _helis;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (78):: _chopperType seleted = %1",_chopperType];
|
||||
};
|
||||
#endif
|
||||
|
||||
_patrolHeli = createVehicle [_chopperType, _coords, [], 90, "FLY"];
|
||||
_grpPilot setVariable["groupVehicle",_patrolHeli];
|
||||
[_patrolHeli] call blck_fnc_protectVehicle;
|
||||
_patrolHeli setFuel 1;
|
||||
_patrolHeli engineOn true;
|
||||
_patrolHeli flyInHeight 100;
|
||||
_patrolHeli setVehicleLock "LOCKED";
|
||||
_patrolHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (93):: heli %1 spawned",_patrolHeli];
|
||||
};
|
||||
#endif
|
||||
|
||||
[_patrolHeli] call blck_fnc_emptyObject;
|
||||
|
||||
_launcherType = "none";
|
||||
_unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _patrolHeli, [], 0, "FORM"];
|
||||
_unitPilot = [[100,100,100],_weapons,_grpPilot,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
|
||||
_unitPilot setSkill 1;
|
||||
_unitPilot assignAsDriver _patrolHeli;
|
||||
_unitPilot moveInDriver _patrolHeli;
|
||||
_grpPilot selectLeader _unitPilot;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (113):: pilot %1 spawned",_unitPilot];
|
||||
};
|
||||
#endif
|
||||
|
||||
_turrets = allTurrets [_patrolHeli,false];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log "_fnc_spawnMissionHeli (103): preparing to clear out blacklisted turrets";
|
||||
};
|
||||
#endif
|
||||
|
||||
{
|
||||
if ( (_patrolHeli weaponsTurret _x) in blck_blacklisted_heli_weapons) then
|
||||
{
|
||||
private["_mags","_turret"];
|
||||
_mags = _patrolHeli magazinesTurret _x;
|
||||
_turret = _x;
|
||||
{
|
||||
_patrolHeli removeMagazines [_x,_turret];
|
||||
} forEach _mags;
|
||||
_patrolHeli removeWeaponTurret _turret;
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (118)::-->> weapon %1 and its ammo removed from heli %2 for turret %3",_patrolHeli weaponsTurret _x,_patrolHeli, _x];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// B_helicrew_F
|
||||
_unitCrew = [(getPosATL _patrolHeli),_weapons,_grpPilot,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
|
||||
_unitCrew assignAsTurret [_patrolHeli, _x];
|
||||
_unitCrew moveInTurret [_patrolHeli, _x];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_spawnMissionHeli (12798)::-- >> unit %1 moved into turret %2 of vehicle %3",_unitCrew,_x,_patrolHeli];
|
||||
#endif
|
||||
};
|
||||
}forEach _turrets;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (133)::-->> Heli %1 outfited with a crew numbering %2",_patrolHeli, crew _patrolHeli];
|
||||
};
|
||||
#endif
|
||||
|
||||
// params["_missionPos","_paraGroup",["_numAI",3],"_skillAI","_weapons","_uniforms","_headGear",["_heli",objNull],_grpParatroops];
|
||||
//params["_coords","_skillAI","_weapons","_uniforms","_headGear",["_grpParatroops",grpNull],["_heli",objNull]];
|
||||
if !(isNull _grpParatroops) then
|
||||
{
|
||||
[_coords,_skillAI,_weapons,_uniforms,_headGear,_grpParatroops,_patrolHeli] call blck_fnc_spawnMissionParatroops;
|
||||
};
|
||||
|
||||
//set waypoint for helicopter
|
||||
[_coords,30,35,_grpPilot,"random","SENTRY"] spawn blck_fnc_setupWaypoints;
|
||||
|
||||
blck_monitoredMissionAIGroups pushBack _grpPilot;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli (153):: initial pilot waypoints set"];
|
||||
[_patrolHeli] spawn {
|
||||
params["_patrolHeli"];
|
||||
diag_log "_fnc_spawnMissionHeli:-> spawning crew monitoring loop";
|
||||
while {!isNull _patrolHeli} do
|
||||
{
|
||||
uiSleep 120;
|
||||
diag_log format["_fnc_spawnMissionHeli:-> heli %1 has %2 crew alive",_patrolHeli, {alive _x} count crew _patrolHeli];
|
||||
diag_log format["_fnc_spawnMissionHeli:-> heli %1 fullCrew = %2",_patrolHeli, fullCrew _patrolHeli];
|
||||
};
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
};
|
||||
private["_ai"];
|
||||
_ai = (units _grpParatroops) + (units _grpPilot);
|
||||
_return = [_patrolHeli,_ai,_abort];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionHeli:: function returning value for _return of %1",_return];
|
||||
};
|
||||
#endif
|
||||
|
||||
_return;
|
@ -0,0 +1,109 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
3/17/17
|
||||
|
||||
This is basically a container that determines whether a paragroop group should be created and if so creates a group and passes it off to the routine that spawns the paratroops.
|
||||
|
||||
--------------------------
|
||||
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","_skillAI","_weapons","_uniforms","_headGear",["_grpParatroops",grpNull],["_heli",objNull]];
|
||||
|
||||
private["_grpParatroops","_chanceParatroops","_aborted","_return"];
|
||||
|
||||
_aiSkillsLevel = toLower _aiSkillsLevel;
|
||||
_chanceParatroops = 0;
|
||||
_noPara = 0;
|
||||
_aborted = false;
|
||||
|
||||
if (_aiSkillsLevel isEqualTo "blue") then {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugON) then {diag_log "_fnc_spawnMissionParatroops: BLUE difficulty settings applied";};
|
||||
#endif
|
||||
|
||||
_chanceParatroops = blck_chanceParaBlue;
|
||||
_noPara = blck_noParaBlue;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "green") then {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugON) then {diag_log "_fnc_spawnMissionParatroops: GREEN difficulty settings applied";};
|
||||
#endif
|
||||
|
||||
_chanceParatroops = blck_chanceParaGreen;
|
||||
_noPara = blck_noParaGreen;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "orange") then {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugON) then {diag_log "_fnc_spawnMissionParatroops: ORANGE difficulty settings applied";};
|
||||
#endif
|
||||
|
||||
_chanceParatroops = blck_chanceParaOrange;
|
||||
_noPara = blck_noParaOrange;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "red") then {
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugON) then {diag_log "_fnc_spawnMissionParatroops: RED difficulty settings applied";};
|
||||
#endif
|
||||
|
||||
_chanceParatroops = blck_chanceParaRed;
|
||||
_noPara = blck_noParaRed;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnMissionParatroops (47): _chanceParatroops %1",_chanceParatroops];};
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnMissionParatroops (48): _coords %1 | _numAI %2 | _skillAI %3 | _grpParatroops %4 | _heli %5",_coords,_noPara,_skillAI,_grpParatroops,_heli];};
|
||||
#endif
|
||||
|
||||
if ( (random(1) < _chanceParatroops)) then
|
||||
{
|
||||
if (isNull _grpParatroops) then
|
||||
{
|
||||
_grpParatroops = createGroup blck_AI_Side;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionParatroops (53):No group passed as a parameter, _grpParatroops %4 created",_grpParatroops];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["_fnc_spawnMissionParatroops (58): function running and group %1 successfully created; now calling blck_fnc_spawnParaUnits",_grpParatroops];
|
||||
};
|
||||
#endif
|
||||
|
||||
//params["_missionPos","_paraGroup",["_numAI",3],"_skillAI","_weapons","_uniforms","_headGear",["_heli",objNull]];
|
||||
_aborted = [_coords,_grpParatroops,_noPara,_skillAI,_weapons,_uniforms,_headGear,_heli] call blck_fnc_spawnParaUnits;
|
||||
//diag_log format["_fnc_spawnMissionParatroops: blck_fnc_spawnParaUnits returned a value of %1",_aborted];
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_spawnMissionParatroops: _aborted = %1",_aborted];
|
||||
#endif
|
||||
if (_aborted) then
|
||||
{
|
||||
_return = [[],true];
|
||||
} else {
|
||||
_return = [(units _grpParatroops),false];
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_spawnMissionParatroops:-> _return = %1 | _abort = %2",_return,_aborted];
|
||||
#endif
|
||||
|
||||
_return
|
||||
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
call with
|
||||
[
|
||||
_supplyHeli, // heli from which they should para
|
||||
_lootCounts,
|
||||
_lootSetting // [blue, red, green, orange]
|
||||
] call blck_spawnHeliParaCrate
|
||||
|
||||
** here for future usage **
|
||||
--------------------------
|
||||
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["_supplyHeli","_lootCounts"];
|
||||
|
||||
private ["_chute","_crate"];
|
||||
_crate = "";
|
||||
_chute = "";
|
||||
|
||||
diag_log "_fnc_spawnParaCrate:: spawning crate";
|
||||
|
||||
private["_dir","_offset"];
|
||||
_dir = getDir _supplyHeli;
|
||||
_dir = if (_dir < 180) then {_dir + 210} else {_dir - 210};
|
||||
_offset = _supplyHeli getPos [10, _dir];
|
||||
|
||||
//open parachute and attach to crate
|
||||
_chute = createVehicle ["I_Parachute_02_F", [100, 100, 100], [], 0, "FLY"];
|
||||
[_chute] call blck_fnc_protectVehicle;
|
||||
_chute setPos [_offset select 0, _offset select 1, 100 ]; //(_offset select 2) - 10];
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: chute spawned yielding object %1 at postion %2", _chute, getPos _chute];
|
||||
|
||||
//create the parachute and crate
|
||||
private["_crateSelected"];
|
||||
_crateSelected = selectRandom["Box_FIA_Ammo_F","Box_FIA_Support_F","Box_FIA_Wps_F","I_SupplyCrate_F","Box_IND_AmmoVeh_F","Box_NATO_AmmoVeh_F","Box_East_AmmoVeh_F","IG_supplyCrate_F"];
|
||||
_crate = [getPos _chute, _crateSelected] call blck_fnc_spawnCrate;
|
||||
//_crate = createVehicle [_crateSelected, position _chute, [], 0, "CAN_COLLIDE"];
|
||||
_crate setPos [position _supplyHeli select 0, position _supplyHeli select 1, 250]; //(position _supplyHeli select 2) - 10];
|
||||
_crate attachTo [_chute, [0, 0, -1.3]];
|
||||
_crate allowdamage false;
|
||||
_crate enableRopeAttach true; // allow slingloading where possible
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: crate spawned %1 at position %2 and attached to %3",_crate, getPos _crate, attachedTo _crate];
|
||||
|
||||
|
||||
switch (_lootSetting) do
|
||||
{
|
||||
case "orange": {[_crate, blck_BoxLoot_Orange, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "green": {[_crate, blck_BoxLoot_Green, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "red": {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
case "blue": {[_crate, blck_BoxLoot_Blue, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
default {[_crate, blck_BoxLoot_Red, _lootCounts] call blck_fnc_fillBoxes;};
|
||||
};
|
||||
|
||||
diag_log format["_fnc_spawnParaCrate:: crate loaded and now at position %1 and attached to %2", getPos _crate, attachedTo _crate];
|
||||
|
||||
_fn_monitorCrate = {
|
||||
params["_crate","_chute"];
|
||||
uiSleep 30;
|
||||
private["_crateOnGround"];
|
||||
_crateOnGround = false;
|
||||
while {!_crateOnGround} do
|
||||
{
|
||||
uiSleep 1;
|
||||
diag_log format["_fnc_spawnParaCrate:: Crate Altitude: %1 Crate Velocity: %2 Crate Position: %3 Crate attachedTo %4", getPos _crate select 2, velocityModelSpace _crate select 2, getPosATL _crate, attachedTo _crate];
|
||||
if ( (((velocity _crate) select 2) < 0.1) || ((getPosATL _crate select 2) < 0.1) ) exitWith
|
||||
{
|
||||
uiSleep 10; // give some time for everything to settle
|
||||
detach _crate;
|
||||
deleteVehicle _chute;
|
||||
if (surfaceIsWater (getPos _crate)) then
|
||||
{
|
||||
deleteVehicle _crate;
|
||||
} else
|
||||
{
|
||||
[_crate] call blck_fnc_signalEnd;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[_crate,_chute] call _fn_monitorCrate;
|
||||
[[_crate], 1200 /* 20 min*/] spawn blck_fnc_addObjToQue;
|
@ -0,0 +1,82 @@
|
||||
/*
|
||||
Author: Ghostrider-DbD-
|
||||
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
|
||||
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
3/17/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/
|
||||
--------------------------
|
||||
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["_missionPos","_paraGroup","_numAI","_skillAI","_weapons","_uniforms","_headGear",["_heli",objNull]];
|
||||
private["_arc","_dir","_spawnPos","_chute","_unit","_launcherType","_aborted"];
|
||||
_aborted = false;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_spawnParaUnits (17)::_missionPos %1 | _paraGroup %2 | _numAI %3 | _skillAI %4 | _heli = %5",_missionPos,_paraGroup,_numAI,_skillAI,_heli];
|
||||
#endif
|
||||
|
||||
if (isNull _paraGroup) then
|
||||
{
|
||||
_aborted = true;
|
||||
} else {
|
||||
_paraGroup setVariable["groupVehicle",objNull];
|
||||
_launcherType = "none";
|
||||
private ["_arc","_spawnPos"];
|
||||
_arc = 45;
|
||||
_dir = 0;
|
||||
_pos = _missionPos;
|
||||
for "_i" from 1 to _numAI do
|
||||
{
|
||||
if (_heli isKindOf "Air") then {_pos = getPos _heli};
|
||||
_spawnPos = _pos getPos[1.5,_dir];
|
||||
_chute = createVehicle ["Steerable_Parachute_F", [100, 100, 200], [], 0, "FLY"];
|
||||
[_chute] call blck_fnc_protectVehicle;
|
||||
_unit = [[_spawnPos select 0, _spawnPos select 1, 100],_weapons,_paraGroup,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
|
||||
_chute setPos [_spawnPos select 0, _spawnPos select 1, 125]; //(_offset select 2) - 10];
|
||||
_unit assignAsDriver _chute;
|
||||
_unit moveInDriver _chute;
|
||||
_unit allowDamage true;
|
||||
_dir = _dir + _arc;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnParaUnits:: spawned unit %1, at location %2 and vehicle _unit %1",_unit,getPos _unit, vehicle _unit];
|
||||
};
|
||||
#endif
|
||||
|
||||
uiSleep 2;
|
||||
};
|
||||
_paraGroup selectLeader ((units _paraGroup) select 0);
|
||||
//params["_pos","_minDis","_maxDis","_group"];
|
||||
// [_pos,_minDist,_maxDist,_groupSpawned,"random","SAD"] spawn blck_fnc_setupWaypoints;
|
||||
[_missionPos,20,30,_paraGroup,"random","SAD","paraUnits"] call blck_fnc_setupWaypoints;
|
||||
blck_monitoredMissionAIGroups pushback _paraGroup;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log "_fnc_spawnParaUnits (44): All Units spawned";
|
||||
};
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_fnc_spawnParaUnits: _aborted = %1",_aborted];
|
||||
#endif
|
||||
|
||||
_aborted;
|
||||
|
||||
|
||||
|
@ -0,0 +1,113 @@
|
||||
/*
|
||||
for DBD Clan
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last Modified 3-17-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","_aiSkillsLevel","_weapons","_uniforms","_headgear"];
|
||||
_coords = _this select 0;
|
||||
_aiSkillsLevel = _this select 1;
|
||||
_weapons = _this select 2;
|
||||
_uniforms = _this select 3;
|
||||
_headgear = _this select 4;
|
||||
|
||||
private["_chanceHeliPatrol","_return","_temp","_missionHelis"];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["_fnc_spawnMissionReinforcements (25): Script Starting with _aiSkillsLevel = %1",_aiSkillsLevel]};
|
||||
#endif
|
||||
_aiSkillsLevel = toLower _aiSkillsLevel;
|
||||
|
||||
if (_aiSkillsLevel isEqualTo "blue") then {
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "_fnc_spawnMissionReinforcements (29): BLUE difficulty settings applied";};
|
||||
#endif
|
||||
_chanceHeliPatrol = blck_chanceHeliPatrolBlue;
|
||||
_missionHelis = blck_patrolHelisBlue;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "green") then {
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "_fnc_spawnMissionReinforcements (34): GREEN difficulty settings applied";};
|
||||
#endif
|
||||
_chanceHeliPatrol = blck_chanceHeliPatrolGreen;
|
||||
_missionHelis = blck_patrolHelisGreen;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "orange") then {
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "_fnc_spawnMissionReinforcements (39): ORANGE difficulty settings applied";};
|
||||
#endif
|
||||
_chanceHeliPatrol = blck_chanceHeliPatrolOrange;
|
||||
_missionHelis = blck_patrolHelisOrange;
|
||||
};
|
||||
if (_aiSkillsLevel isEqualTo "red") then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "_fnc_spawnMissionReinforcements (46): RED difficulty settings applied";};
|
||||
#endif
|
||||
_chanceHeliPatrol = blck_chanceHeliPatrolRed;
|
||||
_missionHelis = blck_patrolHelisRed;
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnMissionReinforcements (50): Variables defined: _chanceHeliPatrol %1 | _missionHelis %2",_chanceHeliPatrol,_missionHelis];};
|
||||
#endif
|
||||
if ( (_chanceHeliPatrol > 0) && (random (1) < _chanceHeliPatrol) ) then // if helipatrols are 'enabled' then paratroops will only drop if a heli spawns.
|
||||
// The chance that they drop is linked to the value for them for that difficulty _aiSkillsLevel
|
||||
//see _fnc_spannMissionParatroops for how this is handled.
|
||||
{
|
||||
_temp = [objNull,[],false];
|
||||
//params["_coords","_aiSkillsLevel",,"_weapons","_uniforms","_headgear""_helis"];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log "_fnc_spawnMissionReinforcements (64): calling _fnc_spawnMissionHeli to spawn heli and paratroops";
|
||||
};
|
||||
#endif
|
||||
|
||||
_temp = [_coords,_aiSkillsLevel,_weapons,_uniforms,_headgear,_missionHelis] call blck_fnc_spawnMissionHeli;
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_return = [_temp select 0, _temp select 1, _temp select 2];
|
||||
}
|
||||
else
|
||||
{
|
||||
_return = [objNull, [], true];
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnMissionReinforcements (66): blck_fnc_spawnMissionHeli returned value of %1 for _return",_return];};
|
||||
#endif
|
||||
|
||||
} else {
|
||||
if (blck_debugLevel > 2) then {diag_log "_fnc_spawnMissionReinforcements (68): calling _fnc_spawnMissionParatroops to spawn para reinforcements";};
|
||||
_temp = [objNull,[],false];
|
||||
// params["_coords","_skillAI","_weapons","_uniforms","_headgear"];
|
||||
_temp = [_coords,_aiSkillsLevel,_weapons,_uniforms,_headgear] call blck_fnc_spawnMissionParatroops;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {
|
||||
diag_log format["_fnc_spawnMissionReinforcements (71):: blck_fnc_spawnMissionParatroops returned value for _paratroops of %1",_temp];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_return = [objNull, _temp select 0 /*units*/, _temp select 1 /*true/false*/];
|
||||
} else {
|
||||
_return = [objNull, [],true];
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnMissionReinforcements (74):: _return = %1",_return];};
|
||||
#endif
|
||||
|
||||
_return
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
Spawn a vehicle and protect it against cleanup by Epoch
|
||||
Returns the object (vehicle) created.
|
||||
By Ghostrider-DBD-
|
||||
Last modified 1-27-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["_veh","_modType"];
|
||||
params["_vehType","_pos",["_clearInventory",true]];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf: _vehType = %1 | _pos = %2",_vehType,_pos];};
|
||||
#endif
|
||||
|
||||
_veh = createVehicle[_vehType, _pos, [], 0, "NONE"];
|
||||
[_veh] call blck_fnc_protectVehicle;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf:: vehicle spawned is %1",_veh];};
|
||||
#endif
|
||||
// params["_veh",["_clearInventory",true]];
|
||||
[_veh,_clearInventory] call blck_fnc_configureMissionVehicle;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];};
|
||||
#endif
|
||||
|
||||
_veh
|
||||
|
@ -0,0 +1,115 @@
|
||||
/*
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 3-17-17
|
||||
|
||||
spawns a vehicle of _vehType and mans it with units in _group.
|
||||
returns _veh, the vehicle spawned.
|
||||
--------------------------
|
||||
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["_vehType","_safepos","_veh"];
|
||||
params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]];
|
||||
|
||||
|
||||
//_center Center of the mission area - this is usuall the position treated as the center by the mission spawner. Vehicles will patrol the perimeter of the mission area.
|
||||
// _pos the approximate spawn point for the vehicle
|
||||
//_vehType = [_this,1,"I_G_Offroad_01_armed_F"] call BIS_fnc_param;
|
||||
//_minDis = minimum distance from the center of the mission for vehicle waypoints
|
||||
//_maxDis = maximum distance from the center of the mission for vehicle waypoints
|
||||
//_groupForVehiclePatrol = The group with which to man the vehicle
|
||||
|
||||
//#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnVehiclePatrol:: _center = %1 | _pos = %2 | _vehType = %3 | _group = %4",_center,_pos,_vehType,_group];
|
||||
};
|
||||
//#endif
|
||||
|
||||
if !(isNull _group) then
|
||||
{ // exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnVehiclePatrol"; objNull;};
|
||||
_veh = [_vehType,_pos] call blck_fnc_spawnVehicle;
|
||||
_group setVariable["groupVehicle",_veh];
|
||||
//#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["spawnVehiclePatrol:: vehicle spawned is %1 of typeof %2",_veh, typeOf _veh];
|
||||
};
|
||||
//#endif
|
||||
|
||||
private["_unitNumber"];
|
||||
_unitNumber = 0;
|
||||
|
||||
{
|
||||
switch (_unitNumber) do
|
||||
{
|
||||
case 0: {_x moveingunner _veh;};
|
||||
case 1: {_x moveindriver _veh;};
|
||||
default {_x moveInCargo _veh;};
|
||||
};
|
||||
_unitNumber = _unitNumber + 1;
|
||||
}forEach (units _group);
|
||||
|
||||
// params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]];
|
||||
_group setcombatmode "RED";
|
||||
_group setBehaviour "COMBAT";
|
||||
[_center,_minDis,_maxDis,_group,"perimeter","SAD","vehicle"] spawn blck_fnc_setupWaypoints;
|
||||
};
|
||||
//#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["_fnc_spawnVehiclePatrol::->> _veh = %1",_veh];
|
||||
};
|
||||
//#endif
|
||||
_veh
|
||||
/*
|
||||
while {(count (waypoints _group)) > 0} do
|
||||
{
|
||||
deleteWaypoint ((waypoints _group) select 0);
|
||||
};
|
||||
|
||||
_count = 5;
|
||||
_start = _center getDir _pos;
|
||||
_angle = _start;
|
||||
_sign = selectRandom [1, -1];
|
||||
_arc = _sign * 360/_count;
|
||||
for "_i" from 1 to _count do
|
||||
{
|
||||
_angle = _angle + _arc;
|
||||
_p2 = _center getPos [(_minDis + random(_maxDis - _minDis)),_angle];
|
||||
|
||||
|
||||
if (_i isEqualTo 1) then
|
||||
{
|
||||
_wp = [_group, 0];
|
||||
_wp setWaypointPosition [_p2, 25];
|
||||
} else {
|
||||
_wp = _group addWaypoint [_p2, 25];
|
||||
};
|
||||
_wp setWaypointType "MOVE";
|
||||
_wp setWaypointName "move";
|
||||
_wp setWaypointBehaviour "AWARE";
|
||||
_wp setWaypointCombatMode blck_combatMode;
|
||||
_wp setWaypointTimeout [1,1.1,1.2];
|
||||
_wp = _group addWaypoint [_p2, 25];
|
||||
_wp setWaypointType "SAD";
|
||||
_wp setWaypointName "sentry";
|
||||
_wp setWaypointBehaviour "AWARE";
|
||||
_wp setWaypointCombatMode blck_combatMode;
|
||||
_wp setWaypointTimeout [10,17.5,25];
|
||||
};
|
||||
_wp = _group addWaypoint [_pos, 25];
|
||||
_wp setWaypointType "CYCLE";
|
||||
_group setVariable["wpIndex",0];
|
||||
|
||||
};
|
||||
|
||||
|
||||
*/
|
||||
|
@ -0,0 +1,176 @@
|
||||
/*
|
||||
Handle the case that all AI assigned to a vehicle are dead.
|
||||
Allows players to enter and use the vehicle when appropriate
|
||||
or otherwise destroys the vehicle.
|
||||
|
||||
Logic:
|
||||
1) Mission ended; players can keep vehicles BUT not all vehicle AI were killed - > delete vehicle when live AI are killed;
|
||||
2) Vehicle has a blck_deleteAT timer set - > delete vehicle;
|
||||
3) All AI killed an players may NOT keep vehicles - > detroy vehicle
|
||||
4) All AI Killed and players MAY keep vehicles -> release vehicle
|
||||
5) vehicle ammo low AND vehicle gunner is alive - > reloaded
|
||||
|
||||
By Ghostrider-DBD-
|
||||
Copyright 2016
|
||||
Last updated 1-22-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 "_fnc_vehicleMonitor: starting function";
|
||||
#ifdef blck_debugMode
|
||||
//diag_log format["_fnc_vehicleMonitor:: blck_debugMode defined"];
|
||||
#endif
|
||||
|
||||
_fn_releaseVehicle = {
|
||||
params["_v"];
|
||||
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
_v setVehicleLock "UNLOCKED" ;
|
||||
//_v setVariable["releasedToPlayers",true];
|
||||
//[_v] call blck_fnc_emptyObject;
|
||||
{
|
||||
_v removealleventhandlers _x;
|
||||
} forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 3) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1",_v];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
_fn_destroyVehicleAndCrew = {
|
||||
params["_veh"];
|
||||
private["_crew"];
|
||||
_crew = crew _veh;
|
||||
{[_x] call blck_fnc_deleteAI;} forEach _crew;
|
||||
[_veh] call blck_fn_deleteAIvehicle;
|
||||
};
|
||||
|
||||
_fn_reloadAmmo = {
|
||||
params["_veh"];
|
||||
private ["_crew","_mag","_allMags","_cnt"];
|
||||
// https://community.bistudio.com/wiki/fullCrew
|
||||
// 0 1 2 3 4
|
||||
// returns Array - format [[<Object>unit,<String>role,<Number>cargoIndex,<Array>turretPath,<Boolean>personTurret], ...]
|
||||
//diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
|
||||
if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then
|
||||
{
|
||||
_crew = fullCrew _veh;
|
||||
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
|
||||
{
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x];
|
||||
_mag = _veh currentMagazineTurret (_x select 3);
|
||||
if (count _mag > 0) then
|
||||
{
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag];
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag];
|
||||
_allMags = magazinesAmmo _veh;
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags];
|
||||
_cnt = ( {_mag isEqualTo (_x select 0)}count _allMags);
|
||||
//diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt];
|
||||
if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]};
|
||||
};
|
||||
} forEach _crew;
|
||||
};
|
||||
};
|
||||
blck_fn_deleteAIvehicle = {
|
||||
params["_veh"];
|
||||
{
|
||||
_veh removeAllEventHandlers _x;
|
||||
}forEach ["Hit","HitPart","GetIn","GetOut","Fired","FiredNear"];
|
||||
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
deleteVehicle _veh;
|
||||
};
|
||||
private ["_veh","_vehList"];
|
||||
_vehList = +blck_monitoredVehicles;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 3) then {diag_log format["_fnc_vehicleMonitor:: function called at %1 with _vehList %2 and blck_monitoredVehicles %3",diag_tickTime,_vehList,blck_monitoredVehicles];};
|
||||
#endif
|
||||
|
||||
{
|
||||
_veh = _x; // (purely for clarity at this point, _x could be used just as well)
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 3) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor: vehicle %1 with missionCompleted = %2 being evaluated",_x, _x getVariable"missionCompleted",0];
|
||||
};
|
||||
#endif
|
||||
private["_evaluate"];
|
||||
_evaluate = true;
|
||||
// Case where vehicle has been marked for deletion after a certain time.
|
||||
if ( (_veh getVariable["blck_DeleteAt",0] > 0) && (diag_tickTime > _veh getVariable "blck_DeleteAt")) then
|
||||
{
|
||||
[_veh] call _fn_destroyVehicleAndCrew;
|
||||
_evaluate = false;
|
||||
};
|
||||
|
||||
// Case where is an emplaced / static wweapon and has no alive crew and such vehicles should be 'killed' or release to players
|
||||
if (_evaluate) then
|
||||
{
|
||||
if ( (_veh getVariable["DBD_vehType","none"] isEqualTo "emplaced") && {alive _x} count crew _veh isEqualTo 0) then
|
||||
{
|
||||
if (blck_killEmptyStaticWeapons) then
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 3) then {diag_log format["_fnc_vehicleMonitor:: case of destroyed where vehicle = %1",_veh];};
|
||||
#endif
|
||||
|
||||
_veh setDamage 1;
|
||||
_veh setVariable["blck_DeleteAt",diag_tickTime + 60];
|
||||
}else {
|
||||
[_veh] call _fn_releaseVehicle;
|
||||
};
|
||||
_evaluate = false;
|
||||
};
|
||||
};
|
||||
|
||||
// Case where a vehicle is NOT an emplaced / static weapon and has no alive crew and such vehicles should be 'killed' or release to players
|
||||
if (_evaluate) then
|
||||
{
|
||||
if (_veh getVariable["DBD_vehType","none"] isEqualTo "none" && ({alive _x} count crew _veh isEqualTo 0) ) then
|
||||
{
|
||||
if (blck_killEmptyAIVehicles) then
|
||||
{
|
||||
_veh setDamage 0.7;
|
||||
_veh setVariable["blck_DeleteAt",diag_tickTime + 60];
|
||||
} else {
|
||||
[_veh] call _fn_releaseVehicle;
|
||||
};
|
||||
_evaluate = false;
|
||||
};
|
||||
};
|
||||
|
||||
// Case where a vehicle is part of a mission that has been completed and containes live AI.
|
||||
if (_evaluate) then
|
||||
{
|
||||
if ( _veh getVariable["missionCompleted",0] > 0 && ({alive _x} count crew _veh > 0)) then
|
||||
{
|
||||
private["_cleanupTimer"];
|
||||
_cleanupTimer = _veh getVariable["cleanupTimer",0]; // The time delat to deleting any alive AI units
|
||||
// "missionCompleted" = the time at which the mission was completed or aborted
|
||||
if (diag_tickTime > ((blck_AliveAICleanUpTimer - 70) + (_veh getVariable["missionCompleted",0])) ) then
|
||||
{
|
||||
[_veh] call _fn_destroyVehicleAndCrew;
|
||||
_evaluate = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_evaluate) then
|
||||
{
|
||||
[_veh] call _fn_reloadAmmo;
|
||||
};
|
||||
}forEach _vehList;
|
||||
|
||||
|
||||
|
112
@ExileServer/addons/custom_server/Compiles/blck_functions.sqf
Normal file
112
@ExileServer/addons/custom_server/Compiles/blck_functions.sqf
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
AI Mission for Epoch Mod for Arma 3
|
||||
By Ghostrider
|
||||
Functions and global variables used by the mission system.
|
||||
Last modified 3/20/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";
|
||||
//blck_functionsCompiled = false;
|
||||
|
||||
// General functions
|
||||
blck_fnc_waitTimer = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_waitTimer.sqf";
|
||||
blck_fnc_timedOut = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_timedOut.sqf";
|
||||
blck_fnc_FindSafePosn = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_findSafePosn.sqf";
|
||||
blck_fnc_randomPosition = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_randomPosn.sqf";// find a randomPosn. see script for details.
|
||||
blck_fnc_findPositionsAlongARadius = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_findPositionsAlongARadius.sqf";
|
||||
blck_fnc_giveTakeCrypto = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_giveTakeCrypto.sqf";
|
||||
blck_fnc_monitorHC = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_monitorHC.sqf";
|
||||
blck_fnc_timeAcceleration = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\TimeAccel\GMS_fnc_Time.sqf";
|
||||
blck_fnc_getModType = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getModType.sqf"; // Test if Epoch or Exile is loaded
|
||||
blck_fnc_groupsOnAISide = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_GroupsOnAISide.sqf"; // Returns the number of groups on the side used by AI
|
||||
blck_fnc_emptyObject = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_emptyObject.sqf";
|
||||
blck_fnc_playerInRange = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_playerInRange.sqf";
|
||||
blck_fnc_playerInRangeArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_playerInRangeArray.sqf"; // GMS_fnc_playerInRangeArray
|
||||
blck_fnc_mainThread = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_mainThread.sqf";
|
||||
blck_fnc_allPlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_allPlayers.sqf";
|
||||
blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_addItemToCrate.sqf";
|
||||
blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_loadLootItemsFromArray.sqf";
|
||||
|
||||
#ifdef DBDserver
|
||||
blck_fnc_broadcastServerFPS = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf";
|
||||
diag_log "blck_functions loaded using DBDServer settings ---- >>>> ";
|
||||
#endif
|
||||
|
||||
// Player-related functions
|
||||
blck_fnc_rewardKiller = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf";
|
||||
blck_fnc_MessagePlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_AIM.sqf"; // Send messages to players regarding Missions
|
||||
|
||||
// Mission-related functions
|
||||
blck_fnc_selectAILoadout = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_selectAILoadout.sqf";
|
||||
blck_fnc_addMissionToQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addMissionToQue.sqf"; //
|
||||
blck_fnc_updateMissionQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_updateMissionQue.sqf"; //
|
||||
blck_fnc_spawnPendingMissions = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnPendingMissions.sqf"; //
|
||||
blck_fnc_addLiveAItoQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addLiveAItoQue.sqf";
|
||||
blck_fnc_addObjToQue = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addObjToQue.sqf"; //
|
||||
//blck_fnc_missionTimer = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionTimer.sqf";
|
||||
blck_fnc_spawnCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnCrate.sqf"; // Simply spawns a crate of a specified type at a specific position.
|
||||
blck_fnc_spawnMissionCrates = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionCrates.sqf";
|
||||
blck_fnc_cleanupObjects = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_cleanUpObjects.sqf";
|
||||
blck_fnc_spawnCompositionObjects = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnBaseObjects.sqf";
|
||||
blck_fnc_spawnRandomLandscape = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnRandomLandscape.sqf";
|
||||
blck_fnc_spawnMissionVehiclePatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionVehiclePatrols.sqf";
|
||||
blck_fnc_spawnEmplacedWeaponArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnEmplacedWeaponArray.sqf";
|
||||
blck_fnc_spawnMissionAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionAI.sqf";
|
||||
blck_fnc_spawnMissionLootVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionLootVehicles.sqf";
|
||||
blck_fnc_fillBoxes = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_fillBoxes.sqf"; // Adds items to an object according to passed parameters. See the script for details.
|
||||
blck_fnc_smokeAtCrates = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_smokeAtCrates.sqf"; // Spawns a wreck and adds smoke to it
|
||||
blck_fnc_spawnMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMines.sqf"; // Deploys mines at random locations around the mission center
|
||||
blck_fnc_clearMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_clearMines.sqf"; // clears mines in an array passed as a parameter
|
||||
blck_fnc_signalEnd = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_signalEnd.sqf"; // deploy smoke grenades at loot crates at the end of the mission.
|
||||
blck_fnc_endMission = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_endMission.sqf";
|
||||
blck_fnc_missionAIareDead = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionAIareDead.sqf";
|
||||
|
||||
// Group-related functions
|
||||
blck_fnc_spawnGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_spawnGroup.sqf"; // Spawn a single group and populate it with AI units]
|
||||
blck_fnc_setupWaypoints = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_setupWaypoints.sqf"; // Set default waypoints for a group
|
||||
blck_fnc_missionGroupMonitor = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_missionGroupMonitor.sqf"; // Monitors active groups for those that are stuck in an SAD waypoint but not in combat
|
||||
blck_fnc_changeToSADWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_changeToSADWaypoint.sqf";
|
||||
blck_fnc_changeToMoveWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_changeToMoveWaypoint.sqf";
|
||||
blck_fnc_changeToSentryWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_changeToSentryWaypoint.sqf"; //
|
||||
//blck_fnc_setNextWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_setNextWaypoint.sqf";
|
||||
blck_fnc_cleanEmptyGroups = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_cleanEmptyGroups.sqf"; // GMS_fnc_cleanEmptyGroups
|
||||
|
||||
// Functions specific to vehicles, whether wheeled, aircraft or static
|
||||
blck_fnc_spawnVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnVehicle.sqf";
|
||||
blck_fnc_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnVehiclePatrol.sqf";
|
||||
blck_fnc_protectVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_protectVehicle.sqf";
|
||||
blck_fnc_configureMissionVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_configureMissionVehicle.sqf";
|
||||
blck_fnc_vehicleMonitor = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_vehicleMonitor.sqf";
|
||||
blck_fnc_spawnMissionReinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnReinforcements.sqf";
|
||||
blck_fnc_spawnMissionHeli = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnMissionHeli.sqf";
|
||||
blck_fnc_spawnMissionParatroops = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnMissionParatroops.sqf"; // Lumped here because these 'jump' from aircraft
|
||||
blck_fnc_spawnParaUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnParaUnits.sqf"; // Lumped here because these 'jump' from aircraft
|
||||
blck_fnc_releaseVehicleToPlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_releaseVehicleToPlayers.sqf"; // GMS_fnc_releaseVehicleToPlayers
|
||||
|
||||
// functions to support Units
|
||||
blck_fnc_removeGear = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"; // Strip an AI unit of all gear.
|
||||
blck_fnc_spawnAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnUnit.sqf"; // spawn individual AI
|
||||
blck_EH_AIKilled = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIKilled.sqf"; // Event handler to process AI deaths
|
||||
blck_EH_AHHit = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIHit.sqf";
|
||||
blck_EH_AIFiredNear = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIFiredNear.sqf";
|
||||
blck_EH_unitWeaponReloaded = "\q\addons\custom_server\Compiles\Units\GMS_EH_unitWeaponReloaded.sqf";
|
||||
blck_fnc_processAIKill = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_processAIKill.sqf";
|
||||
blck_fnc_removeLaunchers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeLaunchers.sqf";
|
||||
blck_fnc_removeNVG = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeNVG.sqf";
|
||||
blck_fnc_alertNearbyUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_alertNearbyUnits.sqf";
|
||||
blck_fnc_alertGroupUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_alertGroupUnits.sqf";
|
||||
blck_fnc_alertNearbyVehicles = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_alertNearbyVehicles.sqf";
|
||||
blck_fnc_processIlleagalAIKills = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_processIlleagalAIKills.sqf";
|
||||
blck_fnc_cleanupDeadAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_cleanupDeadAI.sqf"; // handles deletion of AI bodies and gear when it is time.
|
||||
blck_fnc_setSkill = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_setSkill.sqf";
|
||||
blck_fnc_cleanupAliveAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_cleanupAliveAI.sqf";
|
||||
blck_fnc_deleteAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_deleteAI.sqf";
|
||||
|
||||
diag_log "[blckeagls] Functions Loaded";
|
||||
blck_functionsCompiled = true;
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
AI Mission for Epoch Mod for Arma 3
|
||||
For the Mission System originally coded by blckeagls
|
||||
By Ghostrider
|
||||
Functions and global variables used by the mission system.
|
||||
--------------------------
|
||||
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_debugON = false;
|
||||
blck_debugLevel = 0; // Sets level of detail for debugging info - WIP.
|
||||
blck_minFPS = 10;
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// Do Not Touch Anything Below This Line
|
||||
///////////////////////////////////////////////
|
||||
blck_townLocations = []; //nearestLocations [blck_mapCenter, ["NameCity","NameCityCapital"], 30000];
|
||||
blck_ActiveMissionCoords = [];
|
||||
blck_recentMissionCoords = [];
|
||||
blck_locationBlackList = [];
|
||||
blck_monitoredVehicles = [];
|
||||
blck_livemissionai = [];
|
||||
blck_monitoredMissionAIGroups = []; // Used to track groups in active missions for whatever purpose
|
||||
blck_oldMissionObjects = [];
|
||||
blck_pendingMissions = [];
|
||||
blck_missionsRunning = 0;
|
||||
blck_activeMissions = [];
|
||||
blck_deadAI = [];
|
||||
#ifdef useDynamicSimulation
|
||||
"Group" setDynamicSimulationDistance 1800;
|
||||
enableDynamicSimulationSystem true;
|
||||
#endif
|
||||
// Arrays for use during cleanup of alive AI at some time after the end of a mission
|
||||
DBD_HeliCrashSites = [];
|
||||
|
||||
// radius within whih missions are triggered. The trigger causes the crate and AI to spawn.
|
||||
blck_TriggerDistance = 1000;
|
||||
blck_mainThreadUpdateInterval = 60;
|
||||
//blck_missionSpawning = false;
|
||||
diag_log "[blckeagls] Variables Loaded";
|
||||
blck_variablesLoaded = true;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user