Many Bug Fixes. See changelog for a more complete listing

This commit is contained in:
Ghostrider-DbD- 2017-04-06 22:12:29 -04:00
parent 03c1dd94fc
commit 6ac700c048
28 changed files with 427 additions and 143 deletions

View File

@ -1,6 +1,6 @@
/*
By Ghostrider-DbD-
Last modified 3-18-17
Last modified 4-5-17
--------------------------
License
--------------------------
@ -51,14 +51,16 @@ while {true} do
{
_timer1min = diag_tickTime;
[] call blck_fnc_spawnPendingMissions;
if (_modType isEqualTo "Epoch") then
{
[] call blck_fnc_cleanEmptyGroups;
}; // Exile cleans up empty groups automatically so this should not be needed with that mod.
};
if (diag_tickTime - _timer5min > 300) then
if (blck_useTimeAcceleration) then
{
if (blck_timeAcceleration) then {[] call blck_fnc_timeAcceleration;};
if (diag_tickTime - _timer5min > 30) then {
[] call blck_fnc_timeAcceleration;
_timer5min = diag_tickTime;
};
};
};

View File

@ -12,17 +12,22 @@ private ["_result","_players"];
params["_pos","_dist",["_onFootOnly",false]];
_players = call blck_fnc_allPlayers;
_result = false;
//diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result];
if !(_onFootOnly) then
{
{
//diag_log format["_fnc_playerInRange:: !_onFootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance _x];
if ((_x distance2D _pos) < _dist) exitWith {_result = true;};
} forEach _players;
};
//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 _players;
};
//diag_log format["_fnc_playerInRange:: returning with _result = %1",_result];
_result

View File

@ -10,10 +10,11 @@
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

@ -17,9 +17,10 @@
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_aborted",false]];
diag_log format["_fnc_endMission: _blck_localMissionMarker %1 | _coords %2 | _mission %3 | _aborted %4",_blck_localMissionMarker,_coords,_mission,_aborted];
uisleep 0.1;
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {
if (blck_debugLevel > 0) then {
diag_log format["_fnc_endMission: _aborted = %1",_aborted];
};
#endif
@ -27,11 +28,11 @@
private["_cleanupAliveAITimer","_cleanupCompositionTimer"];
if (blck_useSignalEnd && !_aborted) then
{
//diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
diag_log format["**** Minor\SM1.sqf:: _crate = %1",_crates select 0];
[_crates select 0] spawn blck_fnc_signalEnd;
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
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];
};
@ -42,7 +43,7 @@
if (_aborted) then
{
#ifdef blck_debugMode
if (blck_debugLevel > 2) then {
if (blck_debugLevel > 0) then {
diag_log format["_fnc_endMission: Mission Aborted, setting all timers to 0"];
};
#endif
@ -52,7 +53,7 @@
} else {
#ifdef blck_debugMode
if (blck_debugLevel > 2) then {
if (blck_debugLevel > 0) then {
diag_log format["_fnc_endMission: Mission Completed without errors, setting all timers to default values"];
};
#endif
@ -62,8 +63,20 @@
[["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;
[_mines] spawn blck_fnc_clearMines;
//diag_log format["_fnc_endMission: (23) _objects = %1",_objects];
[_objects, _cleanupCompositionTimer] spawn blck_fnc_addObjToQue;
//diag_log format["_fnc_endMission:: (26) _blck_AllMissionAI = %1",_blck_AllMissionAI];
[_blck_AllMissionAI, (_cleanupAliveAITimer)] spawn blck_fnc_addLiveAItoQue;
@ -73,3 +86,4 @@
//diag_log format["_fnc_endMission:: (34) _mission = %1",_mission];
[_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue;
blck_missionsRunning = blck_missionsRunning - 1;
_aborted

View File

@ -106,13 +106,18 @@ while {_wait} do
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
@ -392,8 +397,12 @@ switch (_endCondition) do
};
//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
{
@ -405,21 +414,16 @@ while {_missionComplete isEqualTo -1} do
};
#ifdef blck_debugMode
if (blck_debugLevel > 1) then
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];
};
#endif
//diag_log format["[blckeagls] missionSpawner:: (418) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
{
// 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,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,false] call blck_fnc_endMission;
diag_log format["[blckeagls] missionSpawner:: (292)end of mission: _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] call blck_fnc_endMission;
//diag_log format["[blckeagls] missionSpawner:: (420)end of mission: blck_fnc_endMission returned value of %1","pending"];

View File

@ -15,6 +15,7 @@
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
@ -23,7 +24,7 @@ _objs = [];
{
_x params["_crateType","_crateOffset","_lootArray","_lootCounts"];
//_pos = [(_coords select 0)+(_crateOffset select 0),(_coords select 1) + (_crateOffset select 1),(_coords select 2)+(_crateOffset select 2)]; // calculate the world coordinates
//diag_log format["_fnc_spawnMissionCrates: _crateType = %1 | _crateOffset = %2 | _lootArray = %3 | _lootCounts = %4",_crateType,_crateOffset,_lootArray,_lootCounts];
diag_log format["_fnc_spawnMissionCrates: _crateType = %1 | _crateOffset = %2 | _lootArray = %3 | _lootCounts = %4",_crateType,_crateOffset,_lootArray,_lootCounts];
_pos = _coords vectorAdd _crateOffset;
_crate = [_pos,_crateType] call blck_fnc_spawnCrate;
_objs pushback _crate;

View File

@ -7,14 +7,16 @@
*/
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnPendingMissions:: blck_pendingMissions = %1", blck_pendingMissions];};
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 > 1) then {
if (blck_debugLevel > 0) then {
diag_log "_fnc_spawnPendingMissions:: --- >> Maximum number of missions is running; function exited without attempting to find a new mission to spawn";
};
#endif
@ -28,19 +30,14 @@ _readyToSpawnQue = [];
_readyToSpawnQue pushback _x;
};
} forEach blck_pendingMissions;
diag_log format["_fnc_spawnPendingMissions:: --- >> _readyToSpawnQue = %1",_readyToSpawnQue];
if (count _readyToSpawnQue < 1) exitWith {
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {
diag_log "_fnc_spawnPendingMissions:: --- >> There are no missions available to spawn at this time";
};
#endif
};
if (count _readyToSpawnQue > 0) then
{
_missionToSpawn = selectRandom _readyToSpawnQue;
#ifdef blck_debugMode
if (blck_debugLevel > 2) then
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)];
};
@ -53,5 +50,5 @@ _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

