Added Option to Show Alive AI number at Missions.
This commit is contained in:
parent
5115c39c6d
commit
c8adb1f6d4
@ -0,0 +1,14 @@
|
||||
////////////////////////////////////////////
|
||||
// Delete and change Mission Markers
|
||||
// 7/10/15
|
||||
// by Ghostrider-DbD-
|
||||
//////////////////////////////////////////
|
||||
// delete a marker
|
||||
|
||||
//diag_log format["blck_fnc_deleteMarker:: _this = %1",_this];
|
||||
private["_markerName"];
|
||||
_markerName = _this select 0;
|
||||
deleteMarker _markerName;
|
||||
_markerName = "label" + _markerName;
|
||||
deleteMarker _markerName;
|
||||
//diag_log format["deleteMarker complete script for _this = %1",_this];
|
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Set Alive AI Count
|
||||
*/
|
||||
|
||||
params["_mArray","_count"];
|
||||
|
||||
_mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"];
|
||||
|
||||
//diag_log "++++++++++++++--- marker label arrow detected";
|
||||
_name = "ai_count" + _name;
|
||||
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) + (_size select 0), 0];
|
||||
_MainMarker = createMarker [_name, _textPos];
|
||||
_MainMarker setMarkerShape "Icon";
|
||||
_MainMarker setMarkerType "HD_Arrow";
|
||||
_MainMarker setMarkerColor "ColorBlack";
|
||||
_MainMarker setMarkerText format["% Alive",_count];
|
||||
|
||||
//_MainMarker setMarkerDir 37;
|
@ -0,0 +1,19 @@
|
||||
////////////////////////////////////////////
|
||||
// Create, delete and change Mission Markers
|
||||
// 7/10/15
|
||||
// by Ghostrider-DbD-
|
||||
//////////////////////////////////////////
|
||||
// spawn a temporary marker to indicate the position of a 'completed' mission
|
||||
// this will not show to JIP players
|
||||
|
||||
private["_location","_MainMarker","_name"];
|
||||
//diag_log format["blck_fnc_missionCompleteMarker:: _this = %1",_this];
|
||||
_location = _this select 0;
|
||||
_name = str(random(1000000)) + "MarkerCleared";
|
||||
_MainMarker = createMarker [_name, _location];
|
||||
_MainMarker setMarkerColor "ColorBlack";
|
||||
_MainMarker setMarkerType "n_hq";
|
||||
_MainMarker setMarkerText "Mission Cleared";
|
||||
uiSleep 300;
|
||||
deleteMarker _MainMarker;
|
||||
//diag_log format["missionCompleteMarker complete script for _this = %1",_this];
|
@ -0,0 +1,93 @@
|
||||
////////////////////////////////////////////
|
||||
// Create Mission Markers
|
||||
// by Ghostrider-GRG-
|
||||
//////////////////////////////////////////
|
||||
// spawn a round marker of a size and color specified in passed parameters
|
||||
|
||||
private["_blck_fn_configureRoundMarker"];
|
||||
|
||||
private["_blck_fn_configureRoundMarker"];
|
||||
_blck_fn_configureRoundMarker = {
|
||||
private["_name","_pos","_color","_size","_MainMarker","_arrowMarker","_labelMarker","_labelType"];
|
||||
//diag_log format["_blck_fn_configureRoundMarker: -: _this = %1", _this];
|
||||
params["_name","_pos","_color","_text","_size","_labelType"];
|
||||
|
||||
//diag_log format["_blck_fn_configureRoundMarker: _pos = %1, _color = %2, _size = %3, _name = %4, label %5",_pos, _color, _size, _name, _text];
|
||||
// Do not show the marker if it is in the left upper corner
|
||||
if ((_pos distance [0,0,0]) < 10) exitWith {};
|
||||
|
||||
_MainMarker = createMarker [_name, _pos];
|
||||
_MainMarker setMarkerColor _color;
|
||||
_MainMarker setMarkerShape "ELLIPSE";
|
||||
_MainMarker setMarkerBrush "Grid";
|
||||
_MainMarker setMarkerSize _size; //
|
||||
//diag_log format["_blck_fn_configureRoundMarker: -: _labelType = %1", _labelType];
|
||||
if (count toArray(_text) > 0) then
|
||||
{
|
||||
switch (_labelType) do {
|
||||
case "arrow":
|
||||
{
|
||||
//diag_log "++++++++++++++--- marker label arrow detected";
|
||||
_name = "label" + _name;
|
||||
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) - (_size select 0), 0];
|
||||
_arrowMarker = createMarker [_name, _textPos];
|
||||
_arrowMarker setMarkerShape "Icon";
|
||||
_arrowMarker setMarkerType "HD_Arrow";
|
||||
_arrowMarker setMarkerColor "ColorBlack";
|
||||
_arrowMarker setMarkerText _text;
|
||||
//_MainMarker setMarkerDir 37;
|
||||
};
|
||||
case "center":
|
||||
{
|
||||
//diag_log "++++++++++++++--- marker label dot detected";
|
||||
_name = "label" + _name;
|
||||
_labelMarker = createMarker [_name, _pos];
|
||||
_labelMarker setMarkerShape "Icon";
|
||||
_labelMarker setMarkerType "mil_dot";
|
||||
_labelMarker setMarkerColor "ColorBlack";
|
||||
_labelMarker setMarkerText _text;
|
||||
};
|
||||
};
|
||||
};
|
||||
if (isNil "_labelMarker") then {_labelMarker = ""};
|
||||
_labelMarker
|
||||
};
|
||||
|
||||
_blck_fn_configureIconMarker = {
|
||||
private["_MainMarker"];
|
||||
params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]];
|
||||
//diag_log format["_blck_fn_configureIconMarker: _name=%1; _pos=%2; _color=%3; _text=%4",_name,_pos,_color,_text];
|
||||
|
||||
_name = "label" + _name;
|
||||
_MainMarker = createMarker [_name, _pos];
|
||||
_MainMarker setMarkerShape "Icon";
|
||||
_MainMarker setMarkerType _icon;
|
||||
_MainMarker setMarkerColor _color;
|
||||
_MainMarker setMarkerText _text;
|
||||
_MainMarker
|
||||
};
|
||||
|
||||
//diag_log format["spawnMarker:: -- >> _this = %1",_this];
|
||||
// _this = [[""BlueMarker"",[12524.1,18204.7,0],""Bandit Patrol"",""center"",""ColorBlue"",[""ELIPSE"",[175,175]]],""ColorBlue"",""BlueMarker""]"
|
||||
params["_mArray"];
|
||||
private["_marker"];
|
||||
_mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"];
|
||||
_markerType params["_mShape","_mSize","_mBrush"];
|
||||
//diag_log format["spawnMarker.sqf:: -- >> _missionType %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerType %6",_missionType,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerType];
|
||||
|
||||
if ((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then // not an Icon ....
|
||||
{
|
||||
switch (_missionType) do {
|
||||
// params["_missionType","_pos","_text","_labelType","_color","_type","_size","_brush"];
|
||||
// Type Size Brush
|
||||
default {_marker = [_missionType,_markerPos,_markerColor,_markerLabel, _mSize,_markerLabelType,_mShape,_mBrush] call _blck_fn_configureRoundMarker;};
|
||||
};
|
||||
};
|
||||
if !((_markerType select 0) in ["ELIPSE","RECTANGLE"]) then
|
||||
{ // Deal with case of an icon
|
||||
// params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]];
|
||||
_marker = [_missionType,_markerPos, _markerColor,_markerLabel,_markerType select 0] call _blck_fn_configureIconMarker;
|
||||
};
|
||||
//diag_log format["spawnMarker complete script with _marker = %1",_marker];
|
||||
if (isNil "_marker") then {_marker = ""};
|
||||
_marker
|
@ -0,0 +1,13 @@
|
||||
/*
|
||||
by Ghostrider [GRG]
|
||||
--------------------------
|
||||
License
|
||||
--------------------------
|
||||
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||
|
||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
*/
|
||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||
params["_marker","_rootText","_missionAI"];
|
||||
//diag_log format["_fnc_updateMarkerAliveCount: _this = %1",_this];
|
||||
_marker setMarkerText format["%1 / %2 AI Alive",_rootText,{alive _x} count _missionAI];
|
@ -1,504 +0,0 @@
|
||||
/*
|
||||
Generic Mission Spawner
|
||||
By Ghostrider GRG
|
||||
Copyright 2016
|
||||
Last modified 10/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 ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups"];
|
||||
params["_coords","_mission",["_allowReinforcements",true]];
|
||||
//diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements];
|
||||
|
||||
////////
|
||||
// set all variables needed for the missions
|
||||
// data is pulled either from the mission description or from the _mission variable passsed as a parameter
|
||||
// Deal with situations where some of these variables might not be defined as well.
|
||||
////////
|
||||
|
||||
// _mission params[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange];
|
||||
_markerClass = _mission select 2;
|
||||
_aiDifficultyLevel = _mission select 3;
|
||||
|
||||
[_mission,"active",_coords] call blck_fnc_updateMissionQue;
|
||||
blck_ActiveMissionCoords pushback _coords;
|
||||
diag_log format["[blckeagls] missionSpawner (17):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
|
||||
private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot","_heliCrew","_loadCratesTiming"];
|
||||
|
||||
if (isNil "_markerColor") then {_markerColor = "ColorBlack"};
|
||||
if (isNil "_markerType") then {_markerType = ["mil_box",[]]};
|
||||
//if (isNil "_timeOut") then {_timeOut = -1;};
|
||||
if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn";
|
||||
if (isNil "_missionPatrolVehicles") then {
|
||||
//diag_log format["_missionSpawner (44):: _missionPatrolVehicles isNil, Definining it as an empty array"];
|
||||
_missionPatrolVehicles = [];
|
||||
//diag_log format["_missionSpawner (46):: _missionPatrolVehicles is %1",_missionPatrolVehicles];
|
||||
};
|
||||
if (isNil "_missionGroups") then {_missionGroups = []};
|
||||
private["_useMines","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"];
|
||||
if (isNil "_useMines") then {_useMines = blck_useMines;};
|
||||
|
||||
_objects = [];
|
||||
_mines = [];
|
||||
_crates = [];
|
||||
_aiGroup = [];
|
||||
_missionAIVehicles = [];
|
||||
_blck_AllMissionAI = [];
|
||||
_AI_Vehicles = [];
|
||||
_blck_localMissionMarker = [_markerClass,_coords,"","",_markerColor,_markerType];
|
||||
_delayTime = 1;
|
||||
_groupPatrolRadius = 50;
|
||||
|
||||
if (blck_labelMapMarkers select 0) then
|
||||
{
|
||||
//diag_log "labeling map markers *****";
|
||||
_blck_localMissionMarker set [2, _markerMissionName];
|
||||
};
|
||||
if !(blck_preciseMapMarkers) then
|
||||
{
|
||||
//diag_log "Map marker will be OFFSET from the mission position";
|
||||
_blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition];
|
||||
};
|
||||
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
|
||||
[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers;
|
||||
[_blck_localMissionMarker] call blck_fnc_spawnMarker;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";};
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (77) waiting for player to trigger the mission";};
|
||||
#endif
|
||||
////////
|
||||
// All parameters are defined, lets wait until a player is nearby or the mission has timed out
|
||||
////////
|
||||
|
||||
private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"];
|
||||
_missionStartTime = diag_tickTime;
|
||||
_playerInRange = false;
|
||||
_missionTimedOut = false;
|
||||
_wait = true;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (90) starting mission trigger loop"};
|
||||
#endif
|
||||
|
||||
while {_wait} do
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
//diag_log "missionSpawner:: top of mission trigger loop";
|
||||
if (blck_debugLevel > 2) exitWith {_playerInRange = true;};
|
||||
#endif
|
||||
|
||||
if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;};
|
||||
if ([_missionStartTime] call blck_fnc_timedOut) exitWith {_missionTimedOut = true;};
|
||||
uiSleep 5;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format["missionSpawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords];
|
||||
diag_log format["missionSpawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers];
|
||||
diag_log format["missionSpawner:: Trigger Loop - timeout = %1", [_missionStartTime] call blck_fnc_timedOut];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
if (_missionTimedOut) exitWith
|
||||
{
|
||||
/*
|
||||
|
||||
*/
|
||||
// Deal with the case in which the mission timed out.
|
||||
//["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers;
|
||||
blck_recentMissionCoords pushback [_coords,diag_tickTime];
|
||||
blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords];
|
||||
[_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue;
|
||||
blck_missionsRunning = blck_missionsRunning - 1;
|
||||
[_blck_localMissionMarker select 0] call compile preprocessfilelinenumbers "debug\deleteMarker.sqf";
|
||||
//_blck_localMissionMarker set [1,[0,0,0]];
|
||||
//_blck_localMissionMarker set [2,""];
|
||||
[_objects, 0.1] spawn blck_fnc_cleanupObjects;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (133) 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:: (142) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
private ["_temp"];
|
||||
if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate
|
||||
{
|
||||
_temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates;
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_objects append _temp;
|
||||
};
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
if (_useMines) then
|
||||
{
|
||||
_mines = [_coords] call blck_fnc_spawnMines;
|
||||
//uiSleep _delayTime;;
|
||||
};
|
||||
uiSleep _delayTime;
|
||||
_temp = [];
|
||||
diag_log format["_missionSpawner"" _missionLandscape = %1",_missionLandscape];
|
||||
if (_missionLandscapeMode isEqualTo "random") then
|
||||
{
|
||||
_temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape;
|
||||
} else {
|
||||
params["_center","_objects"];
|
||||
_temp = [_coords, _missionLandscape] call blck_fnc_spawnCompositionObjects;
|
||||
//uiSleep 1;
|
||||
};
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_objects append _temp;
|
||||
};
|
||||
//diag_log format["_fnc_missionSpawner:: (181)->> _objects = %1",_objects];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (190) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
uiSleep _delayTime;;
|
||||
|
||||
_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles;
|
||||
//uisleep 1;
|
||||
_crates append _temp;
|
||||
|
||||
uiSleep _delayTime;
|
||||
|
||||
_abort = false;
|
||||
_temp = [[],[],false];
|
||||
_temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear,_missionGroups] call blck_fnc_spawnMissionAI;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then {
|
||||
diag_log format["missionSpawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1;
|
||||
};
|
||||
|
||||
_abort = _temp select 1;
|
||||
if (blck_debugLevel > 2) then {
|
||||
diag_log format["missionSpawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1;
|
||||
};
|
||||
#endif
|
||||
|
||||
if (_abort) exitWith
|
||||
{
|
||||
if (blck_debugLevel > 1) then {
|
||||
diag_log "missionSpawner:: (220) grpNull returned, mission termination criteria met, calling blck_fnc_endMission"
|
||||
};
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1] 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:: (235) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
uiSleep _delayTime;
|
||||
_temp = [[],[],false];
|
||||
_abort = false;
|
||||
private["_patrolVehicles","_vehToSpawn"];
|
||||
_vehToSpawn = [_noVehiclePatrols] call blck_fnc_getNumberFromRange;
|
||||
//diag_log format["_missionSpawner:: _vehToSpawn = %1",_vehToSpawn];
|
||||
//diag_log format["_missionSpawner (245):: _missionPatrolVehicles = %1",_missionPatrolVehicles];
|
||||
if (blck_useVehiclePatrols && ((_vehToSpawn > 0) || count _missionPatrolVehicles > 0)) then
|
||||
{
|
||||
_temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_missionPatrolVehicles] 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 :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_abort = _temp select 2;
|
||||
};
|
||||
if !(_abort) then
|
||||
{
|
||||
_patrolVehicles = _temp select 0;
|
||||
_blck_AllMissionAI append (_temp select 1);
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
if (_abort) exitWith
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {
|
||||
diag_log "missionSpawner:: (279) grpNull returned, mission termination criteria met, calling blck_endMission";
|
||||
};
|
||||
#endif
|
||||
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1] call blck_fnc_endMission;
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
_temp = [[],[],false];
|
||||
_abort = false;
|
||||
|
||||
if (_allowReinforcements) then
|
||||
{
|
||||
_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout;
|
||||
_temp = [];
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (298) calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
private _noChoppers = 0;
|
||||
private _chancePara = 0.5;
|
||||
switch (toLower _aiDifficultyLevel) do
|
||||
{
|
||||
case "blue":{
|
||||
_noChoppers = [blck_noPatrolHelisBlue] call blck_fnc_getNumberFromRange;
|
||||
_chancePara = [blck_chanceParaBlue] call blck_fnc_getNumberFromRange;
|
||||
};
|
||||
case "red":{
|
||||
_noChoppers = [blck_noPatrolHelisRed] call blck_fnc_getNumberFromRange;
|
||||
_chancePara = [blck_chanceParaRed] call blck_fnc_getNumberFromRange;
|
||||
};
|
||||
case "green":{
|
||||
_noChoppers = [blck_noPatrolHelisGreen] call blck_fnc_getNumberFromRange;
|
||||
_chancePara = [blck_chanceParaGreen] call blck_fnc_getNumberFromRange;
|
||||
};
|
||||
case "orange":{
|
||||
_noChoppers = [blck_noPatrolHelisOrange] call blck_fnc_getNumberFromRange;
|
||||
_chancePara = [blck_chanceParaOrange] call blck_fnc_getNumberFromRange;
|
||||
};
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["_missionSpawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara];
|
||||
#endif
|
||||
for "_i" from 1 to (_noChoppers) do
|
||||
{
|
||||
//params["_coords","_aiSkillsLevel","_weapons","_uniforms","_headgear"];
|
||||
|
||||
_temp = [_coords,_aiDifficultyLevel,_weaponList,_uniforms,_headGear,_chancePara] call blck_fnc_spawnMissionReinforcements;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel >= 2) then
|
||||
{
|
||||
diag_log format["missionSpawner(334):: blck_fnc_spawnMissionReinforcements call for chopper # %1 out of a total of %2 choppers",_i, _noChoppers];
|
||||
diag_log format["missionSpawner(335):: _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:: (349) 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,1] call blck_fnc_endMission;
|
||||
};
|
||||
};
|
||||
};
|
||||
//////////////////////////
|
||||
// Spawn Crates and Emplaced Weapons Last to try to force them to correct positions relative to spawned buildinga or other objects.
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (361) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];};
|
||||
#endif
|
||||
uiSleep 15;
|
||||
private["_noEmplacedToSpawn"];
|
||||
_noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange;
|
||||
//diag_log format["_missionSpawner:: _noEmplacedToSpawn = %1",_vehToSpawn];
|
||||
if (blck_useStatic && (_noEmplacedToSpawn > 0)) then
|
||||
{
|
||||
// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"];
|
||||
_temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format ["missionSpawner:: (375) blck_fnc_spawnEmplacedWeaponArray returned _temp = %1",_temp];
|
||||
};
|
||||
#endif
|
||||
|
||||
if (typeName _temp isEqualTo "ARRAY") then
|
||||
{
|
||||
_abort = _temp select 2;
|
||||
};
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log format ["missionSpawner:: (387) _abort = %1",_abort];
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
if !(_abort) then
|
||||
{
|
||||
_objects append (_temp select 0);
|
||||
_blck_AllMissionAI append (_temp select 1);
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (400) Static Weapons Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
};
|
||||
if (_abort) exitWith
|
||||
{
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 2) then
|
||||
{
|
||||
diag_log "missionSpawner:: (410) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission";
|
||||
};
|
||||
#endif
|
||||
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1] call blck_fnc_endMission;
|
||||
};
|
||||
|
||||
uiSleep _delayTime;
|
||||
if (count _missionLootBoxes > 0) then
|
||||
{
|
||||
_crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates;
|
||||
}
|
||||
else
|
||||
{
|
||||
_crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming] call blck_fnc_spawnMissionCrates;
|
||||
|
||||
};
|
||||
|
||||
if (blck_cleanUpLootChests) then
|
||||
{
|
||||
_objects append _crates;
|
||||
};
|
||||
|
||||
|
||||
//uisleep 2;
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
|
||||
// Trigger for mission end
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["[blckeagls] mission Spawner(436) _endCondition = %1",_endCondition];
|
||||
#endif
|
||||
private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"];
|
||||
_missionComplete = -1;
|
||||
_startTime = diag_tickTime;
|
||||
|
||||
switch (_endCondition) do
|
||||
{
|
||||
case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;};
|
||||
case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;};
|
||||
case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;};
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["missionSpawner :: (449) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
#endif
|
||||
private["_locations"];
|
||||
_locations = [_coords];
|
||||
{
|
||||
_locations pushback (getPos _x);
|
||||
_x setVariable["crateSpawnPos", (getPos _x)];
|
||||
} forEach _crates;
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["missionSpawner (458):: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations];
|
||||
#endif
|
||||
private _crateStolen = false;
|
||||
#ifdef blck_debugMode
|
||||
diag_log format["missionSpawner(462):: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
#endif
|
||||
_fn_crateMoved = {
|
||||
params["_crate"];
|
||||
private _result = (_x distance (_x getVariable["crateSpawnPos",[0,0,0]])) > 10;
|
||||
//diag_log format["_fn_crateMoved:: _result = %1",_result];
|
||||
_result;
|
||||
};
|
||||
while {_missionComplete isEqualTo -1} do
|
||||
{
|
||||
//if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 180};
|
||||
if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {};
|
||||
if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {};
|
||||
|
||||
{
|
||||
if ({[_x] call _fn_crateMoved} count _crates > 0) exitWith
|
||||
{
|
||||
_missionComplete = 1;
|
||||
_crateStolen = true;
|
||||
};
|
||||
}forEach _crates;
|
||||
//diag_log format["missionSpawner:: (483) missionCompleteLoop - > players near = %1 and ai alive = %2 and crates stolen = %3",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI, _crateStolen];
|
||||
uiSleep 4;
|
||||
};
|
||||
if (_crateStolen) exitWith
|
||||
{
|
||||
diag_log format["missionSpawner:: (491) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen];
|
||||
[_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_mission,2] call blck_fnc_endMission;
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then
|
||||
{
|
||||
diag_log format["[blckeagls] missionSpawner:: (496) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
diag_log format["missionSpawner :: (497) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled];
|
||||
diag_log format["[blckeagls] missionSpawner:: (498) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName];
|
||||
};
|
||||
#endif
|
||||
private["_result"];
|
||||
// Force passing the mission name for informational purposes.
|
||||
_blck_localMissionMarker set [2, _markerMissionName];
|
||||
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0] call blck_fnc_endMission;
|
||||
|
||||
diag_log format["[blckeagls] missionSpawner:: (507)end of mission: blck_fnc_endMission has returned control to _fnc_missionSpawner"];
|
||||
|
@ -69,9 +69,11 @@ if !(blck_preciseMapMarkers) then
|
||||
};
|
||||
_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name?
|
||||
[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers;
|
||||
[_blck_localMissionMarker] call blck_fnc_spawnMarker;
|
||||
private _marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker;
|
||||
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";};
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (77) message players and spawn a mission marker";};
|
||||
if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (77) _marker = %1",_marker];};
|
||||
if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (77) waiting for player to trigger the mission";};
|
||||
#endif
|
||||
////////
|
||||
@ -120,7 +122,7 @@ if (_missionTimedOut) exitWith
|
||||
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 select 0] call blck_fnc_deleteMarker;
|
||||
//_blck_localMissionMarker set [1,[0,0,0]];
|
||||
//_blck_localMissionMarker set [2,""];
|
||||
[_objects, 0.1] spawn blck_fnc_cleanupObjects;
|
||||
@ -434,6 +436,17 @@ private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"];
|
||||
_missionComplete = -1;
|
||||
_startTime = diag_tickTime;
|
||||
|
||||
if (blck_showCountAliveAI) then
|
||||
{
|
||||
//diag_log format["_missionSpawner(441): Adding Number Alive AI: _marker = %1 | _markerMissionName = %2",_marker,_markerMissionName];
|
||||
//diag_log format["_missionSpawner(442): Alive AI = %1 | Current Marker Text = %2",{alive _x} count _blck_AllMissionAI, markerText _marker];
|
||||
if !(_marker isEqualTo "") then
|
||||
{
|
||||
[_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount;
|
||||
blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI];
|
||||
//diag_log format["_missionSpawner: blck_missionMarkers = %1",blck_missionMarkers];
|
||||
};
|
||||
};
|
||||
switch (_endCondition) do
|
||||
{
|
||||
case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;};
|
||||
@ -494,7 +507,16 @@ if (blck_debugLevel > 0) then
|
||||
private["_result"];
|
||||
// Force passing the mission name for informational purposes.
|
||||
_blck_localMissionMarker set [2, _markerMissionName];
|
||||
if (blck_showCountAliveAI) then
|
||||
{
|
||||
_marker setMarkerText format["%1: All AI Dead",_markerMissionName];
|
||||
// blck_missionMarkers pushBack [_marker, _markerMissionName, _blck_AllMissionAI];
|
||||
{
|
||||
if ((_x select 1) isEqualTo _markerMissionName) exitWith{blck_missionMarkers deleteAt _forEachIndex};
|
||||
}forEach blck_missionMarkers;
|
||||
};
|
||||
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0] call blck_fnc_endMission;
|
||||
|
||||
|
||||
diag_log format["[blckeagls] missionSpawner:: (507)end of mission: blck_fnc_endMission has returned control to _fnc_missionSpawner"];
|
||||
|
||||
|
@ -64,5 +64,13 @@ if (blck_useKillMessages) then
|
||||
[["aikilled",_message,"victory"],playableUnits] call blck_fnc_messageplayers;
|
||||
};
|
||||
[_unit,_killer] call blck_fnc_rewardKiller;
|
||||
|
||||
if (blck_showCountAliveAI) then
|
||||
{
|
||||
//diag_log "_fnc_processAIKills: Updating Map Marker AI Counts - blck_missionMarkers items are";
|
||||
{
|
||||
//diag_log format["_fnc_processAIKills: blck_missionMarkers itm %1 = %2",_forEachIndex,_x];
|
||||
[_x select 0, _x select 1, _x select 2] call blck_fnc_updateMarkerAliveCount;
|
||||
} forEach blck_missionMarkers;
|
||||
//call blck_fnc_updateAllMarkerAliveCounts;
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#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]];
|
||||
params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull],["_setWaypoints",true]];
|
||||
|
||||
|
||||
//_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.
|
||||
@ -61,7 +61,10 @@ if !(isNull _group) then
|
||||
// params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ];
|
||||
_group setcombatmode "RED";
|
||||
_group setBehaviour "COMBAT";
|
||||
[_center,_minDis,_maxDis,_group,"perimeter","SAD","vehicle"] spawn blck_fnc_setupWaypoints;
|
||||
if (_setWaypoints) then
|
||||
{
|
||||
[_center,_minDis,_maxDis,_group,"perimeter","SAD","vehicle"] spawn blck_fnc_setupWaypoints;
|
||||
};
|
||||
};
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 1) then
|
||||
|
@ -0,0 +1,214 @@
|
||||
/*
|
||||
Handle the case that all AI assigned to a vehicle are dead.
|
||||
Allows players to enter and use the vehicle when appropriate
|
||||
or otherwise destroys the vehicle.
|
||||
|
||||
Logic:
|
||||
1) Mission ended; players can keep vehicles BUT not all vehicle AI were killed - > delete vehicle when live AI are killed;
|
||||
2) Vehicle has a blck_deleteAT timer set - > delete vehicle;
|
||||
3) All AI killed an players may NOT keep vehicles - > detroy vehicle
|
||||
4) All AI Killed and players MAY keep vehicles -> release vehicle
|
||||
5) vehicle ammo low AND vehicle gunner is alive - > reloaded
|
||||
|
||||
By Ghostrider [GRG]
|
||||
Copyright 2016
|
||||
Last updated 12-22-17
|
||||
|
||||
--------------------------
|
||||
License
|
||||
--------------------------
|
||||
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||
|
||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
*/
|
||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||
|
||||
//diag_log format["_fnc_vehicleMonitor: starting function at diag_tickTime = %1",diag_tickTime];
|
||||
#ifdef blck_debugMode
|
||||
//diag_log format["_fnc_vehicleMonitor:: blck_debugMode defined"];
|
||||
#endif
|
||||
|
||||
_fn_releaseVehicle = {
|
||||
params["_veh"];
|
||||
//blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
_veh setVehicleLock "UNLOCKED" ;
|
||||
//_v setVariable["releasedToPlayers",true];
|
||||
//[_v] call blck_fnc_emptyObject;
|
||||
{
|
||||
_veh removealleventhandlers _x;
|
||||
} forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
|
||||
{
|
||||
_veh removeAllMPEventHandlers _x;
|
||||
} forEach ["MPHit","MPKilled"];
|
||||
_veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true];
|
||||
if ((damage _veh) > 0.5) then {_veh setDamage 0.5};
|
||||
//diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1 and blck_deleteAT = %2",_veh, _veh getVariable["blck_DeleteAt",0]];
|
||||
#ifdef blck_debugMode
|
||||
if (blck_debugLevel > 3) then
|
||||
{
|
||||
diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1",_veh];
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
_fn_destroyVehicleAndCrew = {
|
||||
params["_veh"];
|
||||
//private["_crew"];
|
||||
//_crew = crew _veh;
|
||||
//diag_log format["_fn_destroyVehicleAndCrew: called for _veh = %1",_veh];
|
||||
{[_x] call blck_fnc_deleteAI;} forEach (crew _veh);
|
||||
[_veh] call blck_fn_deleteAIvehicle;
|
||||
};
|
||||
|
||||
_fn_reloadAmmo = {
|
||||
params["_veh"];
|
||||
private ["_crew","_mag","_allMags","_cnt"];
|
||||
// https://community.bistudio.com/wiki/fullCrew
|
||||
// 0 1 2 3 4
|
||||
// returns Array - format [[<Object>unit,<String>role,<Number>cargoIndex,<Array>turretPath,<Boolean>personTurret], ...]
|
||||
//diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
|
||||
if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then
|
||||
{
|
||||
_crew = fullCrew _veh;
|
||||
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
|
||||
{
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x];
|
||||
_mag = _veh currentMagazineTurret (_x select 3);
|
||||
if (count _mag > 0) then
|
||||
{
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag];
|
||||
//diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag];
|
||||
_allMags = magazinesAmmo _veh;
|
||||
//diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags];
|
||||
_cnt = ( {_mag isEqualTo (_x select 0)}count _allMags);
|
||||
//diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt];
|
||||
if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]};
|
||||
};
|
||||
} forEach _crew;
|
||||
};
|
||||
};
|
||||
|
||||
blck_fn_deleteAIvehicle = {
|
||||
params["_veh"];
|
||||
//diag_log format["blck_fn_deleteAIvehicle: _veh %1 deleted",_veh];
|
||||
{
|
||||
_veh removeAllEventHandlers _x;
|
||||
}forEach ["Hit","HitPart","GetIn","GetOut","Fired","FiredNear","HandleDamage","Reloaded"];
|
||||
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
deleteVehicle _veh;
|
||||
};
|
||||
|
||||
private _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
|
||||
//blck_fnc_releaseVehicleToPlayers
|
||||
{
|
||||
/*
|
||||
Determine state of vehicle
|
||||
_isEmplaced
|
||||
_ownerIsPlayer
|
||||
_allCrewDead
|
||||
_deleteNow
|
||||
*/
|
||||
|
||||
private _veh = _x; // (purely for clarity at this point, _x could be used just as well)
|
||||
private _isEmplaced = _veh getVariable["DBD_vehType","none"] isEqualTo "emplaced";
|
||||
private _ownerIsPlayer = if (owner _veh > 2 && !(owner _veh in blck_connectedHCs)) then {true} else {false};
|
||||
private _allCrewDead = {alive _x} count (crew _veh);
|
||||
private _deletenow = if ( (_veh getVariable["blck_DeleteAt",0] > 0) && (diag_tickTime > (_veh getVariable "blck_DeleteAt"))) then {true} else {false};
|
||||
#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 = true;
|
||||
//diag_log format["_fnc_vehicleMonitor: owner of _veh %1 isEqualTo %2",_veh, owner _veh];
|
||||
|
||||
{
|
||||
// Vehicle is NOT local to server or an HC so a player so must have been entered.
|
||||
_evaluate = false;
|
||||
_veh setVariable["blck_DeleteAt",0];
|
||||
blck_monitoredVehicles = blck_monitoredVehicles - [_veh];
|
||||
diag_log format["_fnc_vehicleMonitor: vehicle %1 now owned by player %2",_veh, owner _veh];
|
||||
};
|
||||
//diag_log format["_fnc_vehicleMonitor: _veh = %1 getVariable[blck_DeleteAt] = %2",_veh, _veh getVariable["blck_DeleteAt",0]];
|
||||
if (_evaluate) then
|
||||
{
|
||||
//diag_log format["_fnc_vehicleMonitor: deleting _veh %1 with diag_tickTime %2 and blck_deleteAT %3",_veh,diag_tickTime,_veh getVariable["blck_DeleteAt",0]];
|
||||
// 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 released 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
|
||||
{
|
||||
//diag_log format["_fnc_vehicleMonitor:: case of destroyed where vehicle = %1",_veh];
|
||||
|
||||
#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;
|
||||
};
|
||||
};
|
||||
if ( (_veh getVariable["blck_DeleteAt",0]) > 0) then
|
||||
{
|
||||
_evaluate = false;
|
||||
};
|
||||
// Case where a vehicle is NOT an emplaced / static weapon and has no alive crew and such vehicles should be 'killed' or released 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 {
|
||||
//diag_log format["_fnc_vehicleMonitor:: case of RELEASE where vehicle = %1 and Vehicle is typeOf %2",_veh, typeOf _veh];
|
||||
[_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
|
||||
{
|
||||
//diag_log format["_fnc_vehicleMonitor:: case of mission vehicle with AI alive at mission end: schedule destruction with _veh = %1 and typeOf _veh = %2",_veh, typeOf _veh];
|
||||
private _cleanupTimer = _veh getVariable["blck_DeleteAt",0]; // The time delete to deleting any alive AI units
|
||||
if (_cleanupTimer == 0) then {_veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer]};
|
||||
if (diag_tickTime > _veh getVariable["blck_DeleteAt",0]) then
|
||||
{
|
||||
[_veh] call _fn_destroyVehicleAndCrew;
|
||||
_evaluate = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_evaluate) then
|
||||
{
|
||||
[_veh] call _fn_reloadAmmo;
|
||||
};
|
||||
}forEach _vehList;
|
||||
|
||||
|
||||
|
@ -33,6 +33,11 @@ blck_fnc_addItemToCrate = compileFinal preprocessFileLineNumbers "\q\addons\cust
|
||||
blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_loadLootItemsFromArray.sqf";
|
||||
blck_fnc_getNumberFromRange = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getNumberFromRange.sqf";
|
||||
blck_fnc_passToHCs = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_passToHCs.sqf";
|
||||
blck_fnc_spawnMarker = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_spawnMarker.sqf";
|
||||
blck_fnc_missionCompleteMarker = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_missionCompleteMarker.sqf";
|
||||
blck_fnc_deleteMarker = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_deleteMarker.sqf";
|
||||
blck_fnc_updateMarkerAliveCount = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_updateMarkerAliveCount.sqf";
|
||||
//blck_fnc_updateAllMarkerAliveCounts = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\updateAllMarkerAliveCounts.sqf"; // GMS_fnc_updateAllMarkerAliveCounts
|
||||
|
||||
#ifdef GRGserver
|
||||
blck_fnc_broadcastServerFPS = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf";
|
||||
|
@ -12,8 +12,8 @@
|
||||
*/
|
||||
#include"\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||
|
||||
blck_debugON = false;
|
||||
blck_debugLevel = 0; // Sets level of detail for debugging info - WIP.
|
||||
blck_debugON = true;
|
||||
blck_debugLevel = 1; // Sets level of detail for debugging info - WIP.
|
||||
blck_minFPS = 8;
|
||||
|
||||
////////////////////////////////////////////////
|
||||
@ -32,6 +32,7 @@ blck_missionsRunning = 0;
|
||||
blck_activeMissions = [];
|
||||
blck_deadAI = [];
|
||||
blck_connectedHCs = [];
|
||||
blck_missionMarkers = [];
|
||||
#ifdef useDynamicSimulation
|
||||
"Group" setDynamicSimulationDistance 1800;
|
||||
enableDynamicSimulationSystem true;
|
||||
|
@ -69,7 +69,7 @@
|
||||
// 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
|
||||
|
||||
blck_showCountAliveAI = true;
|
||||
|
||||
//Minimum distance between missions
|
||||
blck_MinDistanceFromMission = 1500;
|
||||
|
@ -64,7 +64,7 @@
|
||||
// When set to true,"dot", ext will be to the right of a black dot at the center the mission marker.
|
||||
blck_labelMapMarkers = [false,"center"];
|
||||
blck_preciseMapMarkers = false; // Map markers are/are not centered at the loot crate
|
||||
|
||||
blck_showCountAliveAI = true;
|
||||
|
||||
//Minimum distance between missions
|
||||
blck_MinDistanceFromMission = 1500;
|
||||
|
@ -8,9 +8,10 @@ Ideas or code from that by Vampire and KiloSwiss have been used for certain func
|
||||
|
||||
Significant Changes:
|
||||
=====================
|
||||
Version 1.79, Build 110
|
||||
Version 1.79, Build 112
|
||||
Added: Map-specific information for Lythium.
|
||||
Added: (in process) When blck_showCountOfAliveAI = true; The number of alive AI at a mission will be displayed by the mission marker.
|
||||
Added: New configuration setting: blck_showCountAliveAI = true; When = true, the number of alive AI at a mission will be displayed by the mission marker.
|
||||
Fixed: Setting blck_useTimeAcceleration = false; now disables the time acceleration module.
|
||||
Fixed: several issues with dynamic UMS missions.
|
||||
Changed: Please replace the debug folder in your mission PBO with the updated one found on the github.
|
||||
[removed all scripts for markers from mission\debug. These are now located in custom_server\compiles\functions.]
|
||||
|
Loading…
Reference in New Issue
Block a user