Merge pull request #43 from Ghostrider-DbD-/Version-6.58-Build-57

Version 6 58 build 57
This commit is contained in:
Ghostrider-DbD- 2017-04-30 22:33:57 -04:00 committed by GitHub
commit 93193169d9
142 changed files with 5148 additions and 2194 deletions

View File

@ -1,5 +1,14 @@
//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]];

View File

@ -2,7 +2,16 @@
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;

View File

@ -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

View File

@ -1,5 +1,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";
blck_serverFPS = diag_FPS;
publicVariable "blck_serverFPS";

View File

@ -3,16 +3,27 @@
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";};
if (blck_debugLevel > 2) then {diag_log "_fnc_cleanEmptyGroups:: -- >> exiting function";};

View File

@ -1,6 +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;
clearItemCargoGlobal _veh;

View File

@ -4,7 +4,14 @@
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"];

View File

@ -6,7 +6,15 @@
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;

View File

@ -3,7 +3,15 @@
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];

View File

@ -1,6 +1,13 @@
/*
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";

View File

@ -1,5 +1,15 @@
// 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;

View File

@ -1,4 +1,15 @@
// 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 = [];
{

View File

@ -1,13 +1,26 @@
/*
By Ghostrider-DbD-
Last modified 1-24-17
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/
*/
//#define DBDserver 1
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
diag_log format["starting _fnc_mainThread with time = %1",diag_tickTime];
private["_modType","_timer1sec","_timer20sec","_timer5min"];
#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
@ -22,20 +35,31 @@ while {true} do
#endif
_timer1sec - diag_tickTime;
};
if (diag_tickTime - _timer20sec > 20) then
{
[] call blck_fnc_cleanupAliveAI;
[] call blck_fnc_cleanupObjects;
[] call blck_fnc_cleanupDeadAI;
[] call blck_fnc_missionGroupMonitor;
_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.
_timer20sec = diag_tickTime;
};
if (diag_tickTime - _timer5min > 300) then
};
if (blck_useTimeAcceleration) then
{
[] call blck_fnc_timeAcceleration;
if (diag_tickTime - _timer5min > 30) then {
[] call blck_fnc_timeAcceleration;
_timer5min = diag_tickTime;
};
};
};

View File

@ -2,7 +2,16 @@
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];

View File

@ -5,24 +5,38 @@
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"];
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 allPlayers;
} forEach _players;
};
//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 distance2d _x];
if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;};
} forEach allPlayers;
} forEach _players;
};
//diag_log format["_fnc_playerInRange:: returning with _result = %1",_result];
_result

View File

@ -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

View File

@ -5,7 +5,16 @@
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"];

View File

@ -4,6 +4,15 @@
// 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"];

View File

@ -8,7 +8,16 @@
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"];

View File

@ -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;
_groupSpawned setcombatmode "YELLOW";
_groupSpawned 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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])];

View File

@ -0,0 +1,166 @@
/*
[] 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;
};
////////
// 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;

View File

@ -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;

View File

@ -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";

View File

@ -3,11 +3,20 @@
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last Modified 8-13-16
*/
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.
private["_dist","_dir","_arc","_xpos","_ypos","_newpos","_wpradius","_wpnum","_oldpos"];
params["_pos","_minDis","_maxDis","_group"];
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
@ -16,27 +25,68 @@ _maxDis = _this select 2; // maximum distance from the center of a patrol area f
_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;
_oldpos = _pos;
_newpos = _oldpos;
_dir = random 360;
_arc = 360/_wpnum;
//Set up waypoints for our AI
for [{ _x=1 },{ _x < _wpnum },{ _x = _x + 1; }] do {
_dir = _dir + _arc;
if (_dir > 360) then {_dir = _dir - 360;};
while{_oldpos distance2D _newpos < 20}do{
sleep .1;
_dist = (_minDis+(random (_maxDis - _minDis)));
_xpos = (_pos select 0) + sin (_dir) * _dist;
_ypos = (_pos select 1) + cos (_dir) * _dist;
_newpos = [_xpos,_ypos,0];
};
_oldPos = _newpos;
_wp = _group addWaypoint [[_xpos,_ypos,0], _wpradius];
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";
};
_wp = _group addWaypoint [[_xpos,_ypos,0], _wpradius];
deleteWaypoint [_group, 0];
_group setVariable["wpIndex",0];
_wp = _group addWaypoint [_newpos, _wpradius];
_wp setWaypointType "CYCLE";

View File

@ -0,0 +1,93 @@
// Sets up waypoints for a specified group.
/*
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_setupWaypoints: blck_debugMode enabled";
#endif
private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"];
params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ];
_wp = [_group, 0];
#ifdef blck_debugMode
diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType];
#endif
if (_soldierType isEqualTo "emplaced") then
{
_wp setWaypointType "SENTRY";
_wp setWPPos (getPos leader _group);
_wp setWaypointCompletionRadius 100;
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointTimeout [1,1.1,1.2];
//_wp setWaypointTimeout [0.1,0.1100,0.1200];
_group setCurrentWaypoint _wp;
_group setVariable["soldierType",_soldierType];
#ifdef blck_debugMode
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"];
#else
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"];
#endif
if (blck_debugLevel > 1) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];};
};
if !(_soldierType isEqualTo "emplaced") then
{
_group setcombatmode "YELLOW";
_group setBehaviour "COMBAT";
_group setVariable["patrolCenter",_pos];
_group setVariable["minDis",_minDis];
_group setVariable["maxDis",_maxDis];
_group setVariable["timeStamp",diag_tickTime];
_group setVariable["wpRadius",30];
_group setVariable["wpMode",_mode];
_group setVariable["wpPatrolMode",_wpPatrolMode];
_group setVariable["wpDir",0];
_group setVariable["wpArc",_arc];
_group setVariable["soldierType",_soldierType];
_dir = 0;
_arc = 360/5;
_wpradius = 30;
_dis = (_minDis) + random( (_maxDis) - (_minDis) );
_newPos = _pos 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 "RED";
_wp setWaypointTimeout [1,1.1,1.2];
_group setCurrentWaypoint _wp;
#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
{
_marker = createMarker [format["GroupMarker%1",_group],_newPos];
_group setVariable["wpMarker",_marker];
_marker setMarkerColor "ColorBlue";
_marker setMarkerText format["%1 %2",(_group getVariable["soldierType","null"]),_group];
_marker setMarkerType "mil_triangle";
//diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 mobile patrol with _soldierType = %1",_solderType,_group];
diag_log format["_fnc_setupWaypoints: soldier type for mobile _group %1 set to %2",_group, (_group getVariable["soldierType","null"])];
diag_log format["_fnc_setupWaypoints: all variables for the group have been set for group %1",_group];
diag_log format["_fnc_setupWaypoints:: -- >> wpMode %1 _dir %2 _dis 3",_group getVariable["wpMode","random"], _dir, _dis];
diag_log format["_fnc_setupWaypoints:: -- >> group to update is %1 and new position is %2",_group, _newPos];
diag_log format["_fnc_setupWaypoints:: -- >> Waypoint statements for group %1 have been configured as %2",_group, waypointStatements _wp];
diag_log format["_fnc_setupWaypoints:: -- >> Waypoint marker for group %1 have been configured as %2 with text set to %3",_group, _group getVariable "wpMarker", markerText (_group getVariable "wpMarker")];
};
#endif
};

View File

@ -3,36 +3,58 @@
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last Modified 1/22/17
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] ];
if (blck_debugLevel > 2) then
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];
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 {
if (_numai2 > _numai1) then
{
_numbertospawn = floor( (random (_numai2 - _numai1) + _numai1 ) );
} else {
_numbertospawn = _numai2;
};
if (blck_debugLevel > 2) then
#ifdef blck_debugMode
if (blck_debugLevel > 1) then
{
//diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
};
#endif
_groupSpawned = createGroup blck_AI_Side;
_groupSpawned setVariable["groupVehicle",objNull];
#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]};
_groupSpawned setcombatmode blck_combatMode;
#endif
_groupSpawned setcombatmode "RED";
_groupSpawned setBehaviour "COMBAT";
_groupSpawned allowfleeing 0;
_groupSpawned setspeedmode "FULL";
_groupSpawned setFormation blck_groupFormation;
_groupSpawned setVariable ["blck_group",true,true];
_groupSpawned setVariable ["blck_group",true];
//diag_log format["spawnGroup:: group is %1",_groupSpawned];
// Determines whether or not the group has launchers
@ -69,9 +91,20 @@ if !(isNull _groupSpawned) then
[_safepos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
};
_groupSpawned selectLeader (units _groupSpawned select 0);
[_pos,_minDist,_maxDist,_groupSpawned] spawn blck_fnc_setupWaypoints;
// 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
//diag_log format["fnc_spawnGroup:: Group spawned was %1 with units of %2",_groupSpawned, units _groupSpawned];
} else {
diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED";
};

View File

@ -17,7 +17,15 @@
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]];

View File

@ -8,7 +8,15 @@
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]];

View File

@ -3,11 +3,20 @@
call as [ [list of AI], time] call blck_fnc_addLiveAItoQue; where time is the time delay before deletion occurs
by Ghostrider-DbD-
Last modified 1-14-17
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];
//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];

View File

@ -3,21 +3,35 @@
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]];
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
private _mission = [_missionList,_path,format["%1%2",_marker,_i],_difficulty,_tMin,_tMax,_waitTime,[0,0,0]];
// 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;
};
if (blck_debugLevel > 0) then {diag_log format["_fnc_addMissionToQue:: -- >> Result - blck_pendingMissions = %1",blck_pendingMissions];};
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["_fnc_addMissionToQue:: -- >> Result - blck_pendingMissions = %1",blck_pendingMissions];};
#endif

View File

@ -4,7 +4,15 @@
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];

View File

@ -6,27 +6,30 @@
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last Modified 1-24-17
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
{
if ((typeOf _x) isKindOf "LandVehicle") then
{
if !(_x getVariable["releasedToPlayers",false]) then
{
private _crew = crew _x;
{
[_x] call blck_fnc_deleteAI;
}forEach _crew;
};
_x setVariable["blck_DeleteAt",0]; // Schedule it to be deleted by fnc_vehicleMonitor immediately
} else {
if (blck_debugLevel > 1) then {diag_log format["_fnc_cleanUpObjects: -> deleting object %1",_x];};
deleteVehicle _x;
};
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["_fnc_cleanUpObjects: -> deleting object %1",_x];};
#endif
deleteVehicle _x;
} forEach _objects;
};
@ -44,8 +47,11 @@ for "_i" from 1 to (count blck_oldMissionObjects) do
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
};
};
};

View File

@ -4,7 +4,16 @@
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];

View File

@ -5,31 +5,97 @@
Updates the mission que.
Updates mission markers.
By Ghostrider-DbD-
1/24/17
*/
3/17/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
if (blck_useSignalEnd) then
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;
if (blck_debugLevel > 1) then
#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
};
params["_mines","_objects","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission"];
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];
uisleep 0.1;
[_objects, (blck_cleanupCompositionTimer)] spawn blck_fnc_addObjToQue;
[_objects, _cleanupCompositionTimer] spawn blck_fnc_addObjToQue;
//diag_log format["_fnc_endMission:: (26) _blck_AllMissionAI = %1",_blck_AllMissionAI];
uisleep 0.1;
[_blck_AllMissionAI, (blck_AliveAICleanUpTimer)] spawn blck_fnc_addLiveAItoQue;
[["end",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
[_blck_localMissionMarker select 1, _markerClass] execVM "debug\missionCompleteMarker.sqf";
[_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;
[_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue;
blck_missionsRunning = blck_missionsRunning - 1;
_aborted

View File

@ -5,7 +5,15 @@
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"];

View File

@ -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;

View File

@ -3,11 +3,20 @@
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last modified 2/24/17
*/
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.
private ["_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel"];
params["_coords","_mission"];
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
@ -29,43 +38,10 @@ private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot","
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
if (isNil "_timeOut") then {_timeOut = -1;};
//if (isNil "_timeOut") then {_timeOut = -1;};
if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn";
if (isNil "_chanceReinforcements") then
{
_chanceReinforcements = 0;
_noPara = 0;
_reinforcementLootCounts = [0,0,0,0,0,0];
_chanceHeliPatrol = 0;
_chanceLoot = 0;
}; // Set this value in your mission template if you would like to overide the default here.
if (isNil "_noPara") then {_noPara = 0};
if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = 0;};
if (isNil "_chanceLoot") then {_chanceLoot = 0};
if (isNil "_heliCrew") then {_heliCrew = 3};
if (isNil "_reinforcementLootCounts") then
{
private["__weap","_mags","_backpacks","_optics","_loadout"];
_weap = 2 + floor(random(4));
_mags = 5 + floor(random(6));
_backpacks = 1 + floor(random(2));
_optics = 1 + floor(random(6));
_loadout = 1 + floor(random(3));
_reinforcementLootCounts = [_weap,_mags,_optics,0,0,_backpacks];
if (blck_debugLevel > 1) then {diag_log "missionSpawner:: default values used for _reinforcementLootCounts";};
}
else
{
if (blck_debugLevel > 1) then {diag_log "missionSpawner (47):: Mission specific values used for _reinforcementLootCounts";};
};
if (blck_debugLevel > 1) then {
diag_log format["[blckEagle] Mission Reinforcement Parameters: changeReinforcements %1 numAI %2 changePatrol %3 chanceLoot %4",_chanceReinforcements,_noPara,_chanceHeliPatrol,_chanceLoot];
};
private["_useMines","_abortMissionSpawner","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"];
private["_useMines","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"];
if (isNil "_useMines") then {_useMines = blck_useMines;};
_objects = [];
@ -93,8 +69,10 @@ _blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow
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";
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (94) waiting for player to trigger the mission";};
#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
////////
@ -108,43 +86,62 @@ if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (105) starting mission
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;
//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];
#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,""];
//_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,_missionCfg select 2,_loadCratesTiming] call blck_fnc_spawnMissionCrates;
_crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates;
}
else
{
@ -157,10 +154,14 @@ if (blck_cleanUpLootChests) then
_objects append _crates;
};
//uisleep 2;
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] missionSpawner:: (131) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
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
{
@ -175,7 +176,7 @@ uiSleep _delayTime;
if (_useMines) then
{
_mines = [_coords] call blck_fnc_spawnMines;
uiSleep _delayTime;;
//uiSleep _delayTime;;
};
uiSleep _delayTime;
_temp = [];
@ -184,6 +185,7 @@ 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
{
@ -191,70 +193,200 @@ if (typeName _temp isEqualTo "ARRAY") then
};
//diag_log format["_fnc_missionSpawner:: (181)->> _objects = %1",_objects];
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] missionSpawner:: (166) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
diag_log format["[blckeagls] missionSpawner:: (170) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
uiSleep _delayTime;;
[_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
_temp = [_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
//uisleep 1;
_crates append _temp;
uiSleep _delayTime;
private ["_infantry"];
_infantry = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI;
//diag_log format["missionSpawner:: (201) -> _infantry = %1",_infantry];
if (typeName _infantry isEqualto "ARRAY") then
_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
{
_blck_AllMissionAI append _infantry;
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:: (210) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
diag_log format["[blckeagls] missionSpawner:: (202) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
};
#endif
uisleep _delayTime;
_temp = [[],[],false];
_abort = false;
private["_patrolVehicles"];
if (blck_useVehiclePatrols && (_noVehiclePatrols > 0)) then
{
private["_veh"];
uiSleep 1;
_veh = [_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols;
//diag_log format["missionSpawner :: (219) _veh = %1",_veh];
_objects append (_veh select 0);
_blck_AllMissionAI append (_veh select 1);
uiSleep _delayTime;
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] missionSpawner:: (225) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
_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;
private ["_temp"];
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (213) preparing to spawn emplaced weapons for _markerClass %3:: blck_useStatic = %1 and _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass];};
_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;
//diag_log format ["missionSpawner:: (246) value returned for _temp = %1",_temp];
_objects append (_temp select 0);
_blck_AllMissionAI append (_temp select 1);
};
/*
if (blck_enableReinforcements && (random(1) < _chanceReinforcements)) then
{
_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout;
if (blck_debugLevel > 0) then
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
{
diag_log format["[blckeagls] missionSpawner:: calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
// ["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
[_coords,_noPara,_aiDifficultyLevel,_chanceLoot,_reinforcementLootCounts,_weaponList,_uniforms,_headgear,_chanceHeliPatrol] spawn blck_fnc_callInReinforcements;
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"];
@ -267,33 +399,35 @@ switch (_endCondition) do
case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;};
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
};
//diag_log format["missionSpawner :: (270) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
//diag_log format["missionSpawner :: (269) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
private["_locations"];
_locations = [_coords] + _crates;
_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) && [_coords,20, true /*only allow completion by players on foot*/] call blck_fnc_playerInRange) exitWith {};
if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1 ) exitWith {};
//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 2;
uiSleep 4;
};
if (blck_debugLevel > 1) then
#ifdef blck_debugMode
if (blck_debugLevel > 0) then
{
diag_log format["[blckeagls] missionSpawner:: (288) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
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];
};
{
// 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.
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;
[_mines,_objects,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission] call blck_fnc_endMission;
diag_log format["[blckeagls] missionSpawner:: (298)end of mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
#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"];

View File

@ -1,33 +0,0 @@
/*
Generic Mission timer
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
*/
private ["_coords","_missionName","_scriptDone"];
params["_availableMissions","_missionPath","_markerClass","_aiDifficultyLevel","_tMin","_tMax"];
_aiDifficultyLevel = toLower (_aiDifficultyLevel);
/*
_availableMissions = _this select 0;
_missionPath = _this select 1;
_markerClass = _this select 2;
_aiDifficultyLevel = toLower (_this select 3);
_tMin = _this select 4;
_tMax = _this select 5;
*/
diag_log format["[blckeagls] Generic Mission Timer started with _this %1",_this];
//diag_log format["[blckeagls] Generic Mission Timer _t %1 _tMax %2",_tMin,_tMax];
while {true} do {
waitUntil {[_tMin, _tMax] call blck_fnc_waitTimer};
//uisleep 10;
_coords = [] call blck_fnc_FindSafePosn;
_coords pushback 0;
blck_ActiveMissionCoords pushback _coords;
_missionName = selectRandom _availableMissions;
_scriptDone = false;
_scriptDone = [_coords,_markerClass,_aiDifficultyLevel] execVM format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName];
waitUntil{scriptDone _scriptDone};
blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords];
blck_recentMissionCoords pushback [_coords,diag_tickTime]; // these coordinates are automatically deleted by findSafePsn after a certain period
};

View File

@ -7,7 +7,16 @@
_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;
@ -18,4 +27,4 @@ switch (_missionColor) do {
case "orange": {_weaponList = blck_WeaponList_Orange;};
default {_weaponList = blck_WeaponList_Blue;};
};
_weaponList
_weaponList

View File

@ -3,6 +3,15 @@
// 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]];

View File

@ -4,7 +4,16 @@
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 = [];

View File

@ -3,7 +3,15 @@
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"];

View File

@ -5,7 +5,15 @@
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";

View File

@ -1,40 +1,123 @@
/*
[_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"];
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 (count _missionEmplacedWeapons < 1) then
if (_missionEmplacedWeapons isEqualTo []) then
{
_missionEmplacedWeapons = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius;
_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;
};
//diag_log format["_fnc_spawnEmplacedWeaponArray:: (18) _missionEmplacedWeapons = %1", _missionEmplacedWeapons];
#ifdef blck_debugMode
if (blck_debugLevel > 1) then
{
_empGroup = [_x,1,1,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//diag_log format["_fnc_spawnEmplacedWeaponArray:: typeName _empGroup = %1 and _empGroup = %2",typeName _empGroup, _empGroup];
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 = [selectRandom blck_staticWeapons,[0,0,0],false] call blck_fnc_spawnVehicle;
//diag_log format["_fnc_spawnEmplacedWeaponArray (23) spawnVehicle returned value of _wep = %1",_wep];
_wep = [(_x select 0),[0,0,0],false] call blck_fnc_spawnVehicle;
_empGroup setVariable["groupVehicle",_wep];
#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 _x;
_wep setPosATL _pos;
[_wep,false] call blck_fnc_configureMissionVehicle;
_emplacedWeps pushback _wep;
blck_missionVehicles pushback _wep;
_units = units _empGroup;
_gunner = _units select 0;
_gunner moveingunner _wep;
_emplacedAI append (units _empGroup);
//diag_log format["_fnc_spawnEmplacedWeaponArray:: position of emplaced weapon = %1 and position of _x is %2",getPos _wep, _x];
//diag_log format["_fnc_spawnEmplacedWeaponArray:: _gunner = %1 and crew _wep = %2",_gunner, crew _wep];
} forEach _missionEmplacedWeapons;
_emplacedAI append _units;
_return = [_emplacedWeps,_emplacedAI];
//diag_log format["_fnc_spawnEmplacedWeaponArray:: returning with _return = _emplacedWeps = %1",_return];
_return
#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

View File

@ -3,7 +3,16 @@
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"];
@ -34,4 +43,4 @@ for "_i" from 1 to _noMines/2 do
};
_dir = _dir + _incr;
};
_minesPlaced
_minesPlaced

View File

@ -1,7 +1,7 @@
/*
blck_fnc_spawnMissionAI
by Ghostrider-DbD-
1/9/17
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
@ -10,30 +10,80 @@
_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"];
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 = [];
//diag_log format["_fnc_spawnMissionAI :: _unitsToSpawn %1 ; _unitsPerGroup %2 _ResidualUnits %3",_unitsToSpawn,_unitsPerGroup,_ResidualUnits];
_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] ];
_newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,3,18,_uniforms,_headGear] call blck_fnc_spawnGroup;
if !(isNull _newGroup) then
if (blck_debugLevel > 2) then
{
//_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + units _newGroup;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
} else {
_abortMissionSpawner = true;
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: {
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area
#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"];
@ -44,47 +94,129 @@
} else {
_adjusttedGroupSize = _unitsPerGroup;
};
_newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
if (isNull _newGroup) exitWith {_abortMissionSpawner = true;};
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI];
_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
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3"];
_newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup;
if (isNull _newGroup) then {_abortMissionSpawner = true;} else
#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;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=3 _newGroup=%1 _newAI = %2",_newGroup, _newAI];
#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) exitWith {_abortMissionSpawner = true;};
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning 2 Groups:_newGroup=%1 _newAI = %2",_newGroup, _newAI];
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
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=default"];
#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;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning Groups: _noAIGroups=%3 _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
#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) exitWith {_abortMissionSpawner = true;};
_newAI = units _newGroup;
_blck_AllMissionAI = _blck_AllMissionAI + _newAI;
//diag_log format["missionSpawner: Spawning %3 Groups: _newGroup=%1 _newAI = %2",_newGroup, _newAI,_noAIGroups];
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
_blck_AllMissionAI
private["_return"];
_return = [_blck_AllMissionAI,_abort];
_return

View File

@ -2,39 +2,46 @@
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 2-24-17
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"];
//_offset = _x select 1; // offset relative to _coords at which to spawn the vehicle
if ((count _coords) == 3) then // assume that there is a Z offset provided
//_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
{
_pos = [(_coords select 0)+(_crateOffset select 0),(_coords select 1) + (_crateOffset select 1),(_coords select 2)+(_crateOffset select 2)]; // calculate the world coordinates
}
else
{
if ((count _coords) == 2) then // assume only X and Y offsets are provided
{
_pos = [(_coords select 0)+(_crateOffset select 0),(_coords select 1) + (_crateOffset select 1),0]; // calculate the world coordinates
};
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];
//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];
//diag_log format["_fnc_spawnMissionCrates::-> not loading crate loot at this time for crate %1",_x];
};
}forEach _crates;

View File

@ -1,8 +1,21 @@
/*
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;
#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
@ -12,7 +25,9 @@ _dropLoot = (random(1) < _chanceLoot);
// 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";
@ -22,10 +37,15 @@ _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;
/*
if ([] call blck_fnc_getModType isEqualTo "Epoch") then
{
_supplyHeli call EPOCH_server_setVToken;
};
*/
_supplyHeli setDir (_spawnVector -180);
_supplyHeli setFuel 1;
_supplyHeli engineOn true;
@ -44,19 +64,17 @@ _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
private["_wpDestination"];
[_grpPilot, 0] setWPPos _coords;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 30;
[_grpPilot, 0] setWaypointStatements ["true","[this, 0] setWaypointName ""done"" ;"];
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
_grpPilot setCurrentWaypoint [_grpPilot,0];
//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"];
_supplyHeli
#endif
_supplyHeli

View File

@ -2,16 +2,40 @@
[_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
returns _vehs, an array of vehicles spawned.
by Ghostridere-DbD-
1/10/17
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/
*/
params["_missionLootVehicles"];
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"]];
private _vehs = [];
{
//diag_log format["spawnMissionCVehicles.sqf _x = %1",_x];
_offset = _x select 1; // offset relative to _coords at which to spawn the vehicle
_pos = [(_coords select 0)+(_offset select 0),(_coords select 1) + (_offset select 1),(_coords select 2)+(_offset select 2)];
_veh = [_x select 0 /* vehicle class name*/, _pos] call blck_fnc_spawnVehicle;
_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;
[_veh,_x select 2 /*loot array*/, _x select 3 /*array of values specifying number of items of each loot type to load*/] call blck_fnc_fillBoxes;
}forEach _missionLootVehicles;
_vehs
_vehs

View File

@ -1,30 +1,93 @@
/*
[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionVehiclePatrols
by Ghostrider-DbD-
1/22/17
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"]];
private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns","_missionAI","_missiongroups","_vehicles","_return","_vehiclePatrolSpawns","_randomVehicle","_return"];
#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 = [];
_vehiclePatrolSpawns= [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius;
{
_vehGroup = [_x,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear] call blck_fnc_spawnGroup;
//if (isNull _vehGroup) exitWith {_abort = true;};
if (blck_debugLevel > 0) then {diag_log format["_fnc_spawnMissionVehiclePatrols:: -> _missionType = %3 _vehGroup = %1 and units _vehGroup = %2",_vehGroup, units _vehGroup,_missionType];};
if (typename (units _vehGroup) isEqualTo "ARRAY") then
{
_randomVehicle = selectRandom blck_AIPatrolVehicles;
_patrolVehicle = [_coords,_x,_randomVehicle,(_x distance _coords) -5,(_x distance _coords) + 5,_vehGroup] call blck_fnc_spawnVehiclePatrol;
//diag_log format["_fnc_spawnMissionVehiclePatrols:: - > patrol vehicle spawned was %1 with type of %2",_patrolVehicle,_randomVehicle];
_vehicles pushback _patrolVehicle;
_missionAI append units _vehGroup;
//diag_log format["_fnc_spawnMissionVehiclePatrols:: -- > _vehicles updated to %1",_vehicles];
};
}forEach _vehiclePatrolSpawns;
blck_missionVehicles append _vehicles;
_return = [_vehicles,_missionAI];
_abort = false;
_return
_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;
#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
{
_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

View File

@ -2,23 +2,66 @@
for DBD Clan
By Ghostrider-DBD-
Copyright 2016
Last modified 1/24/17
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.
if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnPendingMissions:: blck_pendingMissions = %1", blck_pendingMissions];};
private["_coords","_missionName","_missionPath"];
{
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnPendingMissions:: -- >> _x = %1 and _x select 6 = %2",_x, _x select 6];};
if (_x select 6 > 0) then // The mission is not running, check the time left till it is spawned
{
if (diag_tickTime > (_x select 6)) then // time to spawn the mission
{
_coords = [] call blck_fnc_FindSafePosn;
_coords pushback 0;
_missionName = selectRandom (_x select 0);
_missionPath = _x select 1;
[_coords,_x] execVM format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName];
};
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";
};
}forEach blck_pendingMissions;
#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

View File

@ -3,7 +3,15 @@
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"];
@ -24,5 +32,9 @@ _objects = [];
_objects pushback _wreck;
sleep 0.1;
} forEach _missionLandscape;
#ifdef blck_debugMode
if (blck_debugLevel > 2) then {diag_log format["_fnc_spawnRandomLandscape::-->> _objects = %1",_objects];};
_objects
#endif
_objects

View File

@ -3,18 +3,37 @@
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]] ];
if (blck_debugLevel > 1) then {diag_log format["_fnc_updateMissionQue :: _mission = %1 | _status = %2 | _coords = %3",_mission,_status,_coords];};
#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];
@ -25,9 +44,16 @@ if (_index > -1) then
_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
};

View File

@ -1,4 +1,5 @@
/*
Pulled from Arma
version of 11/9/16
*/
@ -22,7 +23,9 @@ _newObjs = [];
// 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
@ -41,4 +44,4 @@ _newObjs = [];
_newObjs
_newObjs
_newObjs

View File

@ -1,106 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_numAI,
_skillAI,
_chanceLoot,
_loogCounts,
_weapons,
_uniforms,
_headgear,
_patrol
] call blck_spawnReinforcements
*/
params["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["reinforcements:: Called with parameters _pos %1 _numAI %2 _skillAI %3 _chanceLoot %4",_pos,_numAI,_skillAI,_chanceLoot];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
// spawn an unarmed heli
_chopperType = selectRandom["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
diag_log format["reinforcements:: _chopperType seleted = %1",_chopperType];
_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 = _pos getPos [_spawnDistance,_spawnVector];
diag_log format["reinforcements:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_supplyHeli"];
//create helicopter and spawn it
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_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;
[_supplyHeli,blck_ModType] call blck_fnc_protectVehicle;
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_grpPilot setVariable ["parameters",[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear,_dropLoot,_lootCounts,_patrol]];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
_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];
//set waypoint for helicopter
private["_wpDestination"];
[_grpPilot, 0] setWPPos _pos;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 30;
[_grpPilot, 0] setWaypointStatements ["true","(this) spawn blck_fnc_dropReinforcements;"];
//[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
_grpPilot setCurrentWaypoint [_grpPilot,0];
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Carrying Reinforcements was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "reinforcements:: helispawned and inbound, message sent";
// add a loop here that waits until the paragroup has been spawned so that we can return it.
//waitUntil {!isNull (_supplyHeli getVariable["paraGroup",grpNull])};
//_grp = _supplyHeli getVariable["paraGroup"];
//_grp

View File

@ -1,131 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: WAI / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
call with
[
_pos,
_numAI,
_skillAI,
_chanceLoot,
_loogCounts,
_weapons,
_uniforms,
_headgear,
_patrol
] call blck_spawnReinforcements
Last Modified 1/23/17
*/
params["_pos","_numAI","_skillAI","_chanceLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["_fnc_callInReinforcements:: Called with parameters _pos %1 _numAI %2 _skillAI %3 _chanceLoot %4",_pos,_numAI,_skillAI,_chanceLoot];
private["_chopperType","_chopperTypeArmed","_spawnPos","_spawnVector","_spawnDistance"];
// spawn an unarmed heli
_chopperType = selectRandom blck_AIHelis; // ["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
diag_log format["_fnc_callInReinforcements:: _chopperType selected = %1",_chopperType];
_spawnVector = round(random(360));
_spawnDistance = 20; //00; // + 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 = _pos; // getPos [_spawnDistance,_spawnVector];
diag_log format["_fnc_callInReinforcements:: vector was %1 with distance %2 yielding a spawn position of %3 at distance from _pos of %4",_spawnVector,_spawnDistance,_spawnPos, (_pos distance2d _spawnPos)];
private["_supplyHeli"];
//create helicopter and spawn it
_supplyHeli = createVehicle [_chopperType, _spawnPos, [], 90, "FLY"];
_supplyHeli setDir (_spawnVector -180);
_supplyHeli setFuel 1;
_supplyHeli engineOn true;
_supplyHeli flyInHeight 250;
_supplyHeli setVehicleLock "LOCKEDPLAYER";
_supplyHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
_supplyHeli addEventHandler ["GetIn",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
[_supplyHeli] call blck_fnc_protectVehicle;
//[_supplyHeli] call blck_fnc_emptyObject;
//[_supplyHeli] call EPOCH_server_setVToken;;
private["_grpPilot","_unitPilot"];
// add pilot to helicopter //add pilot (single group) to supply helicopter
_grpPilot = createGroup blck_AI_Side;
_grpPilot setBehaviour "CARELESS";
_grpPilot setCombatMode "RED";
_grpPilot setSpeedMode "FULL";
_grpPilot allowFleeing 0;
_grpPilot setVariable ["parameters",[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear,_dropLoot,_lootCounts,_patrol]];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
_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];
_statementSendHeliHome = "(group this) spawn blck_fnc_sendHeliHome; diag_log 'sending heli home';";
_statementDropParatroops = "(group this) spawn blck_fnc_spawnParaUnits; diag_log 'spawning para units';";
_statementDropLootCrate = "(group this) spawn blck_fnc_spawnParaCrate; diag_log 'spawning para crate';";
//set waypoint for helicopter
private["_wpDestination"];
[_grpPilot, 0] setWPPos _pos;
[_grpPilot, 0] setWaypointType "MOVE";
[_grpPilot, 0] setWaypointSpeed "FULL";
[_grpPilot, 0] setWaypointBehaviour "CARELESS";
[_grpPilot, 0] setWaypointCompletionRadius 100;
//[_grpPilot, 0] setWaypointStatements ["true",_statementDropParatroops];
[_grpPilot,0] setWaypointTimeout [0.5,0.5,0.5];
_grpPilot setCurrentWaypoint [_grpPilot,0];
_waypoint = _grpPilot addWaypoint [_pos,0];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointTimeout [3,6,9];
_waypoint setWaypointCompletionRadius 150;
//_waypoint setWaypointStatements ["true",_statementDropLootCrate];
_waypoint setWaypointCombatMode _combatMode;
_waypoint setWaypointBehaviour _behavior;
_waypoint setWaypointSpeed "LIMITED";
_waypoint = _grpPilot addWaypoint [_pos,0];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointTimeout [3,6,9];
_waypoint setWaypointCompletionRadius 150;
//_waypoint setWaypointStatements ["true",_statementSendHeliHome];
_waypoint setWaypointCombatMode _combatMode;
_waypoint setWaypointBehaviour _behavior;
_waypoint setWaypointSpeed "LIMITED";
//Announce reinforcements are inbound to nearby players
private["_message"];
_message = "A Helicopter Carrying Reinforcements was Spotted Near You!";
[["reinforcements",_message,_pos]] call blck_fnc_messageplayers;
diag_log "_fnc_callInReinforcements:: helispawned and inbound, message sent";
_grpPilot spawn blck_fnc_spawnParaUnits;
_grpPilot spawn blck_fnc_spawnParaCrate;
uisleep 10;
_grpPilot spawn blck_fnc_sendHeliHome;
_supplyHeli setVariable["blck_DeleteAt", (diag_tickTime + 300)];
blck_missionVehicles pushback _supplyHeli;
_supplyHeli

View File

@ -1,30 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
called upon completion of weapoint.
1/23/17
*/
_pilot = this;
_grpPilot = group _pilot;
_params = _grpPilot getVariable["params"];
_params params["_supplyHeli","_numAI","_skillAI","_dropLoot","_lootCounts","_weapons","_uniforms","_headgear","_patrol"];
diag_log format["_fnc_dropReinforcements:: Called with parameters _supplyHeli %1 _numAI %2 _dropLoot %3",_supplyHeli,_numAI,_skillAI,_chanceLoot];
diag_log "_fnc_dropReinforcements:: heli on station, calling blck_fnc_spawnParaUnits";
// params["_supplyHeli","_missionPos","_numAI","_skillAI","_weapons","_uniforms","_headGear"];
[_supplyHeli,_numAI,_skillAI,_weapons,_uniforms,_headgear] spawn blck_fnc_spawnParaUnits;
if (_dropLoot) then
{
diag_log "_fnc_dropReinforcements:: heli on station, calling blck_fnc_spawnParaLoot";
// params["_supplyHeli","_lootCounts"];
[_supplyHeli,_lootCounts] spawn blck_fnc_spawnParaLoot;
};
uiSleep 10;
[_supplyHeli,_grpPilot] spawn blck_fnc_sendHeliHome;

View File

@ -1,132 +0,0 @@
/*
Author: Ghostrider-DbD-
Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP
License: Attribution-NonCommercial-ShareAlike 4.0 International
1/23/17
*/
params["_supplyHeli","_missionPos","_numAI","_skillAI","_weapons","_uniforms","_headGear"];
// create a group for our paratroops
private["_paraGroup"];
_paraGroup = createGroup blck_AI_Side; // ; Group changed for Exile for which player is RESISTANCE.
_supplyHeli setVariable["paraGroup",_paraGroup];
_paraGroup setcombatmode blck_combatMode;
_paraGroup allowfleeing 0;
_paraGroup setspeedmode "FULL";
_paraGroup setFormation blck_groupFormation;
_paraGroup setVariable ["blck_group",true,true];
diag_log format["_fnc_spawnParaUnits:: paratrooper group created; spawning %1 units",_numAI];
//https://forums.bistudio.com/topic/127341-how-to-get-cargo-capacity-and-costweight-of-stuff-into-sqf/
//_veh = TypeOf (_supplyHeli); //for example
//_maxpeople = getNumber (configFile >> "CfgVehicles" >> _veh >> "transportSoldier");
//if ( (_maxpeople - 1) < _numAI) then {_numAI = _maxpeople - 1;}; // calculate the max troops carried by the chopper minus 1 for the pilot who is already on board and adjust the number of AI to spawn as needed.
_launcherType = "none";
_sniperExists = false;
/*
for "_i" from 1 to _numAI do
{
//Spawns the AI unit
diag_log format["spawnGroup:: spawning unit #%1",_i];
_unit = [[getPos _supplyHeli select 0, getPos _supplyHeli select 1,(getPos _supplyHeli select 2) - 10],_weapons,_paraGroup,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
if !(_sniperExists) then
{
if ((random(1) < 0.2)) then
{
_sniperExists = true;
_unit setBehaviour "STEALTH";
};
};
_unit assignAsCargo _supplyHeli;
[_unit] orderGetIn true;
diag_log format["reinforcements:: spawned unit %1, at location %2",_unit,getPos _unit];
uiSleep 0.5;
};
*/
/*
diag_log "reinforcements:: eject paratroops";
{
unassignvehicle _x;
_x action ["EJECT", _supplyHeli];
sleep 0.5;
} foreach units _paraGroup;
*/
private["_dir","_offset"];
_dir = getDir _supplyHeli;
_dir = if (_dir < 180) then {_dir + 150} else {_dir - 150};
for "_i" from 1 to _numAI do
{
_offset = _supplyHeli getPos [10, _dir];
_chute = createVehicle ["Steerable_Parachute_F", [100, 100, 200], [], 0, "FLY"];
[_chute] call blck_fnc_protectVehicle;
/*
private["_modType"];
_modType = call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
{
[_chute] call EPOCH_server_setVToken;;
};
*/
_unit = [[_offset select 0, _offset select 1, 180],_weapons,_paraGroup,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI;
_unit setDir (getDir _supplyHeli) - 90;
_chute setPos [_offset select 0, _offset select 1, 250]; //(_offset select 2) - 10];
_unit disableCollisionWith _supplyHeli;
_chute disableCollisionWith _supplyHeli;
_unit assignAsDriver _chute;
_unit moveInDriver _chute;
_unit allowDamage true;
uiSleep 1;
diag_log format["_fnc_spawnParaUnits:: spawned unit %1, at location %2 and vehicle _unit %1",_unit,getPos _unit, vehicle _unit];
};
_paraGroup selectLeader ((units _paraGroup) select 0);
diag_log "_fnc_spawnParaUnits:: paratroops created, setting wayponts";
_paraGroup setVariable["missionPos",_missionPos];
[_paraGroup, 0] setWPPos _missionPos;
[_paraGroup, 0] setWaypointCombatMode "RED";
[_paraGroup, 0] setWaypointType "MOVE";
[_paraGroup, 0] setWaypointSpeed "NORMAL";
[_paraGroup, 0] setWaypointBehaviour "COMBAT";
[_paraGroup, 0] setWaypointCompletionRadius 20;
[_paraGroup, 0] setWaypointStatements ["true","[this getVariable[""missionPos""], 30, 45, this] call blck_fnc_setupWaypoints;"];
_fn_cleanupTroops = {
private["_troopsOnGround"];
params["_group"];
_troopsOnGround = false;
while {!_troopsOnGround} do
{
_troopsOnGround = true;
{
//diag_log format["reinforments:: Tracking Paratroops unit %1 position %4 altitue %2 velocity %3 attachedTo %4",_x, (getPos _x select 2), (velocity _x select 2), getPosATL _x, attachedTo _x];
if ( (getPosATL _x select 2) < 0.1) then {
if (surfaceIsWater (position _x)) then {
diag_log format["_fnc_spawnParaUnits:: unit %1 at %2 deleted",_x, getPos _x];
[_x] call blck_fnc_deleteAI;
};
}
else
{_troopsOnGround = false;};
}forEach units _group;
uiSleep 1;
};
};
diag_log "_fnc_spawnParaUnits:: waiting for paratroops to land";
[_paraGroup] spawn _fn_cleanupTroops;
diag_log "spawnParatroops:: All Units on the Ground";
// Return the group spawned for book keeping purposes
diag_log format["_fnc_spawnParaUnits:: typeName _paraGroup = %1", (typeName _paraGroup)];
_paraGroup;

View File

@ -2,7 +2,8 @@
// by Ghostrider-DBD_
// Last Updated 12/21/16
// Creds to AWOL, A3W, LouD and Creampie for insights.
if (!isServer) exitWith {};
//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
@ -11,27 +12,61 @@ if (!isServer) exitWith {};
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;
//diag_log format["_fnc_Time:: -- > _sunrise = %1 | _sunset = %2 | _time = %3",_sunrise,_sunset,_time];
// 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;
//diag_log format["NIGHT TIMGE ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#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;
//diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#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;
//diag_log format["DUSK ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#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

View File

@ -1,5 +1,8 @@
/*
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.
@ -7,10 +10,17 @@
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)
(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;

View File

@ -0,0 +1,50 @@
/*
By Ghostrider-DbD-
Last Modified 3-12-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_alertNearbyLeader;
_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";
};

View File

@ -1,4 +1,18 @@
/*
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];

View File

@ -1,5 +1,10 @@
/*
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:
@ -13,11 +18,25 @@
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];
private ["_unit","_mag"];
_unit = _this select 0;
_mag = _this select 3 select 0;
if (blck_debugLevel > 2) then {diag_log format["_EH_unitWeaponReloaded:: unit %1 reloaded weapon %2 with magazine %3",_unit,_this select 1,_mag];
if (blck_debugLevel > 2) then (diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit];
_unit addMagazine _mag;

View File

@ -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;

View File

@ -1,8 +1,16 @@
/*
by Ghostrider
9-20-15
Because this is p-ecompiled there is less concern about keeping comments in.
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"];
@ -14,7 +22,8 @@ if (_alertDist > 0) then {
//diag_log format["+----+ alerting units close to %1",_unit];
{
if (((position _x) distance2D (position _unit)) <= _alertDist) then {
_x reveal [_killer, _intelligence];
_knowsAbout = _x knowsAbout _killer;
_x reveal [_killer, _knowsAbout + _intelligence];
//diag_log "Killer revealed";
}
} forEach allUnits;

View File

@ -2,19 +2,37 @@
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 1/24/17
*/
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
@ -23,15 +41,27 @@ for "_i" from 1 to (count blck_liveMissionAI) do
//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:: cleaning up AI group %1",_units];
{
//diag_log format["_fnc_cleanupAliveAI:: deleting unit %1",_x];
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
};
};
};

View File

@ -2,9 +2,19 @@
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
if (blck_debugLevel > 1) then {diag_log format["fnc_cleanupDeadAI called at time %1",diag_tickTime];};
private["_aiList","_ai"];
_aiList = +blck_deadAI;
{

View File

@ -2,7 +2,14 @@
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"];

View File

@ -1,15 +1,30 @@
/*
Handle AI Deaths
Last Modified 1/13/17
Last Modified 3/23/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];
/*
if (vehicle _unit != _unit) then {
if (count crew (vehicle _unit) isEqualTo 0) then
{
[vehicle _unit] call blck_fnc_releaseVehicleToPlayers;
};
};*/
blck_deadAI pushback _unit;
_group = group _unit;
[_unit] joinSilent grpNull;
@ -17,7 +32,15 @@ if (count(units _group) < 1) then {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_alertNearbyUnits;
//[_unit,_killer] call blck_fnc_alertNearbyUnits;
[_unit,_killer] call blck_fnc_alertNearbyLeader;
_group = group _unit;
//_group setBehavior "COMBAT";
_wp = [_group, currentWaypoint _group];
_wp setWaypointBehaviour "COMBAT";
_group setCombatMode "RED";
_wp setWaypointCombatMode "RED";
_isLegal = [_unit,_killer] call blck_fnc_processIlleagalAIKills;
if !(_isLegal) exitWith {};
@ -50,5 +73,5 @@ if (blck_useKillMessages) then
[_unit,_killer,_kills] call blck_fnc_rewardKiller;
{
_unit removeAllEventHandlers _x;
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear"]
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear","Hit"]

View File

@ -1,7 +1,14 @@
/*
by Ghostrider
1-22-17
4-12-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"];
@ -10,10 +17,10 @@ _launcher = _unit getVariable ["Launcher",""];
_legal = true;
_fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped
params["_vk","_unit"];
params["_unit","_vk"];
private
{
if (((position _x) distance (position _unit)) <= 350) then
if ( ( (getPos _vk) distance2d (getPos _x) ) < 500 ) then
{
_x reveal [_vk, 4];
_x dowatch _vk;
@ -27,7 +34,7 @@ _fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equi
_x doFire _vk;
};
};
} forEach allUnits;
} forEach (call blck_fnc_allPlayers);
};
_fn_applyVehicleDamage = { // apply a bit of damage
@ -45,7 +52,7 @@ _fn_deleteAIGear = {
_fn_msgIED = {
params["_killer"];
diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)];
//diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)];
[["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers;
};
@ -54,10 +61,12 @@ if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehi
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;
if (blck_debugON) then
#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;
@ -70,11 +79,12 @@ if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehi
};
if ( blck_VK_GunnerDamage &&((typeOf vehicle _killer) in blck_forbidenVehicles or (currentWeapon _killer) in blck_forbidenVehicleGuns) ) then {
if (blck_debugON) 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;

View File

@ -1,3 +1,16 @@
/*
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;

View File

@ -1,7 +1,15 @@
/*
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;

View File

@ -1,7 +1,16 @@
/*
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];

View File

@ -4,7 +4,14 @@
Code fragment adapted from VEMF
call as [_unit,_killer] call blck_fnc_rewardKiller;
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["_unit","_killer","_kills"];
//diag_log format["rewardKiller:: _unit = %1 and _killer %2",_unit,_killer];
@ -36,7 +43,10 @@ if (_modType isEqualTo "Epoch") then
private _killstreakReward=+(_kills*2);
//diag_log format["fnd_rewardKiller:: _bonus returned will be %1",_reward];
[_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto;
if (blck_addAIMoney) then
{
[_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto;
};
if (blck_useKillScoreMessage) then
{
[["showScore",[_reward,"",_kills],""],[_killer]] call blck_fnc_messageplayers;
@ -58,11 +68,14 @@ if (_modType isEqualTo "Exile") then
_newKillerFrags = _newKillerFrags + 1;
_killer setVariable ["ExileKills", _newKillerFrags];
format["addAccountKill:%1", getPlayerUID _killer] call ExileServer_system_database_query_fireAndForget;
_money = _killer getVariable ["ExileMoney", 0];
_money = _money + (_overallRespectChange/2) + (_kills * 2);
_killer setVariable ["ExileMoney", _money];
format["setAccountMoney:%1:%2", _money, (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget;
_message = ["showFragRequest",_overallRespectChange];
if (blck_addAIMoney) then
{
_money = _killer getVariable ["ExileMoney", 0];
_money = _money + (_overallRespectChange/2) + (_kills * 2);
_killer setVariable ["ExileMoney", _money];
format["setAccountMoney:%1:%2", _money, (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget;
};
//_message = ["showFragRequest",_overallRespectChange];
_killer call ExileServer_object_player_sendStatsUpdate;
if (blck_useKillScoreMessage) then
{

View File

@ -2,7 +2,14 @@
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;

View File

@ -4,7 +4,14 @@
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",
@ -151,7 +158,9 @@ else
//_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; }];
//_ai addEventHandler ["HandleDamage",{ [(_this select 0), (_this select 1)] execVM blck_EH_AIHandleDamage;}];
_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
{

View File

@ -1,6 +1,19 @@
// Configures a mission vehicle
// by Ghostrider-DBD-
// Last Updated 1/22/17
/*
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"];

View File

@ -1,21 +1,58 @@
// =========================================================================================================
// blckeagls mission system
// Author: Ghostrider-DBD-
// Last modified 1-22-17
// ------------------------------------------------------------------------------------------------------------
// Unused at present, reserved for the future
/*
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.
private ["_ai_veh","_ai_veh_type","_ai_veh_name"];
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["_ai_veh"];
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;
*/
_ai_veh_type = typeof _ai_veh;
_ai_veh_name = name _ai_veh;
_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;

View File

@ -1,5 +1,14 @@
// 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"];
@ -8,7 +17,9 @@ _modType = call blck_fnc_getModType;
switch (_ModType) do {
case "Epoch":
{
diag_log format["GMS_fnc_protectVehicle:: Tokens set for vehicle %1",_Vehicle];
#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;
};

View File

@ -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

View File

@ -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";

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -2,24 +2,35 @@
Spawn a vehicle and protect it against cleanup by Epoch
Returns the object (vehicle) created.
By Ghostrider-DBD-
Last modified 1-22-17
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]];
//_vehType = _this select 0; // type of vehicle to be spawned
//_pos = _this select 1; // position at which vehicle is to be spawned
if (blck_debugLevel > 2) then {diag_log format["spawnVehicle.sqf: _this = %1",_this];};
#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"];
_modType = call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
{
_veh call EPOCH_server_setVToken;
//diag_log format["_fnc_spawnVehicle:: (20) EPOCH_server_setVToken performed for vehicle %1",_veh];
};
[_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;
diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];};
#endif
_veh

View File

@ -1,61 +1,115 @@
/*
By Ghostrider-DBD-
Copyright 2016
Last updated 8-14-16
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] ];
//_pos Center of the mission area
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
if (isNull _group) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnVehiclePatrol"; objNull;};
//diag_log format["_fnc_spawnVehiclePatrol::->> _group = %1",_group];
_safepos = [_pos,0,25,0,0,20,0] call BIS_fnc_findSafePos;
_veh = [_vehType,_safepos] call blck_fnc_spawnVehicle;
//diag_log format["spawnVehiclePatrol:: vehicle spawned is %1 of typeof %2",_veh, typeOf _veh];
private["_unitNumber"];
_unitNumber = 0;
//#ifdef blck_debugMode
if (blck_debugLevel > 1) then
{
switch (_unitNumber) do
{
case 0: {_x moveingunner _veh;};
case 1: {_x moveindriver _veh;};
default {_x moveInCargo _veh;};
};
_unitNumber = _unitNumber + 1;
}forEach (units _group);
while {(count (waypoints _group)) > 0} do
{
deleteWaypoint ((waypoints _group) select 0);
diag_log format["_fnc_spawnVehiclePatrol:: _center = %1 | _pos = %2 | _vehType = %3 | _group = %4",_center,_pos,_vehType,_group];
};
//#endif
_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];
_wp = _group addWaypoint [_p2, 25];
_wp setWaypointType "MOVE";
_wp = _group addWaypoint [_p2, 25];
_wp setWaypointType "LOITER";
_wp setWaypointTimeout [10,17.5,25];
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;
};
_wp = _group addWaypoint [_pos, 25];
_wp setWaypointType "CYCLE";
//#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];
};
*/

View File

@ -1,451 +0,0 @@
/*
SDROP for A3 Epoch
Modified for GMS by
Ghostrider-DBD-
Last modified 2/19/16
*/
fn_returnHome = {
private["_unitGroup","_heliLoitering","_helicopter","_startingpos"];
_unitGroup = _this select 0;
_helicopter = _this select 1;
_startingpos = _this select 2;
diag_log "fn_returnHome:: sending heli home now";
//return helicopter to spawn area and clean it up
//sometimes this doesn't happen, so we check heli loitering later
_wpHome =_unitGroup addWaypoint [_startingpos, 1];
_wpHome setWaypointType "MOVE";
_wpHome setWaypointSpeed "FULL";
_wpHome setWaypointBehaviour "COMBAT";
_wpHome setWaypointCompletionRadius 800;
_wpHome setWaypointStatements ["true", "deleteVehicle (vehicle this); {deleteVehicle _x} forEach units group this;"];
//check to see if helicopter is loitering (it should be long gone by now)
//hate to do this, but have to just delete the vehicle as it refuses to comply with waypoint
_heliLoitering = true;
while {_heliLoitering} do {
if (_helicopter distance (getWPPos _wpPosition) < 400 && !isNull _helicopter) then {
diag_log text format ["[SDROP]: Deleted supply helicopter for loitering"];
deleteWaypoint [_unitGroup, 0];
deleteWaypoint [_unitGroup, 1];
{deleteVehicle _x;} forEach units _unitGroup;
deleteVehicle _helicopter;
} else {
_heliLoitering = false;
};
uiSleep 5;
};
diag_log "fn_returnHome:: heli and crew destroyed";
};
fn_LoadLootFood = {
private["_crate","_foodAndDrinks","_apparel","_backpacks"];
_crate = _this select 0;
//empty crate first
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;
_foodAndDrinks = [
["ItemSodaRbull",2],["ItemSodaPurple",2],["ItemSodaOrangeSherbet",2],["ItemSodaMocha",2],["ItemSodaMocha",2],["ItemSodaBurst",2],["FoodMeeps",2],["FoodSnooter",2],
["FoodWalkNSons",2],["water_epoch",4],["ItemCoolerE",4],["SweetCorn_EPOCH",4],["WhiskeyNoodle",6],["SnakeMeat_EPOCH",1],["CookedRabbit_EPOCH",2],["CookedChicken_EPOCH",2],["CookedGoat_EPOCH",2],
["CookedSheep_EPOCH",2]
];
{_crate addMagazineCargoGlobal _x} forEach _foodAndDrinks;
_apparel = [
["U_O_GhillieSuit",1],["U_O_Wetsuit",1],["U_OG_Guerilla1_1",1],["U_OG_Guerilla2_1",1],["U_OG_Guerilla3_1",1],["U_OrestesBody",1],["U_Wetsuit_uniform",1],["U_Ghillie1_uniform",1],["U_O_CombatUniform_ocamo",1]
];
{_crate addItemCargoGlobal _x} forEach _apparel;
{_crate addBackpackCargoGlobal _x} forEach [["B_Carryall_ocamo",2]];
};
fn_LoadLootSupplies = {
private["_crate","_supplies"];
_crate = _this select 0;
//empty crate first
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;
//fill the crate with SUPPLIES
_supplies = [
["CinderBlocks",8],["jerrycan_epoch",3],["CircuitParts",4],["ItemCorrugatedLg",1],["ItemCorrugated",4],["ItemMixOil",2],["MortarBucket",6],["PartPlankPack",4],["FAK",6],["VehicleRepair",2],
["Towelette",4],["HeatPack",2],["ColdPack",2],["Pelt_EPOCH",2],/*["Heal_EPOCH",2],["Repair_EPOCH",1],*/["EnergyPack",4],["EnergyPackLg",1]
];
{_crate addMagazineCargoGlobal _x} forEach _supplies;
_crate addWeaponCargoGlobal ["MultiGun",2];
{_crate addBackpackCargoGlobal _x} forEach [["B_Carryall_oucamo",1],["B_FieldPack_cbr",1],["B_TacticalPack_ocamo",1]];
};
fn_LoadLootWeapons = {
private["_crate","_weapons","_magazines","_attachments","_apparel"];
_crate = _this select 0;
//empty crate first
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;
//fill the crate with WEAPONS and AMMO
_weapons = [
["srifle_DMR_01_F",1],["arifle_Mk20_F",1],["arifle_MX_Black_F",1],["M249_EPOCH",1],["srifle_LRR_SOS_F",1]
];
{_crate addWeaponCargoGlobal _x} forEach _weapons;
_magazines = [
["20Rnd_762x51_Mag",4],["30Rnd_556x45_Stanag",4],["30Rnd_65x39_caseless_mag_Tracer",4],["200Rnd_556x45_M249",2],["7Rnd_408_Mag",3],["HandGrenade",2],["MiniGrenade",2]
];
{_crate addMagazineCargoGlobal _x} forEach _magazines;
_attachments = [
["optic_Arco",1],["optic_SOS",1],["optic_Aco",1],["optic_LRPS",1],["Muzzle_snds_H",1],["Muzzle_snds_M",1],["Muzzle_snds_B",1],["ItemCompass",4],["ItemGPS",4],["ItemWatch",4]
];
_apparel = [
["V_7_EPOCH",1],["V_10_EPOCH",1],["V_13_EPOCH",1],["V_14_EPOCH",1],["V_15_EPOCH",1],["V_37_EPOCH",1],["V_38_EPOCH",1]
];
{_crate addItemCargoGlobal _x} forEach _attachments + _apparel;
_crate addBackpackCargoGlobal [["B_FieldPack_ocamo",2]];
};
fn_LoadLootRandom = {
private ["_crate","_var","_tmp","_kindOf","_report","_cAmmo","_blackList","_LootList"];
_blackList = // Crate Blacklist - These are items that should NOT be in random crate - should eliminate most BE filter issues (may need more testing)
[
"DemoCharge_Remote_Mag", "SatchelCharge_Remote_Mag", "ATMine_Range_Mag","ClaymoreDirectionalMine_Remote_Mag", "APERSMine_Range_Mag",
"APERSBoundingMine_Range_Mag", "SLAMDirectionalMine_Wire_Mag","APERSTripMine_Wire_Mag", "NVGoggles_OPFOR", "NVGoggles_INDEP",
"FirstAidKit", "Medikit", "ToolKit", "optic_DMS"
];
_crate = _this select 0;
// Empty Crate
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;
_LootList = [];
// Generate Loot
{
_tmp = (getArray(_x >> 'items'));
{_LootList = _LootList + [ ( _x select 0 ) select 0 ];} forEach (_tmp);
} forEach ("configName _x != 'Uniforms' && configName _x != 'Headgear'" configClasses (configFile >> "CfgLootTable"));
_report = [];
// Load Random Loot Amount
for "_i" from 1 to ((floor(random 10)) + 10) do {
_var = (_LootList call BIS_fnc_selectRandom);
if (!(_var in SDROPCrateBlacklist)) then {
switch (true) do
{
case (isClass (configFile >> "CfgWeapons" >> _var)): {
_kindOf = [(configFile >> "CfgWeapons" >> _var),true] call BIS_fnc_returnParents;
if ("ItemCore" in _kindOf) then {
_crate addItemCargoGlobal [_var,1];
} else {
_crate addWeaponCargoGlobal [_var,1];
_cAmmo = [] + getArray (configFile >> "cfgWeapons" >> _var >> "magazines");
{
if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {
_crate addMagazineCargoGlobal [_x,2];
};
} forEach _cAmmo;
};
};
case (isClass (configFile >> "cfgMagazines" >> _var)): {
_crate addMagazineCargoGlobal [_var,1];
};
case ((getText(configFile >> "cfgVehicles" >> _var >> "vehicleClass")) == "Backpacks"): {
_crate addBackpackCargoGlobal [_var,1];
};
default {
_report = _report + [_var];
};
};
};
};
if ((count _report) > 0) then {
diag_log text format ["[blckeagls]: LoadLoot: <Unknown> %1", str _report];
};
};
fn_spawnLootCrate = {
private["_crate","_chute","_crateTypeArr","_crateType","_supplyHeli","_crateOnGround"];
_supplyHeli = _this select 0;
//create the parachute and crate
_chute = createVehicle ["I_Parachute_02_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_chute call EPOCH_server_vehicleInit;
_chute call EPOCH_server_setVToken;
_crate = createVehicle ["IG_supplyCrate_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_crate call EPOCH_server_vehicleInit;
_crate call EPOCH_server_setVToken;
//open parachute and attach to crate
_chute setPos [position _supplyHeli select 0, position _supplyHeli select 1, (position _supplyHeli select 2) - 10];
_crate setPos [position _chute select 0, position _chute select 1, (position _chute select 2) - 10];
_crate attachTo [_chute, [0, 0, -0.5]];
// To be sure the crate survives landing and any stray gunfire turn off damage for that object
_crate allowDamage false;
//FILL crate with LOOT
_crateTypeArr = ["food","supplies","weapons"/*,"random","random","random"*/];
_crateType = _crateTypeArr call bis_fnc_selectrandom;
//Randomize the crate type and fill it
//same crate every time is boring yo!
switch (_crateType) do {
case "food": {
[_crate] call fn_LoadLootFood;
};
case "supplies": {
[_crate] call fn_LoadLootSupplies;
};
case "weapons": {
[_crate] call fn_LoadLootWeapons;
};
case "random": {
[_crate] call fn_LoadLootRandom;
};
};
// put a marker on the crate
[_crate] spawn blck_fnc_signalEnd;
//detach chute when crate is near the ground
_crateOnGround = false;
while {!_crateOnGround} do {
if (getPosATL _crate select 2 > 30) then {
//attempt to smooth drop for paratroops
//commented out for performance improvements
/*if (SDROP_CreateParatrooperAI) then {
{
_vel = velocity _x;
_dirTo = [_x,_crate] call bis_fnc_dirTo;
_x setDir _dirTo;
_x setVelocity [
(_vel select 0) + (sin _dirTo * 0.2),
(_vel select 1) + (cos _dirTo * 0.2),
(_vel select 2)
];
} forEach units _grp;
};*/
uiSleep 5;
};
if (getPosATL _crate select 2 < 4) then {
_crateOnGround = true;
detach _crate;
};
uiSleep 1;
};
//delete the chute for clean-up purposes
deleteVehicle _chute;
};
//////////////////////////////////////////////////////////////
// Start of the main routine
/////////////////////////////////////////////////////////////
private ["_cleanheli","_drop","_helipos","_gunner2","_gunner","_playerPresent","_skillarray","_aicskill","_aiskin","_aigear","_helipatrol","_gear","_skin","_backpack","_mags",
"_gun","_triggerdis","_startingpos","_aiweapon","_mission","_heli_class","_startPos","_helicopter","_unitGroup","_pilot","_skill","_paranumber","_position","_wp1","_weapons",
"_headgear","_units","_wpPosition","_wpHome","_chanceLootCrate"];
_position = _this select 0; // Coordinates of the AI group requesting reinforcements; typically the center of the mission
_startingpos = _this select 1; // location at which the heli should begin its approach, such as 1 km from the mission
_triggerdis = _this select 2; // 25-40 meters from _position is recommended
_heli_class = [_this, 3, "B_Heli_Light_01_armed_F"] call BIS_fnc_param;
_paranumber = [_this, 4,3] call BIS_fnc_param; // Number of paratroops to spawn
_skill = [_this, 5, "red"] call BIS_fnc_param;
_chanceHeliPatrol = [_this, 6, 0.33] call BIS_fnc_param; // when true the heli will circle around _position and suppress
_chanceLootCrate = [_this, 7,0.33] call BIS_fnc_param;
_weapons = [_this, 8,blck_WeaponList_Red] call BIS_fnc_param;
_skins = [_this,9,blck_SkinList] call BIS_fnc_param;
_headgear = [_this, 10, blck_headgear] call BIS_fnc_param;
_units = [];
// wait for player to come into area.
diag_log "[bckeagls]: Paradrop Waiting for player";
//sleep 120;
waitUntil{ {isPlayer _x && _x distance _position <= 600} count playableunits > 0 };
// Three Initial Tasks, Spawn Chopper, give it Crew, and give the Crew initial waypoints for a flyby over the mission area and return to base for cleanup of chopper.
//Spawing in Chopper and crew
diag_log format ["[bckeagls]: Spawning a %1 with %2 units to be paradropped at %3",_heli_class,_paranumber,_position];
diag_log format ["[bckeagls]: Spawning a %1 to fly to, patrol and return from at %2",_heli_class,_paranumber,_position];
_unitGroup = createGroup blck_AI_Side;
_pilot = [[0,0,0],_weapons,_unitGroup,_skill] call blck_fnc_spawnAI;
[_pilot] joinSilent _unitGroup;
//_units pushback _pilot;
_helicopter = createVehicle [_heli_class, [(_startingpos select 0),(_startingpos select 1), 100], [], 0, "FLY"];
_helicopter setFuel 1;
_helicopter engineOn true;
clearWeaponCargoGlobal _helicopter;
clearMagazineCargoGlobal _helicopter;
clearItemCargoGlobal _helicopter;
_helicopter setVehicleAmmo 1;
_helicopter flyInHeight 150;
_helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
//keep heli around until we delete it
//_helicopter call EPOCH_server_vehicleInit;
_helicopter call EPOCH_server_setVToken;
_pilot assignAsDriver _helicopter;
_pilot moveInDriver _helicopter;
_pilot setSkill 1;
//set waypoint for helicopter over the mission requesting reinforcements
_wpPosition =_unitGroup addWaypoint [_position, 0];
_wpPosition setWaypointType "MOVE";
_wpPosition setWaypointSpeed "FULL";
_wpPosition setWaypointBehaviour "COMBAT";
_gunner = [[0,0,0],_weapons,_unitGroup,_skill] call blck_fnc_spawnAI;
[_gunner] joinSilent _unitGroup;;
_gunner assignAsGunner _helicopter;
_gunner moveInTurret [_helicopter,[0]];
_gunner2 = [[0,0,0],_weapons,_unitGroup,_skill] call blck_fnc_spawnAI;
_gunner2 assignAsGunner _helicopter;
_gunner2 moveInTurret [_helicopter,[1]];
[_gunner2] joinSilent _unitGroup;
_unitGroup allowFleeing 0;
_unitGroup setBehaviour "COMBAT";
_unitGroup setSpeedMode "FULL";
_unitGroup setCombatMode "RED";
_paraGroup = [[0,0,0],_paranumber,_paranumber,_skill,_position,5,35,_skins,_headgear] call blck_fnc_spawnGroup;
// Remove waypoints which may not be correct in this instance
while {(count (waypoints group(_paraGroup select 0))) > 0} do
{
deleteWaypoint ((waypoints group (_paraGroup select 0)) select 0);
};
{
// Give unit parachute
removeBackpack _x;
_x addBackpack "B_Parachute";
_x assignAsCargoIndex [_helicopter, 1];
_x moveInCargo _helicopter;
} forEach _paraGroup;
//Waits until heli gets near the position to drop crate, or if waypoint timeout has been triggered
if ( random(1) < _chanceLootCrate) then {
private["_destinationDone","_supplyDropStartTime"];
// drop a crate with loot
_wait = true;
_destinationDone = false;
_supplyDropStartTime = diag_tickTime;
while {_wait && !_destinationDone} do {
if (_helicopter distance (getWPPos _wpPosition) < 200 ) then {
_destinationDone = true;
[_helicopter] spawn fn_spawnLootCrate;
diag_log "spawnheli_para:: loot crate spawned";
};
if ((diag_tickTime - _supplyDropStartTime) > 300) then {
_wait = false;
};
uiSleep 10;
};
};
diag_log "spawnheli_para:: Waiting for heli to be in position to deploy paratrops";
while {_helicopter distance _position > 200} do { uiSleep 5;};
diag_log "spawnheli_para:: Deploing paratroopers";
[_pos,10,35,_paraGroup] call blck_fnc_setupWaypoints;
{
unassignVehicle (_x);
(_x) action ["EJECT", _helicopter];
uiSleep 1.5;
} forEach units _paraGroup;
diag_log "spawnheli_para:: Paratroopers deployed";
_wpLoiter = _unitGroup addWaypoint [_position,30];
_wpLoiter setWaypointType "LOITER";
_wpLoiter setWaypointSpeed "LIMITED";
_wpLoiter setWaypointTimeout [30,45,60];
_wpLoiter setWaypointLoiterType "CIRCLE_L";
if (random(1) < _chanceHeliPatrol) then {
[_unitGroup,_position,_startingpos] spawn {
private["_wp1","_unitGroup","_position","_startingpos","_helicopter"];
_unitGroup = _this select 0;
_position = _this select 1;
_helicopter = _this select 2;
_startingpos = _this select 3;
_wp1 = _unitGroup addWaypoint [[(_position select 0),(_position select 1)], 100];
_wp1 setWaypointType "SAD";
_wp1 setWaypointCompletionRadius 150;
_wp1 setWaypointTimeout [250,300,325]; // about 5 min.
_unitGroup setBehaviour "AWARE";
{_x addEventHandler ["Killed",{[_this select 0, _this select 1, "air"] call on_kill;}];} forEach (units _unitgroup);
uiSleep 300;
[_unitGroup,_helicopter,_startingpos] spawn fn_returnHome;
};
} else {
//small pause to ensure all items extract
uiSleep 3;
[_unitGroup,_helicopter,_startingpos] spawn fn_returnHome;
};
diag_log "GMS_fnc_spawnheli_para.sqf has finished";
_units;
/*
if (!isServer)exitWith{};
//Delay before chopper spawns in.
//sleep _delay;
// Add waypoints to the chopper group.
_wp = _unitGroup addWaypoint [[(_position select 0), (_position select 1)], 0];
_wp setWaypointType "MOVE";
_wp setWaypointCompletionRadius 100;
_drop = true;
_helipos = getpos _helicopter;
while {(alive _helicopter) AND (_drop)} do {
private ["_magazine","_weapon","_weaponandmag","_chute","_para","_pgroup"];
sleep 1;
_helipos = getpos _helicopter;
if (_helipos distance [(_position select 0),(_position select 1),100] <= 200) then {
_pgroup = createGroup blck_AI_Side;
for "_i" from 1 to _paranumber do
{
_para = [[0,0,0],_weapons,_unitGroup,_skill] call blck_fnc_spawnAI;
_helipos = getpos _helicopter;
_chute = createVehicle ["B_Parachute", [(_helipos select 0), (_helipos select 1), (_helipos select 2)], [], 0, "NONE"];
_para moveInDriver _chute;
[_para] joinSilent _pgroup;
sleep 1.5;
};
_drop = false;
_pgroup selectLeader ((units _pgroup) select 0);
//diag_log format ["WAI: Spawned in %1 ai units for paradrop",_paranumber];
[_position,10,30,_pgroup] call blck_fnc_setupWaypoints;
};
//_units = units _pgroup;
};
diag_log format ["[bckeagls]: dropped %1 units to be paradropped at %2",_paranumber,_position];

View File

@ -3,79 +3,66 @@
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.
private ["_veh","_vehList"];
_vehList = blck_missionVehicles;
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"];
//diag_log format["vehicleMonitor.sqf: make vehicle available to players; stripping eventHandlers from _v %1",_v];
blck_missionVehicles = blck_missionVehicles - [_v];
_v removealleventhandlers "GetIn";
_v removealleventhandlers "GetOut";
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
_v setVehicleLock "UNLOCKED" ;
_v setVariable["releasedToPlayers",true];
//_v setVariable["releasedToPlayers",true];
[_v] call blck_fnc_emptyObject;
if (blck_debugLevel > 2) then
{
_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
};
if (blck_debugLevel > 1) then {diag_log format["_fnc_vehicleMonitor:: function called at %1",diag_tickTime];};
{
_veh = _x;
if (_veh getVariable["blck_DeleteAt",0] > 0) then
_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
{
if (diag_tickTime > (_veh getVariable["blck_DeleteAt",0])) then
{
[_veh] call blck_deleteVehicle;
blck_missionVehicles = blck_missionVehicles - [_veh];
};
};
if ({alive _x} count crew _veh < 1) then
{
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 _fn_releaseVehicle;
};
}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 {
[_veh] call _fn_releaseVehicle;
};
};
} else { // Add magazine to vehicle if possible
private ["_crew","_mag","_allMags","_cnt"];
//_veh setVehicleAmmo 1;
//_veh setFuel 1;
// 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];
_crew = fullCrew _veh;
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
{
@ -93,6 +80,96 @@ if (blck_debugLevel > 1) then {diag_log format["_fnc_vehicleMonitor:: function c
};
} 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;

View File

@ -2,11 +2,18 @@
AI Mission for Epoch Mod for Arma 3
By Ghostrider
Functions and global variables used by the mission system.
Last modified 1/23/17
*/
blck_functionsCompiled = false;
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;
//#define DBDserver 1
// 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";
@ -20,10 +27,15 @@ blck_fnc_getModType = compileFinal preprocessFileLineNumbers "\q\addons\custom_
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";
#ifdef DBDserver
blck_fnc_broadcastServerFPS = = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf";
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
@ -35,7 +47,7 @@ blck_fnc_updateMissionQue = compileFinal preprocessFileLineNumbers "\q\addons\
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_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";
@ -45,7 +57,6 @@ blck_fnc_spawnMissionVehiclePatrols = compileFinal preprocessFileLineNumbers "\q
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_spawnMissionHeli = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnMissionHeli.sqf";
blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc_addItemToCrate.sqf";
blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Missions\GMS_fnc__loadLootItemsFromArray.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.
@ -54,40 +65,54 @@ blck_fnc_spawnMines = compileFinal preprocessFileLineNumbers "\q\addons\custom_s
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";
// #define Reinforcements 1
#ifdef Reinforcements
// Reinforcement-related functions
blck_fnc_callInReinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_callInReinforcements.sqf";
blck_fnc_spawnParaUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
blck_fnc_spawnParaCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaCrate.sqf";
//blck_fnc_callInReinforcements = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_callInReinforcements.sqf";
//blck_fnc_spawnParaUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
//blck_fnc_spawnParaCrate = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaCrate.sqf";
//blck_fnc_spawnReinforcHeli = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnReinforcHeli.sqf";
blck_fnc_sendHeliHome = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_sendHeliHome.sqf";
//blck_fnc_sendHeliHome = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_sendHeliHome.sqf";
//blck_fnc_spawnHeliPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
//blck_fnc_spawnHeliPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Reinforcements\GMS_fnc_spawnParaUnits.sqf";
#endif
// 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_setWaypoints.sqf"; // Set default waypoints for a group
blck_fnc_cleanEmptyGroups = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_cleanEmptyGroups.sqf"; // GMS_fnc_cleanEmptyGroups
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 or static
// 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_alertNearbyLeader = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_alertNearbyLeader.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";

View File

@ -3,12 +3,18 @@
For the Mission System originally coded by blckeagls
By Ghostrider
Functions and global variables used by the mission system.
Last modified 10/25/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/
*/
//blck_variablesLoaded = false;
#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;
blck_minFPS = 10;
////////////////////////////////////////////////
// Do Not Touch Anything Below This Line
@ -18,12 +24,14 @@ blck_ActiveMissionCoords = [];
blck_recentMissionCoords = [];
blck_locationBlackList = [];
blck_monitoredVehicles = [];
blck_liveMissionAI = [];
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 = [];
blck_missionVehicles = [];
// Arrays for use during cleanup of alive AI at some time after the end of a mission
DBD_HeliCrashSites = [];

View File

@ -0,0 +1,399 @@
/*
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";
if (blck_debugON) then {diag_log "[blckeagls] Loading blck_configs.sqf";};
/*
Configuration for Addons that support the overall Mission system.
These are a module to spawn map addons generated with the Eden Editor
And a moduel to spawn static loot crates at specific location
A time acceleration module.
*/
blck_spawnMapAddons = false; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf
blck_spawnStaticLootCrates = false; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent).
// Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf
blck_useTimeAcceleration = false; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1; // Daytime time accelearation
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
/**************************************************************
BLACKLIST LOCATIONS
**************************************************************/
// if true then missions will not spawn within 1000 m of spawn points for Altis, Bornholm, Cherno, Esseker or stratis.
blck_blacklistTraderCities = true; // Set this = true if you would like the mission system to automatically search for the locations of the Epoch/Exile trader cities. Note that these are added to the list of blacklisted locations for Epoch for the most common maps.
/***********************************************************
GENERAL MISSION SYSTEM CONFIGURATION
***********************************************************/
////////
// Headless Client Configurations
blck_useHC = false; // Not Yet Working
///////////////////////////////
// Kill message configurations
// These determine whether and when messages are sent to players regarding AI Kills or illegal kills that might damage a vehicle.
blck_useKillMessages = false; // when true a message will be broadcast to all players each time an AI is killed; may impact server performance.
blck_useKillScoreMessage = true; // when true a tile is displayed to the killer with the kill score information
blck_useIEDMessages = true; // Displayes a message when a player vehicle detonates and IED (such as would happen if a player killed AI with a forbidden weapon).
///////////////////////////////
// MISSION MARKER CONFIGURATION
// blck_labelMapMarkers: Determines if when the mission composition provides text labels, map markers with have a text label indicating the mission type
//When set to true,"arrow", text will be to the right of an arrow below the mission marker.
// When set to true,"dot", ext will be to the right of a black dot at the center the mission marker.
blck_labelMapMarkers = [true,"center"];
blck_preciseMapMarkers = true; // Map markers are/are not centered at the loot crate
//Minimum distance between missions
blck_MinDistanceFromMission = 2000;
///////////////////////////////
// Mission Smoke and Signals
///////////////////////////////
// global loot crate options
// Options to spawn a smoking wreck near the crate. When the first parameter is true, a wreck or junk pile will be spawned.
// It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission.
blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether.
blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion.
blck_loadCratesTiming = "atMissionCompletion"; // valid choices are "atMissionCompletion" and "atMissionSpawn";
///////////////////////////////
// PLAYER PENALTIES
///////////////////////////////
blck_RunGear = true; // When set to true, AI that have been run over will ve stripped of gear, and the vehicle will be given blck_RunGearDamage of damage.
blck_RunGearDamage = 0.2; // Damage applied to player vehicle for each AI run over
blck_VK_Gear = true; // When set to true, AI that have been killed by a player in a vehicle in the list of forbidden vehicles or using a forbiden gun will be stripped of gear and the vehicle will be given blck_RunGearDamage of damage
blck_VK_RunoverDamage = true; // when the AI was run over blck_RunGearDamage of damage will be applied to the killer's vehicle.
blck_VK_GunnerDamage = true; // when the AI was killed by a gunner on a vehicle that is is in the list of forbidden vehicles, blck_RunGearDamage of damage will be applied to the killer's vehicle each time an AI is killed with a vehicle's gun.
blck_forbidenVehicles = ["B_MRAP_01_hmg_F","O_MRAP_02_hmg_F"]; // Add any vehicles for which you wish to forbid vehicle kills
// For a listing of the guns mounted on various land vehicles see the following link: https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Vehicle_Weapons
// HMG_M2 is mounted on the armed offroad that is spawned by Epoch
blck_forbidenVehicleGuns = ["LMG_RCWS","LMG_M200","HMG_127","HMG_127_APC",/*"HMG_M2",*/"HMG_NSVT","GMG_40mm","GMG_UGV_40mm","autocannon_40mm_CTWS","autocannon_30mm_CTWS","autocannon_35mm","LMG_coax","autocannon_30mm","HMG_127_LSV_01"]; // Add any vehicles for which you wish to forbid vehicle kills, o
///////////////////////////////
// MISC MISSION PARAMETERS
///////////////////////////////
blck_useKilledAIName = true; // When false, the name of the killer (player), weapon and distance are displayed; otherwise the name of the player, distance and name of AI unit killed are shown.
blck_useMines = false; // when true mines are spawned around the mission area. these are cleaned up when a player reaches the crate. Turn this off if you have vehicle patrols.
blck_cleanupCompositionTimer = 1200; // Mission objects will be deleted after the mission is completed after a deley set by this timer.
blck_cleanUpLootChests = false; // when true, loot crates will be deleted together with other mission objects.
blck_MissionTimout = 60*60; // 60 min - missions will timeout and respawn in another location. This prevents missions in impossible locations from persisting.
///////////////////////////////
// Paratroop Settings
// AI paratrooper reinforcement paramters
// The behavior of these can be linked to some degree to the spawning of patrolling helis.
// For example, if you always want a helicopter to spawn paratroops set the value 1.
// If you never want helicopters to spawn them set the value to 0.
blck_chanceParaBlue = 0.1; // [0 - 1] set to 0 to deactivate and 1 to always have paratroops spawn over the center of the mission.
blck_noParaBlue = 3; // [1-N]
blck_chanceParaRed = 0.3;
blck_noParaRed = 3;
blck_chanceParaGreen = 0.4;
blck_noParaGreen = 0.4;
blck_chanceParaOrange = 0.5;
blck_noParaOrange = 4;
// Supplemental Loot Parameters.
///////////////////////////////
// Heli Patrol Heli Types
// Armed Helis
//////////////////////////////
_blck_littleBirds = ["B_Heli_Light_01_armed_F"]; // AH-9 Pawnee (WEST)
_blck_armed_hellcats = ["I_Heli_light_03_F"];
_blck_armed_orcas = ["O_Heli_Light_02_F","O_Heli_Light_02_v2_F"];
_blck_armed_ghosthawks = ["B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F"];
_blck_armed_hurons = ["B_Heli_Transport_03_F","B_Heli_Transport_03_black_F"];
_blck_armed_attackHelis = ["B_Heli_Attack_01_F"];
_blck_armed_heavyAttackHelis = ["O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"];
blck_blacklisted_heli_ammo = ["24Rnd_missiles","24Rnd_PG_missiles","12Rnd_PG_missiles","2Rnd_LG_scalpel","6Rnd_LG_scalpel","8Rnd_LG_scalpel","M_Scalpel_AT ","14Rnd_80mm_rockets","38Rnd_80mm_rockets"];
blck_blacklisted_heli_weapons = ["missiles_SCALPEL","missiles_titan","rockets_Skyfire","missiles_DAGR","missiles_DAR"];
///////////////////////////////
// Heli Patrol Settings
///////////////////////////////
blck_chanceHeliPatrolBlue = 0; //[0 - 1] Set to 0 to deactivate and 1 to always have a heli spawn over the mission center and patrol the mission area. The chance of paratroops dropping from the heli is defined by blck_chancePara(Blue|Red|Green|Orange) above.
blck_patrolHelisBlue = _blck_littleBirds;
blck_chanceHeliPatrolRed = 0; // 0.4;
blck_patrolHelisRed = _blck_littleBirds;
blck_chanceHeliPatrolGreen = 0;
blck_patrolHelisGreen = _blck_littleBirds;
blck_chanceHeliPatrolOrange = 0;
blck_patrolHelisOrange = _blck_littleBirds; //_blck_armed_hellcats+_blck_armed_orcas;
////////////////////
// Enable / Disable Missions
////////////////////
// Maximum number of missions shown on the map at any one time.
#ifdef DBDserver
blck_maxSpawnedMissions = 6;
#else
// Change this value to reduce the number of spawned missions at any one time.
blck_maxSpawnedMissions = 4;
#endif
//Set to -1 to disable. Values of 2 or more force the mission spawner to spawn copies of that mission - this feature is not recommended because you may run out of available groups.
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = 1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = 1;
#ifdef DBDserver
blck_enableHunterMissions = 1;
blck_enableScoutsMissions = 1;
blck_maxcrashsites = 3;
#endif
////////////////////
// MISSION TIMERS
////////////////////
// Reduce to 1 sec for immediate spawns, or longer if you wish to space the missions out
blck_TMin_Orange = 250;
blck_TMin_Green = 200;
blck_TMin_Blue = 120;
blck_TMin_Red = 150;
#ifdef DBDserver
blck_TMin_Hunter = 120;
blck_TMin_Scouts = 115;
blck_TMin_Crashes = 115;
//blck_TMin_UMS = 200;
#endif
//Maximum Spawn time between missions in seconds
blck_TMax_Orange = 360;
blck_TMax_Green = 300;
blck_TMax_Blue = 200;
blck_TMax_Red = 250;
#ifdef DBDserver
blck_TMax_Hunter = 200;
blck_TMax_Scouts = 200;
blck_TMax_Crashes = 200;
//blck_TMax_UMS = 280;
#endif
///////////////////////////////
// AI VEHICLE PATROL PARAMETERS
///////////////////////////////
blck_useVehiclePatrols = true; // When true vehicles will be spawned at missions and will patrol the mission area.
blck_killEmptyAIVehicles = false; // when true, the AI vehicle will be extensively damaged once all AI have gotten outor been killed.
////////////////////
// Mission Vehicle Settings
////////////////////
//Defines how many AI Vehicles to spawn. Set this to -1 to disable spawning of static weapons or vehicles. To discourage players runniing with with vehicles, spawn more B_GMG_01_high
blck_SpawnVeh_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnVeh_Green = 2; // Number of static weapons at Green Missions
blck_SpawnVeh_Blue = -1; // Number of static weapons at Blue Missions
blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions
///////////////////////////////
// AI STATIC WEAPON PARAMETERS
///////////////////////////////
blck_useStatic = true; // When true, AI will man static weapons spawned 20-30 meters from the mission center. These are very effective against most vehicles
blck_killEmptyStaticWeapons = true; // When true, static weapons will have damage set to 1 when the AI manning them is killed.
blck_staticWeapons = ["B_HMG_01_high_F"/*,"B_GMG_01_high_F","O_static_AT_F"*/]; // [0.50 cal, grenade launcher, AT Launcher]
////////////////////
// Mission Static Weapon Settings
////////////////////
// Defines how many static weapons to spawn. Set this to -1 to disable spawning
blck_SpawnEmplaced_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnEmplaced_Green = 2; // Number of static weapons at Green Missions
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnEmplaced_Red = 1; // Number of static weapons at Red Missions
/****************************************************************
GENERAL AI SETTINGS
****************************************************************/
blck_groupBehavior = "SENTRY"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes
blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes.
blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND"
blck_addAIMoney = true;
blck_chanceBackpack = 0.3; // Chance AI will be spawned with a backpack
blck_useNVG = true; // When true, AI will be spawned with NVG if is dark
blck_removeNVG = false; // When true, NVG will be removed from AI when they are killed.
blck_useLaunchers = true; // When true, some AI will be spawned with RPGs; they do not however fire on vehicles for some reason so I recommend this be set to false for now
//blck_launcherTypes = ["launch_NLAW_F","launch_RPG32_F","launch_B_Titan_F","launch_I_Titan_F","launch_O_Titan_F","launch_B_Titan_short_F","launch_I_Titan_short_F","launch_O_Titan_short_F"];
blck_launcherTypes = ["launch_RPG32_F"];
blck_launchersPerGroup = 1; // Defines the number of AI per group spawned with a launcher
blck_launcherCleanup = true;// When true, launchers and launcher ammo are removed from dead AI.
//This defines how long after an AI dies that it's body disappears.
blck_bodyCleanUpTimer = 1200; // time in seconds after which dead AI bodies are deleted
// Each time an AI is killed, the location of the killer will be revealed to all AI within this range of the killed AI, set to -1 to disable
// values are ordered as follows [blue, red, green, orange];
blck_AliveAICleanUpTimer = 1200; // Time after mission completion at which any remaining live AI are deleted.
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIAlertDistance = [150,225,250,300]; // Radius within which AI will be notified of enemy activity. Depricated as a group-sed system is used now. The group is informed of the enemy location when a group member is hit or killed.
//blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9];
blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0.
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
**************************************************************/
//This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type
// Orange Missions
blck_MinAI_Orange = 20;
blck_MaxAI_Orange = 25;
blck_AIGrps_Orange = 5;
blck_SkillsOrange = [
["aimingAccuracy",0.4],["aimingShake",0.7],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 4;
blck_SkillsGreen = [
["aimingAccuracy",0.3],["aimingShake",0.65],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.2],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;
blck_maxMoneyRed = 15;
blck_maxMoneyBlue = 10;
#ifdef DBDserver
blck_AIAlertDistance = [150,225,250,300]; // Radius within which AI will be notified of enemy activity. Depricated as a group-sed system is used now. The group is informed of the enemy location when a group member is hit or killed.
//blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9];
blck_baseSkill = 0.7; // The overal skill of the AI - range 0.1 to 1.0.
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
**************************************************************/
//This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type
// Orange Missions
blck_MinAI_Orange = 20;
blck_MaxAI_Orange = 25;
blck_AIGrps_Orange = 5;
blck_SkillsOrange = [
["aimingAccuracy",0.2],["aimingShake",0.5],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",0.7],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 4;
blck_SkillsGreen = [
["aimingAccuracy",0.18],["aimingShake",0.45],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.65],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.16],["aimingShake",0.4],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.6],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.12],["aimingShake",0.3],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;
blck_maxMoneyRed = 15;
blck_maxMoneyBlue = 10;
#endif
private["_modType"];
_modType = [] call blck_fnc_getModType;
if (_modType isEqualTo "Epoch") then
{
diag_log format["[blckeagls] Loading Mission System using Parameters for %1",_modType];
execVM "\q\addons\custom_server\Configs\blck_configs_epoch.sqf";
waitUntil {(isNil "blck_configsEpochLoaded") isEqualTo false;};
waitUntil{blck_configsEpochLoaded};
blck_configsEpochLoaded = nil;
diag_log "[blckeagles] Running getTraderCitiesEpoch to get location of trader cities";
execVM "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getTraderCitesEpoch.sqf";
};
if (_modType isEqualTo "Exile") then
{
diag_log format["[blckeagls] Loading Mission System using Parameters for %1",_modType];
execVM "\q\addons\custom_server\Configs\blck_configs_exile.sqf";
waitUntil {(isNil "blck_configsExileLoaded") isEqualTo false;};
waitUntil{blck_configsExileLoaded};
blck_configsExileLoaded = nil;
if (blck_blacklistTraderCities || blck_blacklistSpawns || blck_listConcreteMixerZones) then {execVM "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getTraderCitesExile.sqf";};
};
blck_configsLoaded = true;

View File

@ -1,33 +1,23 @@
/*
This file contains most constants that define mission parameters, AI behavior and loot for mission system.
Last modified 8/1/15
*/
#define DBDserver 1
if (blck_debugON) then {diag_log "[blckeagls] Loading blck_configs_epoch.sqf";};
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";
////////////
// Epoch-specific settings
////////////
/*
Configuration for Addons that support the overall Mission system.
These are a module to spawn map addons generated with the Eden Editor
And a moduel to spawn static loot crates at specific location
A time acceleration module.
*/
blck_spawnMapAddons = true; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf
blck_spawnStaticLootCrates = true; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent).
// Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1; // Daytime time accelearation
blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 6; // Nighttim time acceleration
/**************************************************************
BLACKLIST LOCATIONS
**************************************************************/
// if true then missions will not spawn within 1000 m of spawn points for Altis, Bornholm, Cherno, Esseker or stratis.
blck_blacklistTraderCities = true; // Set this = true if you would like the mission system to automatically search for the locations of the Epoch trader cities. Note that these are pre-defined in GMS_fnc_findWorld for the most common maps.
// list of locations that are protected against mission spawns
switch (toLower(worldName)) do
@ -44,208 +34,15 @@ Last modified 8/1/15
};
};
/***********************************************************
GENERAL MISSION SYSTEM CONFIGURATION
***********************************************************/
////////
// Headless Client Configurations
blck_useHC = false; // Not Yet Working
// Kill message configurations
// These determine whether and when messages are sent to players regarding AI Kills or illegal kills that might damage a vehicle.
blck_useKillMessages = false; // when true a message will be broadcast to all players each time an AI is killed; may impact server performance.
blck_useKillScoreMessage = true; // when true a tile is displayed to the killer with the kill score information
blck_useIEDMessages = true;
// MISSION MARKER CONFIGURATION
// blck_labelMapMarkers: Determines if when the mission composition provides text labels, map markers with have a text label indicating the mission type
//When set to true,"arrow", text will be to the right of an arrow below the mission marker.
// When set to true,"dot", ext will be to the right of a black dot at the center the mission marker.
blck_labelMapMarkers = [true,"center"];
blck_preciseMapMarkers = true; // Map markers are/are not centered at the loot crate
//Minimum distance between missions
blck_MinDistanceFromMission = 2000;
// global loot crate options
// Options to spawn a smoking wreck near the mission. When the first parameter is true, a wreck or junk pile will be spawned.
// It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission.
blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether.
blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion.
blck_loadCratesTiming = "atMissionCompletion"; // valid choices are "atMissionCompletion" and "atMissionSpawn";
// PLAYER PENALTIES
blck_RunGear = true; // When set to true, AI that have been run over will ve stripped of gear, and the vehicle will be given blck_RunGearDamage of damage.
blck_RunGearDamage = 0.2; // Damage applied to player vehicle for each AI run over
blck_VK_Gear = true; // When set to true, AI that have been killed by a player in a vehicle in the list of forbidden vehicles or using a forbiden gun will be stripped of gear and the vehicle will be given blck_RunGearDamage of damage
blck_VK_RunoverDamage = true; // when the AI was run over blck_RunGearDamage of damage will be applied to the killer's vehicle.
blck_VK_GunnerDamage = true; // when the AI was killed by a gunner on a vehicle that is is in the list of forbidden vehicles, blck_RunGearDamage of damage will be applied to the killer's vehicle each time an AI is killed with a vehicle's gun.
blck_forbidenVehicles = ["B_MRAP_01_hmg_F","O_MRAP_02_hmg_F"]; // Add any vehicles for which you wish to forbid vehicle kills
// For a listing of the guns mounted on various land vehicles see the following link: https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Vehicle_Weapons
// HMG_M2 is mounted on the armed offroad that is spawned by Epoch
blck_forbidenVehicleGuns = ["LMG_RCWS","LMG_M200","HMG_127","HMG_127_APC",/*"HMG_M2",*/"HMG_NSVT","GMG_40mm","GMG_UGV_40mm","autocannon_40mm_CTWS","autocannon_30mm_CTWS","autocannon_35mm","LMG_coax","autocannon_30mm","HMG_127_LSV_01"]; // Add any vehicles for which you wish to forbid vehicle kills, o
// GLOBAL MISSION PARAMETERS
blck_useKilledAIName = true; // When false, the name of the killer (player), weapon and distance are displayed; otherwise the name of the player, distance and name of AI unit killed are shown.
blck_useMines = false; // when true mines are spawned around the mission area. these are cleaned up when a player reaches the crate. Turn this off if you have vehicle patrols.
blck_cleanupCompositionTimer = 1200; // Mission objects will be deleted after the mission is completed after a deley set by this timer.
blck_cleanUpLootChests = false; // when true, loot crates will be deleted together with other mission objects.
blck_MissionTimout = 60*60; // 60 min - missions will timeout and respawn in another location. This prevents missions in impossible locations from persisting.
// AI VEHICLE PATROL PARAMETERS
// Settings for Mission Vehicles.
blck_useVehiclePatrols = true; // When true vehicles will be spawned at missions and will patrol the mission area.
blck_killEmptyAIVehicles = false; // when true, the AI vehicle will be extensively damaged once all AI have gotten out.
blck_AIPatrolVehicles = ["B_G_Offroad_01_armed_EPOCH","B_LSV_01_armed_F"]; // Type of vehicle spawned to defend AI bases
// AI STATIC WEAPON PARAMETERS
blck_useStatic = true; // When true, AI will man static weapons spawned 20-30 meters from the mission center. These are very effective against most vehicles
blck_killEmptyStaticWeapons = true; // When true, static weapons will have damage set to 1 when the AI manning them is killed.
blck_staticWeapons = ["B_HMG_01_high_F"/*,"B_GMG_01_high_F","O_static_AT_F"*/]; // [0.50 cal, grenade launcher, AT Launcher]
// AI paratrooper reinforcement paramters
blck_enableReinforcements = false; // When true, reinforcements will be spawned at missions based on a probability defined in each mission template.
// Armed Helis
blck_AIHelis = ["B_Heli_Light_01_armed_F","B_Heli_Transport_01_camo_F","B_Heli_Transport_03_F"]; // The helis used to bring in and drop reinforcements.
// Unarmed Helis provided for reference.
// ["B_Heli_Transport_03_unarmed_EPOCH","O_Heli_Light_02_unarmed_EPOCH","I_Heli_Transport_02_EPOCH"];
// Mission - specific settings
//Set to -1 to disable. Values of 2 or more force the mission spawner to spawn copies of that mission - this feature is not thoroughly tested.
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = 1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = 1;
#ifdef DBDserver
blck_enableHunterMissions = 1;
blck_enableScoutsMissions = 1;
blck_maxcrashsites = 3;
#endif
//Defines how many AI Vehicles to spawn. Set this to -1 to disable spawning of static weapons or vehicles. To discourage players runniing with with vehicles, spawn more B_GMG_01_high
blck_SpawnVeh_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnVeh_Green = 2; // Number of static weapons at Green Missions
blck_SpawnVeh_Blue = -1; // Number of static weapons at Blue Missions
blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions
// Defines how many static weapons to spawn. Set this to -1 to disable spawning
blck_SpawnEmplaced_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnEmplaced_Green = 2; // Number of static weapons at Green Missions
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnEmplaced_Red = 1; // Number of static weapons at Red Missions
// MISSION TIMERS
// Reduce to 1 sec for immediate spawns, or longer if you wish to space the missions out
blck_TMin_Orange = 250;
blck_TMin_Green = 200;
blck_TMin_Blue = 120;
blck_TMin_Red = 150;
#ifdef DBDserver
blck_TMin_Hunter = 120;
blck_TMin_Scouts = 115;
blck_TMin_Crashes = 115;
blck_TMin_UMS = 200;
#endif
//Maximum Spawn time between missions in seconds
blck_TMax_Orange = 360;
blck_TMax_Green = 300;
blck_TMax_Blue = 200;
blck_TMax_Red = 250;
#ifdef DBDserver
blck_TMax_Hunter = 200;
blck_TMax_Scouts = 200;
blck_TMax_Crashes = 200;
blck_TMax_UMS = 280;
#endif
/****************************************************************
GENERAL AI SETTINGS
****************************************************************/
blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes.
blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND"
blck_AI_Side = RESISTANCE;
blck_chanceBackpack = 0.3; // Chance AI will be spawned with a backpack
blck_useNVG = true; // When true, AI will be spawned with NVG if is dark
blck_removeNVG = false; // When true, NVG will be removed from AI when they are killed.
blck_useLaunchers = true; // When true, some AI will be spawned with RPGs; they do not however fire on vehicles for some reason so I recommend this be set to false for now
//blck_launcherTypes = ["launch_NLAW_F","launch_RPG32_F","launch_B_Titan_F","launch_I_Titan_F","launch_O_Titan_F","launch_B_Titan_short_F","launch_I_Titan_short_F","launch_O_Titan_short_F"];
blck_launcherTypes = ["launch_RPG32_F"];
blck_launchersPerGroup = 1; // Defines the number of AI per group spawned with a launcher
blck_launcherCleanup = true;// When true, launchers and launcher ammo are removed from dead AI.
//This defines how long after an AI dies that it's body disappears.
blck_bodyCleanUpTimer = 1200; // time in seconds after which dead AI bodies are deleted
// Each time an AI is killed, the location of the killer will be revealed to all AI within this range of the killed AI, set to -1 to disable
// values are ordered as follows [blue, red, green, orange];
blck_AliveAICleanUpTimer = 1200; // Time after mission completion at which any remaining live AI are deleted.
blck_AIAlertDistance = [250,325,450,500];
//blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4];
blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0.
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
**************************************************************/
//This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type
// Orange Missions
blck_MinAI_Orange = 20;
blck_MaxAI_Orange = 25;
blck_AIGrps_Orange = 6;
blck_SkillsOrange = [
["aimingAccuracy",0.4],["aimingShake",0.7],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 5;
blck_SkillsGreen = [
["aimingAccuracy",0.3],["aimingShake",0.65],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.2],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;
blck_maxMoneyRed = 15;
blck_maxMoneyBlue = 10;
/*********************************************************************************
AI WEAPONS, UNIFORMS, VESTS AND GEAR
**********************************************************************************/
blck_AI_Side = RESISTANCE;
blck_AIPatrolVehicles = ["B_G_Offroad_01_armed_EPOCH","B_LSV_01_armed_F"]; // Type of vehicle spawned to defend AI bases
#define useAPEX 1
// Blacklisted itesm
@ -336,7 +133,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
//This defines the random weapon to spawn on the AI
//https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons
blck_WeaponList_Orange = blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG + blck_DLC_Sniper + blck_DLC_MMG + blck_apexWeapons;
blck_WeaponList_Orange = blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG + blck_DLC_Sniper + blck_DLC_MMG;
blck_WeaponList_Green = blck_RifleSniper + blck_RifleAsault_650 +blck_RifleLMG + blck_DLC_MMG + blck_apexWeapons;
blck_WeaponList_Blue = blck_RifleOther + blck_RifleAsault_556 +blck_RifleAsault_650;
blck_WeaponList_Red = blck_RifleAsault_556 + blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG;
@ -1045,5 +842,4 @@ for examples of how you can do this see \Major\Compositions.sqf
blck_crateTypes = ["Box_FIA_Ammo_F","Box_FIA_Support_F","Box_FIA_Wps_F","I_SupplyCrate_F","Box_NATO_AmmoVeh_F","Box_East_AmmoVeh_F","IG_supplyCrate_F","Box_NATO_Wps_F","I_CargoNet_01_ammo_F","O_CargoNet_01_ammo_F","B_CargoNet_01_ammo_F"]; // Default crate type.
diag_log "[blckeagls] Configurations for Epoch Loaded";
blck_configsLoaded = true;
blck_configsEpochLoaded = true;

View File

@ -1,257 +1,50 @@
/*
This file contains most constants that define mission parameters, AI behavior and loot for mission system.
Last modified 8/1/15
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/
*/
#define DBDserver 1
if (blck_debugON) then {diag_log "[blckeagls] Loading blck_configs_exlie.sqf";};
/*
Configuration for Addons that support the overall Mission system.
These are a module to spawn map addons generated with the Eden Editor
And a moduel to spawn static loot crates at specific location
A time acceleration module.
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
////////////
// Exile-specific settings
////////////
blck_spawnMapAddons = true; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf
blck_spawnStaticLootCrates = true; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent).
// Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1; // Daytime time accelearation
blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 6; // Nighttim time acceleration
/**************************************************************
BLACKLIST LOCATIONS
**************************************************************/
// if true then missions will not spawn within 1000 m of spawn points for Altis, Bornholm, Cherno, Esseker or stratis.
blck_listConcreteMixerZones = true;
blck_blacklistSpawns = true;
blck_blacklistTraderCities = true; // Set this = true if you would like the mission system to automatically search for the locations of the trader cities. Note that these are pre-defined in GMS_fnc_findWorld for the most common maps.
// list of locations that are protected against mission spawns
switch (toLower(worldName)) do
{
case "altis": {
blck_locationBlackList append [
//Add location as [[xpos,ypos,0],minimumDistance],
// Note that there should not be a comma after the last item in this table
[[10800,10641,0],1000] // isthmus - missions that spawn here often are glitched.
];
};
case "tanoa": {
blck_locationBlackList append [ ];
};
// list of locations that are protected against mission spawns
switch (toLower(worldName)) do
{
case "altis": {
blck_locationBlackList append [
//Add location as [[xpos,ypos,0],minimumDistance],
// Note that there should not be a comma after the last item in this table
[[10800,10641,0],1000] // isthmus - missions that spawn here often are glitched.
];
};
/***********************************************************
GENERAL MISSION SYSTEM CONFIGURATION
***********************************************************/
////////
// Headless Client Configurations
blck_useHC = false; // Not Yet Working
// Kill message configurations
// These determine whether and when messages are sent to players regarding AI Kills or illegal kills that might damage a vehicle.
blck_useKillMessages = false; // when true a message will be broadcast to all players each time an AI is killed; may impact server performance.
blck_useKillScoreMessage = true; // when true a tile is displayed to the killer with the kill score information
blck_useIEDMessages = true;
// MISSION MARKER CONFIGURATION
// blck_labelMapMarkers: Determines if when the mission composition provides text labels, map markers with have a text label indicating the mission type
//When set to true,"arrow", text will be to the right of an arrow below the mission marker.
// When set to true,"dot", ext will be to the right of a black dot at the center the mission marker.
blck_labelMapMarkers = [true,"center"];
blck_preciseMapMarkers = true; // Map markers are/are not centered at the loot crate
//Minimum distance between missions
blck_MinDistanceFromMission = 2000;
// global loot crate options
// Options to spawn a smoking wreck near the mission. When the first parameter is true, a wreck or junk pile will be spawned.
// It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission.
blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether.
blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion.
blck_loadCratesTiming = "atMissionCompletion"; // valid choices are "atMissionCompletion" and "atMissionSpawn";
// PLAYER PENALTIES
blck_RunGear = true; // When set to true, AI that have been run over will ve stripped of gear, and the vehicle will be given blck_RunGearDamage of damage.
blck_RunGearDamage = 0.2; // Damage applied to player vehicle for each AI run over
blck_VK_Gear = true; // When set to true, AI that have been killed by a player in a vehicle in the list of forbidden vehicles or using a forbiden gun will be stripped of gear and the vehicle will be given blck_RunGearDamage of damage
blck_VK_RunoverDamage = true; // when the AI was run over blck_RunGearDamage of damage will be applied to the killer's vehicle.
blck_VK_GunnerDamage = true; // when the AI was killed by a gunner on a vehicle that is is in the list of forbidden vehicles, blck_RunGearDamage of damage will be applied to the killer's vehicle each time an AI is killed with a vehicle's gun.
blck_forbidenVehicles = ["B_MRAP_01_hmg_F","O_MRAP_02_hmg_F"]; // Add any vehicles for which you wish to forbid vehicle kills
// For a listing of the guns mounted on various land vehicles see the following link: https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Vehicle_Weapons
blck_forbidenVehicleGuns = ["LMG_RCWS","LMG_M200","HMG_127","HMG_127_APC",/*"HMG_M2",*/"HMG_NSVT","GMG_40mm","GMG_UGV_40mm","autocannon_40mm_CTWS","autocannon_30mm_CTWS","autocannon_35mm","LMG_coax","autocannon_30mm","HMG_127_LSV_01"]; // Add any vehicles for which you wish to forbid vehicle kills, o
// GLOBAL MISSION PARAMETERS
blck_useKilledAIName = true; // When false, the name of the killer (player), weapon and distance are displayed; otherwise the name of the player, distance and name of AI unit killed are shown.
blck_useMines = false; // when true mines are spawned around the mission area. these are cleaned up when a player reaches the crate. Turn this off if you have vehicle patrols.
blck_cleanupCompositionTimer = 1200; // Mission objects will be deleted after the mission is completed after a deley set by this timer.
blck_cleanUpLootChests = false; // when true, loot crates will be deleted together with other mission objects.
blck_MissionTimout = 60*60; // 60 min - missions will timeout and respawn in another location. This prevents missions in impossible locations from persisting.
// AI VEHICLE PATROL PARAMETERS
// Settings for Mission Vehicles.
blck_useVehiclePatrols = true; // When true vehicles will be spawned at missions and will patrol the mission area.
blck_killEmptyAIVehicles = false; // when true, the AI vehicle will be extensively damaged once all AI have gotten out.
blck_AIPatrolVehicles = ["Exile_Car_Offroad_Armed_Guerilla01","Exile_Car_Offroad_Armed_Guerilla02","Exile_Car_BTR40_MG_Green","Exile_Car_BTR40_MG_Camo","Exile_Car_HMMWV_M134_Green","Exile_Car_HMMWV_M134_Desert",/*"Exile_Car_HMMWV_M134_Desert","Exile_Car_HMMWV_M2_Desert",*/"B_LSV_01_armed_F"]; // Type of vehicle spawned to defend AI bases
// AI STATIC WEAPON PARAMETERS
blck_useStatic = true; // When true, AI will man static weapons spawned 20-30 meters from the mission center. These are very effective against most vehicles
blck_killEmptyStaticWeapons = true; // When true, static weapons will have damage set to 1 when the AI manning them is killed.
blck_staticWeapons = ["B_HMG_01_high_F"/*,"B_GMG_01_high_F","O_static_AT_F"*/]; // [0.50 cal, grenade launcher, AT Launcher]
// AI paratrooper reinforcement paramters
blck_enableReinforcements = false; // When true, reinforcements will be spawned at missions based on a probability defined in each mission template.
// Armed Helis
blck_AIHelis = ["B_Heli_Light_01_armed_F","B_Heli_Transport_01_camo_F","B_Heli_Transport_03_F"]; // The helis used to bring in and drop reinforcements.
// Unarmed Helis provided for reference.
// ["Exile_Chopper_Orca_CSAT", "Exile_Chopper_Orca_Black","","Exile_Chopper_Huey_Desert","Exile_Chopper_Hummingbird_Green","Exile_Chopper_Huron_Green"]
// Mission - specific settings
//Set to -1 to disable. Values of 2 or more force the mission spawner to spawn copies of that mission - this feature is not thoroughly tested.
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = 1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = 1;
#ifdef DBDserver
blck_enableHunterMissions = 1;
blck_enableScoutsMissions = 1;
blck_maxcrashsites = 3;
#endif
//Defines how many AI Vehicles to spawn. Set this to -1 to disable spawning of static weapons or vehicles. To discourage players runniing with with vehicles, spawn more B_GMG_01_high
blck_SpawnVeh_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnVeh_Green = 2; // Number of static weapons at Green Missions
blck_SpawnVeh_Blue = -1; // Number of static weapons at Blue Missions
blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions
// Defines how many static weapons to spawn. Set this to -1 to disable spawning
blck_SpawnEmplaced_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnEmplaced_Green = 2; // Number of static weapons at Green Missions
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnEmplaced_Red = 1; // Number of static weapons at Red Missions
// MISSION TIMERS
// Reduce to 1 sec for immediate spawns, or longer if you wish to space the missions out
blck_TMin_Orange = 250;
blck_TMin_Green = 200;
blck_TMin_Blue = 120;
blck_TMin_Red = 150;
#ifdef DBDserver
blck_TMin_Hunter = 120;
blck_TMin_Scouts = 115;
blck_TMin_Crashes = 115;
blck_TMin_UMS = 200;
#endif
//Maximum Spawn time between missions in seconds
blck_TMax_Orange = 360;
blck_TMax_Green = 300;
blck_TMax_Blue = 200;
blck_TMax_Red = 250;
#ifdef DBDserver
blck_TMax_Hunter = 200;
blck_TMax_Scouts = 200;
blck_TMax_Crashes = 200;
blck_TMax_UMS = 280;
#endif
/****************************************************************
GENERAL AI SETTINGS
****************************************************************/
blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes.
blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND"
blck_AI_Side = EAST;
blck_chanceBackpack = 0.3; // Chance AI will be spawned with a backpack
blck_useNVG = true; // When true, AI will be spawned with NVG if is dark
blck_removeNVG = false; // When true, NVG will be removed from AI when they are killed.
blck_useLaunchers = true; // When true, some AI will be spawned with RPGs; they do not however fire on vehicles for some reason so I recommend this be set to false for now
//blck_launcherTypes = ["launch_NLAW_F","launch_RPG32_F","launch_B_Titan_F","launch_I_Titan_F","launch_O_Titan_F","launch_B_Titan_short_F","launch_I_Titan_short_F","launch_O_Titan_short_F"];
blck_launcherTypes = ["launch_RPG32_F"];
blck_launchersPerGroup = 1; // Defines the number of AI per group spawned with a launcher
blck_launcherCleanup = true;// When true, launchers and launcher ammo are removed from dead AI.
//This defines how long after an AI dies that it's body disappears.
blck_bodyCleanUpTimer = 1200; // time in seconds after which dead AI bodies are deleted
// Each time an AI is killed, the location of the killer will be revealed to all AI within this range of the killed AI, set to -1 to disable
// values are ordered as follows [blue, red, green, orange];
blck_AliveAICleanUpTimer = 1200; // Time after mission completion at which any remaining live AI are deleted.
blck_AIAlertDistance = [250,325,450,500];
//blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4];
blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0.
/***************************************************************
MISSION TYPE SPECIFIC AI SETTINGS
**************************************************************/
//This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type
// Orange Missions
blck_MinAI_Orange = 20;
blck_MaxAI_Orange = 25;
blck_AIGrps_Orange = 6;
blck_SkillsOrange = [
["aimingAccuracy",0.4],["aimingShake",0.7],["aimingSpeed",0.7],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]
];
// Green Missions
blck_MinAI_Green = 16;
blck_MaxAI_Green = 21;
blck_AIGrps_Green = 5;
blck_SkillsGreen = [
["aimingAccuracy",0.3],["aimingShake",0.65],["aimingSpeed",0.65],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75]
];
// Red Missions
blck_MinAI_Red = 12;
blck_MaxAI_Red = 15;
blck_AIGrps_Red = 3;
blck_SkillsRed = [
["aimingAccuracy",0.2],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70]
];
// Blue Missions
blck_MinAI_Blue = 8;
blck_MaxAI_Blue = 12;
blck_AIGrps_Blue = 2;
blck_SkillsBlue = [
["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60]
];
// Add some money to AI; only works with Exile for now.
blck_maxMoneyOrange = 25;
blck_maxMoneyGreen = 20;
blck_maxMoneyRed = 15;
blck_maxMoneyBlue = 10;
case "tanoa": {
blck_locationBlackList append [ ];
};
};
/*********************************************************************************
AI WEAPONS, UNIFORMS, VESTS AND GEAR
**********************************************************************************/
#define useAPEX 1
blck_blacklistSpawns = false;
blck_listConcreteMixerZones = false;
blck_AI_Side = EAST;
blck_AIPatrolVehicles = ["Exile_Car_Offroad_Armed_Guerilla01","Exile_Car_Offroad_Armed_Guerilla02","Exile_Car_BTR40_MG_Green","Exile_Car_BTR40_MG_Camo","Exile_Car_HMMWV_M134_Green","Exile_Car_HMMWV_M134_Desert",/*"Exile_Car_HMMWV_M134_Desert","Exile_Car_HMMWV_M2_Desert",*/"B_LSV_01_armed_F"]; // Type of vehicle spawned to defend AI bases
// Blacklisted itesm
blck_blacklistedOptics = ["optic_Nightstalker","optic_tws","optic_tws_mg"];
@ -271,6 +64,8 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
//"optic_tws",
//"optic_tws_mg",
];
#ifdef useAPEX
blck_Optics_Apex = [
//Apex
"optic_Arco_blk_F", "optic_Arco_ghex_F",
@ -282,10 +77,9 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
"optic_Holosight_blk_F","optic_Holosight_khk_F","optic_Holosight_smg_blk_F"
];
blck_Optics = blck_Optics_Holo + blck_Optics_Reticule + blck_Optics_Scopes;
#ifdef useAPEX
blck_Optics = blck_Optics + blck_Optics_Apex;
#endif
blck_bipods = [
"bipod_01_F_blk","bipod_01_F_mtp","bipod_01_F_snd","bipod_02_F_blk","bipod_02_F_hex","bipod_02_F_tan","bipod_03_F_blk","bipod_03_F_oli",
//Apex
@ -336,33 +130,35 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
blck_DLC_Sniper = [
"srifle_DMR_02_camo_F","srifle_DMR_02_F","srifle_DMR_02_sniper_F","srifle_DMR_03_F","srifle_DMR_03_tan_F","srifle_DMR_04_F","srifle_DMR_04_Tan_F","srifle_DMR_05_blk_F","srifle_DMR_05_hex_F","srifle_DMR_05_tan_F","srifle_DMR_06_camo_F","srifle_DMR_06_olive_F"
];
//This defines the random weapon to spawn on the AI
//https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons
blck_WeaponList_Orange = blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG + blck_DLC_Sniper + blck_DLC_MMG;
blck_WeaponList_Green = blck_RifleSniper + blck_RifleAsault_650 +blck_RifleLMG + blck_DLC_MMG;
blck_WeaponList_Blue = blck_RifleOther + blck_RifleAsault_556 + blck_RifleAsault_650;
blck_WeaponList_Red = blck_RifleAsault_556 + blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG;
#ifdef useAPEX
blck_apexWeapons = ["arifle_AK12_F","arifle_AK12_GL_F","arifle_AKM_F","arifle_AKM_FL_F","arifle_AKS_F","arifle_ARX_blk_F","arifle_ARX_ghex_F","arifle_ARX_hex_F","arifle_CTAR_blk_F","arifle_CTAR_hex_F",
"arifle_CTAR_ghex_F","arifle_CTAR_GL_blk_F","arifle_CTARS_blk_F","arifle_CTARS_hex_F","arifle_CTARS_ghex_F","arifle_SPAR_01_blk_F","arifle_SPAR_01_khk_F","arifle_SPAR_01_snd_F",
"arifle_SPAR_01_GL_blk_F","arifle_SPAR_01_GL_khk_F","arifle_SPAR_01_GL_snd_F","arifle_SPAR_02_blk_F","arifle_SPAR_02_khk_F","arifle_SPAR_02_snd_F","arifle_SPAR_03_blk_F",
"arifle_SPAR_03_khk_F","arifle_SPAR_03_snd_F","arifle_MX_khk_F","arifle_MX_GL_khk_F","arifle_MXC_khk_F","arifle_MXM_khk_F"];
//This defines the random weapon to spawn on the AI
//https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons
blck_WeaponList_Orange = blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG + blck_DLC_Sniper + blck_DLC_MMG + blck_apexWeapons;
blck_WeaponList_Green = blck_RifleSniper + blck_RifleAsault_650 +blck_RifleLMG + blck_DLC_MMG + blck_apexWeapons;
blck_WeaponList_Blue = blck_RifleOther + blck_RifleAsault_556 +blck_RifleAsault_650;
blck_WeaponList_Red = blck_RifleAsault_556 + blck_RifleSniper + blck_RifleAsault_650 + blck_RifleLMG;
#ifdef useAPEX
blck_WeaponList_Orange = blck_WeaponList_Orange + blck_apexWeapons;
blck_WeaponList_Green = blck_WeaponList_Green + blck_apexWeapons;
#endif
blck_baseBackpacks = ["B_Carryall_ocamo","B_Carryall_oucamo","B_Carryall_mcamo","B_Carryall_oli","B_Carryall_khk","B_Carryall_cbr" ];
#ifdef useAPEX
blck_ApexBackpacks = [
"B_Bergen_mcamo_F","B_Bergen_dgtl_F","B_Bergen_hex_F","B_Bergen_tna_F","B_AssaultPack_tna_F","B_Carryall_ghex_F",
"B_FieldPack_ghex_F","B_ViperHarness_blk_F","B_ViperHarness_ghex_F","B_ViperHarness_hex_F","B_ViperHarness_khk_F",
"B_ViperHarness_oli_F","B_ViperLightHarness_blk_F","B_ViperLightHarness_ghex_F","B_ViperLightHarness_hex_F","B_ViperLightHarness_khk_F","B_ViperLightHarness_oli_F"
];
#ifdef useAPEX
];
blck_backpacks = blck_baseBackpacks + blck_ApexBackpacks;
#endif
blck_BanditHeadgear = ["H_Shemag_khk","H_Shemag_olive","H_Shemag_tan","H_ShemagOpen_khk"];
//This defines the skin list, some skins are disabled by default to permit players to have high visibility uniforms distinct from those of the AI.
blck_headgear = [
@ -640,7 +436,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
"V_PlateCarrierL_CTRG",
"V_PlateCarrierSpec_blk",
"V_PlateCarrierSpec_mtp",
"V_PlateCarrierSpec_rgr",
#ifdef useAPEX
//Apex
"V_TacChestrig_grn_F",
"V_TacChestrig_oli_F",
@ -654,6 +450,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
"V_BandollierB_ghex_F",
"V_TacVest_gen_F",
"V_PlateCarrier1_rgr_noflag_F",
#endif
"V_PlateCarrier2_rgr_noflag_F"
];
@ -1043,4 +840,4 @@ for examples of how you can do this see \Major\Compositions.sqf
diag_log format["[blckeagls] Configurations for Exile Loaded"];
blck_configsLoaded = true;
blck_configsExileLoaded = true;

View File

@ -1,41 +1,118 @@
/*
Place any overrides of the default configurations here.
This is a convenient way to specify the configuration you like without worrying about going through the individual config files with each update.
Several Examples are shown below.
/*
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";
diag_log "[blckeagls] Loading Configuration Overides";
switch (toLower (worldName)) do
{
case"tanoa": {blck_maxCrashSites = 2};
case"namalsk": {
blck_enableOrangeMissions = -1;
blck_enableGreenMissions = -1;
blck_enableRedMissions = -1;
blck_enableBlueMissions = 1;
}
private["_startTime"];
_startTime = diag_tickTime;
_world = toLower format ["%1", worldName];
private["_nightAccel","_dayAccel","_duskAccel"];
switch (_world) do {
case "altis":{_nightAccel = 3;_dayAccel=0.5; _duskAccel = 3;};
case "napf":{_nightAccel = 12; _dayAccel = 2;_duskAccel = 6;};
case "namalsk":{_nightAccel = 12; _dayAccel = 2;_duskAccel = 6;};
case "tanoa":{_nightAccel = 12; _dayAccel = 3.2;_duskAccel = 6;};
};
if (blck_debugON) then
switch (toLower (worldName)) do
{
case "altis":
{
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1.5; // Daytime time accelearation
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
};
case"tanoa":
{
blck_maxCrashSites = 2;
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1.4; // Daytime time accelearation
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
};
case"namalsk":
{
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = -1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = -1;
blck_enableHunterMissions = 1;
blck_enableScoutsMissions = -1;
blck_maxCrashSites = -1; // recommended settings: 3 for Altis, 2 for Tanoa, 1 for smaller maps. Set to -1 to disable
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 2; // Daytime time accelearation
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
};
case "esseker":
{
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = -1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = -1;
blck_enableHunterMissions = 1;
blck_enableScoutsMissions = -1;
blck_maxCrashSites = 1;
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1; // Daytime time accelearation
blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 6; // Nighttim time acceleration
};
case "panthera3":
{
blck_maxCrashSites = 2;
blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 1.4; // Daytime time accelearation
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
};
};
if (blck_debugON || (blck_debugLevel isEqualTo 3)) then
{
// Used primarily for debugging.
diag_log "[blckeagls] Debug seting is ON, Custom configurations used";
blck_useTimeAcceleration = false; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
blck_timeAccelerationDay = 12; // Daytime time accelearation
blck_timeAccelerationDusk = 18; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 24; // Nighttim time acceleration
blck_mainThreadUpdateInterval = 10;
blck_enableOrangeMissions = 1;
blck_enableGreenMissions = 1;
blck_enableRedMissions = 1;
blck_enableBlueMissions = 1;
blck_enableHunterMissions = -1;
blck_enableScoutsMissions = -1;
blck_maxCrashSites = 1;
blck_enabeUnderwaterMissions = -1;
blck_cleanupCompositionTimer = 10; // Time after mission completion at which items in the composition are deleted.
blck_AliveAICleanUpTimer = 10; // Time after mission completion at which any remaining live AI are deleted.
blck_bodyCleanUpTimer = 10;
blck_SpawnEmplaced_Orange = 3; // Number of static weapons at Orange Missions
blck_SpawnEmplaced_Green = 2; // Number of static weapons at Green Missions
blck_chanceHeliPatrolBlue = 1;
blck_SpawnEmplaced_Orange = 4; // Number of static weapons at Orange Missions
blck_SpawnEmplaced_Green = 3; // Number of static weapons at Green Missions
blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnEmplaced_Red = 2;
@ -44,31 +121,37 @@ if (blck_debugON) then
blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnVeh_Red = 2;
//blck_reinforcementsBlue = [0, 0, 0.0, 0]; // Chance of reinforcements, number of reinforcements, Chance of reinforcing heli patrols, chance of dropping supplies for the reinforcements
blck_TMin_Blue = 7;
blck_TMin_Red = 20;
blck_TMin_Green = 23;
blck_TMin_Orange = 20;
blck_TMin_Red = 10;
blck_TMin_Green = 13;
blck_TMin_Orange = 16;
blck_TMin_Hunter = 20;
blck_TMin_Scouts = 20;
blck_TMin_Crashes = 5;
//Maximum Spawn time between missions in seconds
blck_TMax_Blue = 12;
blck_TMax_Red = 35;
blck_TMax_Green = 38;
blck_TMax_Orange = 31;
//blck_reinforceBlue = [0.999, 2, 0.001];
//blck_MissionTimout = 10; // 40 min
blck_TMax_Red = 15;
blck_TMax_Green = 17;
blck_TMax_Orange = 21;
blck_TMax_Hunter = 22;
blck_TMax_Scouts = 22;
blck_TMax_Crashes = 15;
//blck_MissionTimout = 360; // 40 min
blck_MinAI_Blue = 1;
blck_MaxAI_Blue = 2;
blck_AIGrps_Blue = 1;
blck_SkillsBlue = [
["aimingAccuracy",0.01],
["aimingShake",0.3],
["aimingShake",0.01],
["aimingSpeed",0.01],
["endurance",0.5],
["spotDistance",0.7],
["spotTime",0.7],
["courage",0.7],
["endurance",0.01],
["spotDistance",0.01],
["spotTime",0.01],
["courage",0.01],
["reloadSpeed",0.80],
["commanding",0.8],
["general",1.00]

Some files were not shown because too many files have changed in this diff Show More