@ -16,7 +16,7 @@
params["_mission","_status",["_coords",[0,0,0]] ];
#ifdef blck_debugMode
if (blck_debugLevel > 2) then {diag_log format["_fnc_updateMissionQue :: _mission = %1 | _status = %2 | _coords = %3",_mission,_status,_coords];};
if (blck_debugLevel > 0) then {diag_log format["_fnc_updateMissionQue :: _mission = %1 | _status = %2 | _coords = %3",_mission,_status,_coords];};
#endif
private["_index","_element","_waitTime"];
@ -25,13 +25,13 @@ _index = blck_pendingMissions find _mission;
if (_index > -1) then
{
#ifdef blck_debugMode
if (blck_debuglevel > 2) then {diag_log format ["_fnc_updateMissionQue :: blck_pendingMissions began as %1",blck_pendingMissions];};
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 > 2) then {diag_log format["_fnc_updateMissionQue:: -- >> _element before update = %1",_element];};
if (blck_debuglevel > 0) then {diag_log format["_fnc_updateMissionQue:: -- >> _element before update = %1",_element];};
#endif
if (toLower(_status) isEqualTo "active") then {
@ -46,13 +46,13 @@ if (_index > -1) then
};
#ifdef blck_debugMode
if (blck_debuglevel > 2) then {diag_log format["_fnc_updateMissionQue:: -- >> _element after update = %1",_element];};
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 > 2) then {diag_log format ["_fnc_updateMissionQue :: blck_pendingMissions after update = %1",blck_pendingMissions];};
if (blck_debuglevel > 0) then {diag_log format ["_fnc_updateMissionQue :: blck_pendingMissions after update = %1",blck_pendingMissions];};
#endif
};

View File

@ -3,7 +3,7 @@
// 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
@ -13,20 +13,23 @@ if (!isServer) exitWith {};
blck_timeAccelerationDusk = 3; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 6; // Nighttim time acceleration
*/
#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;
#ifdef blck_debugMode3
diag_log format["_fnc_Time:: -- > _sunrise = %1 | _sunset = %2 | _time = %3",_sunrise,_sunset,_time];
// blck_debugMode3
#ifdef blck_debugMode
diag_log "fnc_Time:: Debug settings ON";
#endif
// Night
if (_time > (_sunset + 0.5) || _time < (_sunrise - 0.5)) exitWith {
setTimeMultiplier blck_timeAccelerationNight;
#ifdef blck_debugMode3
#ifdef blck_debugMode
diag_log format["NIGHT TIMGE ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#endif
};
@ -34,14 +37,14 @@ if (_time > (_sunset + 0.5) || _time < (_sunrise - 0.5)) exitWith {
// Day
if (_time > (_sunrise + 0.5) && _time < (_sunset - 0.5)) exitWith {
setTimeMultiplier blck_timeAccelerationDay;
#ifdef blck_debugMode3
#ifdef blck_debugMode
diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#endif
};
// default
setTimeMultiplier blck_timeAccelerationDusk;
#ifdef blck_debugMode3
#ifdef blck_debugMode
diag_log format["DUSK ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime];
#endif

View File

@ -1,10 +1,10 @@
/*
by Ghostrider
9-20-15
Because this is p-ecompiled there is less concern about keeping comments in.
4-5-17
*/
private["_knowsAbout","_intelligence";"_group"];
private["_knowsAbout","_intelligence","_group"];
params["_unit","_target"];
_intelligence = _unit getVariable ["intelligence",1];
_group = group _unit;

View File

@ -34,7 +34,12 @@ for "_i" from 1 to (count blck_liveMissionAI) do
{
//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];
if (_x != vehicle _x) then
{
[vehicle _x] call blck_fnc_decomissionAIVehicle;
};
[_x] call blck_fnc_deleteAI;
}forEach (_units select 0);
uiSleep 0.1;

View File

@ -4,7 +4,10 @@
Last updated 1/24/17
*/
#ifdef blck_debugMode
if (blck_debugLevel > 1) then {diag_log format["fnc_cleanupDeadAI called at time %1",diag_tickTime];};
#endif
private["_aiList","_ai"];
_aiList = +blck_deadAI;
{

View File

@ -9,12 +9,15 @@ private["_group","_isLegal","_weapon","_lastkill","_kills","_message","_killstre
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;

View File

@ -23,9 +23,11 @@ params["_ai_veh"];
/*
_ai_veh = _this select 0;
*/
_if (_ai_veh getVariable["disabled",false]) exitWith {};
_ai_veh_type = typeof _ai_veh;
_ai_veh_name = name _ai_veh;
_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

@ -4,20 +4,25 @@
By Ghostrider-DBD-
Copyright 2016
Last updated 1-22-17
Last updated 3-24-17
*/
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";
//diag_log format["_fnc_releastVehicletoPlayers.sqf: removing vehicle %1 from ",_v,blck_missionVehicles];
//blck_missionVehicles = blck_missionVehicles - [_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"];
//{
//_v removealleventhandlers _x;
//}forEach["Fired","Hit","HitPart","Reloaded","Dammaged","HandleDamage","GetIn","GetOut"];
#ifdef blck_debugMode
if (blck_debugLevel > 2) then

View File

@ -169,12 +169,29 @@ if !(isNull _grpPilot) then
//[_coords,2,10,_grpPilot,"random",["MOVE","SENTRY"]] call blck_fnc_setupWaypoints;
private["_wpDestination"];
[_grpPilot, 0] setWPPos _coords;
[_grpPilot, 0] setWaypointType "SENTRY";
[_grpPilot, 0] setWaypointSpeed "NORMAL";
[_grpPilot, 0] setWaypointBehaviour "AWARE";
[_grpPilot, 0] setWaypointStatements ["true","[group this, 0] setCurrentWaypoint [group this,0];"];
[_grpPilot,0] setWaypointTimeout [20,30,40];
for "_i" from 1 to 5 do
{
_pos = _coords getPos [15 + random (15), random(360)];
if (_i == 1) then
{
_wp = [_grpPilot, 0];
_wp setWPPos _pos;
} else {
_wp = _grpPilot addWaypoint [_pos, 25];
};
_wp setWaypointType "SAD";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointBehaviour "AWARE";
//[_grpPilot, 0] setWaypointStatements ["true","[group this, 0] setCurrentWaypoint [group this,0];"];
_wp setWaypointTimeout [20,30,40];
_wp = _grpPilot addWaypoint [_coords,25];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "AWARE";
_wp setWaypointTimeout [1, 1.1, 1.2];
};
_wp = _grpPilot addWaypoint [_coords,25];
_wp setWaypointType "CYCLE";
_grpPilot setCurrentWaypoint [_grpPilot,0];
#ifdef blck_debugMode

View File

@ -85,7 +85,7 @@ if !(isNull _group) then
_wp setWaypointCombatMode blck_combatMode;
_wp setWaypointTimeout [1,1.1,1.2];
_wp = _group addWaypoint [_p2, 25];
_wp setWaypointType "SENTRY";
_wp setWaypointType "SAD";
_wp setWaypointName "sentry";
_wp setWaypointBehaviour "AWARE";
_wp setWaypointCombatMode blck_combatMode;

View File

@ -62,6 +62,9 @@ _fn_releaseVehicle = {
} 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_missionVehicles = %2",_veh, blck_missionVehicles];};
blck_missionVehicles = blck_missionVehicles - [_veh];
if (blck_debugLevel > 0) then {diag_log format["_fnc_vehicleMonitor:: blck_missionVehicles updated to %1", blck_missionVehicles];};
[_veh] call blck_fnc_releaseVehicleToPlayers;
};
};
@ -73,6 +76,8 @@ _fn_releaseVehicle = {
// 0 1 2 3 4
// returns Array - format [[<Object>unit,<String>role,<Number>cargoIndex,<Array>turretPath,<Boolean>personTurret], ...]
//diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then
{
_crew = fullCrew _veh;
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
{
@ -90,6 +95,7 @@ _fn_releaseVehicle = {
};
} forEach _crew;
};
};
}forEach _vehList;

View File

@ -30,7 +30,6 @@ blck_fnc_playerInRange = compileFinal preprocessFileLineNumbers "\q\addons\cust
blck_fnc_playerInRangeArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_playerInRangeArray.sqf"; // GMS_fnc_playerInRangeArray
blck_fnc_mainThread = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_mainThread.sqf";
blck_fnc_allPlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_allPlayers.sqf";
blck_fnc_alertNearbyLeader = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_alertNearbyLeader.sqf";
#ifdef DBDserver
blck_fnc_broadcastServerFPS = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf";
@ -113,6 +112,7 @@ blck_fnc_processAIKill = compileFinal preprocessFileLineNumbers "\q\addons\cust
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

@ -23,14 +23,14 @@
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).
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_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below.
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 = 3; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 6; // Nighttim time acceleration
blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation
blck_timeAccelerationNight = 8; // Nighttim time acceleration
/**************************************************************
@ -38,9 +38,7 @@
**************************************************************/
// 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.
blck_blacklistSpawns = false;
blck_listConcreteMixerZones = false;
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.
/***********************************************************
@ -56,7 +54,7 @@
// 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;
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
@ -117,10 +115,10 @@
blck_chanceParaRed = 0.3;
blck_noParaRed = 3;
blck_chanceParaGreen = 0.4;
blck_noParaGreen = 4;
blck_chanceParaGreen = 0.2;
blck_noParaGreen = 0.4;
blck_chanceParaOrange = 0.5;
blck_chanceParaOrange = 0.4;
blck_noParaOrange = 4;
// Supplemental Loot Parameters.
@ -147,13 +145,13 @@
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.2; // 0.4;
blck_chanceHeliPatrolRed = 0; // 0.4;
blck_patrolHelisRed = _blck_littleBirds;
blck_chanceHeliPatrolGreen = 0.5;
blck_chanceHeliPatrolGreen = 0.2;
blck_patrolHelisGreen = _blck_littleBirds;
blck_chanceHeliPatrolOrange = 0.7;
blck_chanceHeliPatrolOrange = 0.5;
blck_patrolHelisOrange = _blck_armed_hellcats+_blck_armed_orcas;
@ -193,7 +191,7 @@
blck_TMin_Hunter = 120;
blck_TMin_Scouts = 115;
blck_TMin_Crashes = 115;
blck_TMin_UMS = 200;
//blck_TMin_UMS = 200;
#endif
//Maximum Spawn time between missions in seconds
@ -205,7 +203,7 @@
blck_TMax_Hunter = 200;
blck_TMax_Scouts = 200;
blck_TMax_Crashes = 200;
blck_TMax_UMS = 280;
//blck_TMax_UMS = 280;
#endif
///////////////////////////////
@ -250,7 +248,7 @@
****************************************************************/
blck_groupBehavior = "AWARE";
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_AI_Side = RESISTANCE;
@ -270,7 +268,9 @@
// 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];
// 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];

View File

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

View File

@ -17,6 +17,8 @@
////////////
// Exile-specific settings
////////////
blck_blacklistSpawns = false;
blck_listConcreteMixerZones = false;
// list of locations that are protected against mission spawns
@ -130,7 +132,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;

View File

@ -0,0 +1,99 @@
Core Mission System.
The core mission system is configured to run 4 different classes of mission (Blue, Red, Green and Orange) simultaneously.
Reducing value for ...\custom_serer\configs\blck_configs.sqf\blck_maxSpawnedMissions will reduce the number of missions running on the server.
General settings include the ability set whether and how messages to players regarding missions spawned or completed are displayed,
whether and how messages to players regarding killed AI are displayed
Number of AI groups;
Number of AI per group;
AI skills;
Number and type of static weapons;
Number and type of armed vehicle patrols.
Presence of AI helicopter patrols.
Whether such patrols drop AI reinforcements.
Loot can also be configured for each mission class. You can modify the number of weapons, magazines, items, construction materials, etc.
You can also adjust the choices for each of these types of items.
The equipment selected for each class of mission can also be specified.
Whether kills by guns mounted on vehicles are to be penalized (gunes that are prohobited are listed in blck_config.sys).
Whether to spawn a smoking wreck near the mission to be used as a visual landmark.
Whether to spawn mines (recommended only when no vehcle patrols are spawned).
Where possible, I have tried group weapons based on desirability from low rank (5.56 ammo) to high rank (7.6 caliber or larger, large bore sniper, heavy LMG) then combine these groups to define parameters as needed.
The missions themselves are spawned from templates which can be used to define:
the messages sent to players;
text used to label the mark
type of marker used to label the map
number of AI groups and number of AI
(optional) loot chest positions and loot to be loaded
type and location of any objects, buildings, or other entities that give the mission character
number and (optional) locations of static weapons
number of vehicle patrols
To create and run new missions simply:
layout an AI base in the Arma 3 editor,
export the base as an .sqf
Define the above parameters (nu. AI groups, No AI, etc)
add this information to the mission template and modify any messages accordingly
Add the name of the file (e.g., "newAImission" to the list of missions to be spawned of that class in ...\custom)server\missions\GMS_missionLists.sqf
Repack your custom_server.pbo
Performance considerations.
At present, missions do not actually spawn objects or players untill a player is within the trigger distance (1000 M).
Hence, performance penalties should be modest to none until players engage a mission.
There is some performance penalty to having a lot of dead AI on the server, or a lot of spawned objects used for scenery at AI missions. Hence, these are deleted after a certain time.
Static Mission System (WIP).
Additional Modules Available:
1. Time Acceleration
This provides an optional ability to accelerate time by user-specified factors.
The time acceleration can be specified for night, daytime and dusk.
Variables controlling the time acceleration module are located in ...\custom_server\configs\blck_configs.sqf and are:
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
Note that map/mod specific settings can be specified in blck_custom_config.sqf if that is helpful.
2. Map Addons
This module allows you to load map-addons (custom bases, enhancements to villages or towns, ATMs at traders etc) but to do so in a way that is map and mod-specific.
I use it to manage the map addons we run on multiple different Arma servers.
It is designed to permit you to place files in subdirectories of the MapAddons folder to simplyfy organization of the various files.
You can enable/disable the use of map-addons with the following variable found in ...\custom_server\configs\blck_configs:
blck_spawnMapAddons = false;
You can define which addons you wish to load in ...\custom_server\MapAddons\MapAddons_init.sqf.
3. Static Loot System
This module spawns loot crates at pre-specified locations on the ground, inside buildings or on roofs.
It is designed to function in conjunction with the Map Addons module if you wish it to.
It was derived from the loot crate spawner originally released by DarthRogue but has been extensively revised.
One enhancement is that I have written the code so that you do not need to sort items by there arma type (weapon, magazine, item).
In any event, it is a great tool for placing loot chests at AI strongholds or static missions.
Some basic features are:
Crates can be spawned at precise locations with / without a nearby smoking wreck to mark their location (which crates an apololyptic feel).
Crates can be loaded with one of 3 different loadouts (add more if you like) which can be specified or randomly determined.
If the number of possible spawn locations is greater than the number of crates to spawned, spawn locations will be randomly chosen giving some variation to your mission.
The static loot crate spawner is enabled/disable by changing the following variable in ...\custom_server\configs\blck_configs.sqf
blck_spawnStaticLootCrates = false;
I wrote the crate spawner in a way that helps me manage static loot crates across multiple maps and mods.
The configuration files for Epoch or Exile give examples of how to implement the system.
Known issues
1.

View File

@ -4,9 +4,17 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2
Contributions by Narines: bug fixes, testing, infinite ammo fix.
Ideas or code from that by Vampire and KiloSwiss have been used for certain functions.
3/23/17 Verision 6.58 build 46
4/6/17 Version 6.58 Build 50
[Added] A FAQ presenting an overview of the mission system and addons.
[Fixed] Mission timouts would prevent new missions from spawning after a while.
[Fixed] blck_timeAcceleration now determines if time acceleration is activated.
[Fixed] Missions did not complete correctly under certain circumstances.
3/23/17 Verision 6.58 build 48
Turned debugging off
Added some preprocessor commands to minimize the use of if()then for debugging purposes when running without any debugging settings on.
Teaks to heli patrol waypoint system.
bugfixes.
3/21/17 Version 6.58 Build 44
[Added] Each mission now has a setting for mines which is set to false. To use the global setting in blck_config for yoru mission just change this to read:

View File

@ -1,3 +1,3 @@
private ["_version","_versionDate"];
_blck_version = "6.58 Build 48";
_blck_versionDate = "3-23-17 8:00 PM";
_blck_version = "6.58 Build 50";
_blck_versionDate = "4-5-17 8:00 PM";

99
FAQ.txt Normal file
View File

@ -0,0 +1,99 @@
Core Mission System.
The core mission system is configured to run 4 different classes of mission (Blue, Red, Green and Orange) simultaneously.
Reducing value for ...\custom_serer\configs\blck_configs.sqf\blck_maxSpawnedMissions will reduce the number of missions running on the server.
General settings include the ability set whether and how messages to players regarding missions spawned or completed are displayed,
whether and how messages to players regarding killed AI are displayed
Number of AI groups;
Number of AI per group;
AI skills;
Number and type of static weapons;
Number and type of armed vehicle patrols.
Presence of AI helicopter patrols.
Whether such patrols drop AI reinforcements.
Loot can also be configured for each mission class. You can modify the number of weapons, magazines, items, construction materials, etc.
You can also adjust the choices for each of these types of items.
The equipment selected for each class of mission can also be specified.
Whether kills by guns mounted on vehicles are to be penalized (gunes that are prohobited are listed in blck_config.sys).
Whether to spawn a smoking wreck near the mission to be used as a visual landmark.
Whether to spawn mines (recommended only when no vehcle patrols are spawned).
Where possible, I have tried group weapons based on desirability from low rank (5.56 ammo) to high rank (7.6 caliber or larger, large bore sniper, heavy LMG) then combine these groups to define parameters as needed.
The missions themselves are spawned from templates which can be used to define:
the messages sent to players;
text used to label the mark
type of marker used to label the map
number of AI groups and number of AI
(optional) loot chest positions and loot to be loaded
type and location of any objects, buildings, or other entities that give the mission character
number and (optional) locations of static weapons
number of vehicle patrols
To create and run new missions simply:
layout an AI base in the Arma 3 editor,
export the base as an .sqf
Define the above parameters (nu. AI groups, No AI, etc)
add this information to the mission template and modify any messages accordingly
Add the name of the file (e.g., "newAImission" to the list of missions to be spawned of that class in ...\custom)server\missions\GMS_missionLists.sqf
Repack your custom_server.pbo
Performance considerations.
At present, missions do not actually spawn objects or players untill a player is within the trigger distance (1000 M).
Hence, performance penalties should be modest to none until players engage a mission.
There is some performance penalty to having a lot of dead AI on the server, or a lot of spawned objects used for scenery at AI missions. Hence, these are deleted after a certain time.
Static Mission System (WIP).
Additional Modules Available:
1. Time Acceleration
This provides an optional ability to accelerate time by user-specified factors.
The time acceleration can be specified for night, daytime and dusk.
Variables controlling the time acceleration module are located in ...\custom_server\configs\blck_configs.sqf and are:
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
Note that map/mod specific settings can be specified in blck_custom_config.sqf if that is helpful.
2. Map Addons
This module allows you to load map-addons (custom bases, enhancements to villages or towns, ATMs at traders etc) but to do so in a way that is map and mod-specific.
I use it to manage the map addons we run on multiple different Arma servers.
It is designed to permit you to place files in subdirectories of the MapAddons folder to simplyfy organization of the various files.
You can enable/disable the use of map-addons with the following variable found in ...\custom_server\configs\blck_configs:
blck_spawnMapAddons = false;
You can define which addons you wish to load in ...\custom_server\MapAddons\MapAddons_init.sqf.
3. Static Loot System
This module spawns loot crates at pre-specified locations on the ground, inside buildings or on roofs.
It is designed to function in conjunction with the Map Addons module if you wish it to.
It was derived from the loot crate spawner originally released by DarthRogue but has been extensively revised.
One enhancement is that I have written the code so that you do not need to sort items by there arma type (weapon, magazine, item).
In any event, it is a great tool for placing loot chests at AI strongholds or static missions.
Some basic features are:
Crates can be spawned at precise locations with / without a nearby smoking wreck to mark their location (which crates an apololyptic feel).
Crates can be loaded with one of 3 different loadouts (add more if you like) which can be specified or randomly determined.
If the number of possible spawn locations is greater than the number of crates to spawned, spawn locations will be randomly chosen giving some variation to your mission.
The static loot crate spawner is enabled/disable by changing the following variable in ...\custom_server\configs\blck_configs.sqf
blck_spawnStaticLootCrates = false;
I wrote the crate spawner in a way that helps me manage static loot crates across multiple maps and mods.
The configuration files for Epoch or Exile give examples of how to implement the system.
Known issues
1.

View File

@ -1,6 +1,6 @@
Blckegls mission system Ver 6.58
Build 48
Build 50
Included is an updated version of blckeagls mission system. This began as an effort to fix bugs in and upgrade version 2.0.2 as updated by Narines and has now evolved to a complete reworking of almost all code.

View File

@ -4,9 +4,17 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2
Contributions by Narines: bug fixes, testing, infinite ammo fix.
Ideas or code from that by Vampire and KiloSwiss have been used for certain functions.
3/23/17 Verision 6.58 build 46
4/6/17 Version 6.58 Build 50
[Added] A FAQ presenting an overview of the mission system and addons.
[Fixed] Mission timouts would prevent new missions from spawning after a while.
[Fixed] blck_timeAcceleration now determines if time acceleration is activated.
[Fixed] Missions did not complete correctly under certain circumstances.
3/23/17 Verision 6.58 build 48
Turned debugging off
Added some preprocessor commands to minimize the use of if()then for debugging purposes when running without any debugging settings on.
Teaks to heli patrol waypoint system.
bugfixes.
3/21/17 Version 6.58 Build 44
[Added] Each mission now has a setting for mines which is set to false. To use the global setting in blck_config for yoru mission just change this to read: