Build 146.

Methods for dealing with a killed asset changed.
After revision, the mission follows normal despawn timers but no loot crate is spawned.
In addition, minor adjustments were made to the load order of mission system modules in blck_init_server.sqf.
This commit is contained in:
Ghostrider-GRG- 2018-07-06 19:38:03 -04:00
parent ede1318cce
commit 52a9845b50
5 changed files with 218 additions and 76 deletions

View File

@ -62,12 +62,12 @@ _fn_missionCleanup = {
diag_log format["_fnc_endMission: Mission Aborted, setting all timers to 0"]; diag_log format["_fnc_endMission: Mission Aborted, setting all timers to 0"];
}; };
#endif #endif
/*
if (_endCondition == 2) then if (_endCondition == 2) then
{ {
[["warning",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers; [["warning",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;
}; };
*/
[_blck_localMissionMarker select 0] call blck_fnc_deleteMarker; [_blck_localMissionMarker select 0] call blck_fnc_deleteMarker;
_cleanupCompositionTimer = 0; _cleanupCompositionTimer = 0;
_cleanupAliveAITimer = 0; _cleanupAliveAITimer = 0;
@ -80,7 +80,7 @@ _fn_missionCleanup = {
deleteVehicle _x; deleteVehicle _x;
}forEach _vehicles; }forEach _vehicles;
}; };
if (_endCondition == 0) then // Normal Mission End State if (_endCondition <= 0) then // Normal Mission End State
{ {
//diag_log format["_fnc_endMission: mission end condition == 0 | setting all timers to 0"]; //diag_log format["_fnc_endMission: mission end condition == 0 | setting all timers to 0"];
private["_cleanupAliveAITimer","_cleanupCompositionTimer"]; private["_cleanupAliveAITimer","_cleanupCompositionTimer"];
@ -105,7 +105,8 @@ _fn_missionCleanup = {
_cleanupCompositionTimer = blck_cleanupCompositionTimer; _cleanupCompositionTimer = blck_cleanupCompositionTimer;
_cleanupAliveAITimer = blck_AliveAICleanUpTimer; _cleanupAliveAITimer = blck_AliveAICleanUpTimer;
[["end",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers; if (_endCondition == 0) then {[["end",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;};
if (_endCondition == -1) then {[["warning",_endMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers;};
[_blck_localMissionMarker select 0] call blck_fnc_deleteMarker; [_blck_localMissionMarker select 0] call blck_fnc_deleteMarker;
[_blck_localMissionMarker select 1, _markerClass] spawn blck_fnc_missionCompleteMarker; [_blck_localMissionMarker select 1, _markerClass] spawn blck_fnc_missionCompleteMarker;
// Using a variable attached to the crate rather than the global setting to be sure we do not fill a crate twice. // Using a variable attached to the crate rather than the global setting to be sure we do not fill a crate twice.

View File

@ -503,13 +503,15 @@ if (_crateStolen) exitWith
diag_log format["missionSpawner:: (542) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen]; diag_log format["missionSpawner:: (542) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen];
[_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_markerClass, 2] call blck_fnc_endMission; [_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_markerClass, 2] call blck_fnc_endMission;
}; };
/*
if ((_secureAsset) && !(alive _assetSpawned)) exitWith if ((_secureAsset) && !(alive _assetSpawned)) exitWith
{ {
[_mines,_objects,_crates, _blck_AllMissionAI,_assetKilledMsg,_blck_localMissionMarker,_coords,_markerClass, 2] call blck_fnc_endMission; [_mines,_objects,_crates, _blck_AllMissionAI,_assetKilledMsg,_blck_localMissionMarker,_coords,_markerClass, 2] call blck_fnc_endMission;
}; };
*/
if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then
{
if (!(_secureAsset) || (_secureAsset && (alive _assetSpawned))) then
{ {
if (count _missionLootBoxes > 0) then if (count _missionLootBoxes > 0) then
{ {
@ -533,13 +535,18 @@ if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then
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]}; 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 #endif
}; };
};
if (_spawnCratesTiming isEqualTo "atMissionSpawnGround" && _loadCratesTiming isEqualTo "atMissionCompletion") then if (_spawnCratesTiming isEqualTo "atMissionSpawnGround" && _loadCratesTiming isEqualTo "atMissionCompletion") then
{
if (!(_secureAsset) || (_secureAsset && (alive _assetSpawned))) then
{ {
{ {
[_x] call blck_fnc_loadMissionCrate; [_x] call blck_fnc_loadMissionCrate;
} forEach _crates; } forEach _crates;
}; };
};
#ifdef blck_debugMode #ifdef blck_debugMode
if (blck_debugLevel > 0) then if (blck_debugLevel > 0) then
@ -563,6 +570,8 @@ if (blck_showCountAliveAI) then
//diag_log format["_fnc_missionSpawner (557) Build 123: _secureAsset = %1 | {alive _assetSpawned} = %2 | assetType = %3",_secureAsset,alive _assetSpawned, _assetSpawned getVariable["assetType",-1]]; //diag_log format["_fnc_missionSpawner (557) Build 123: _secureAsset = %1 | {alive _assetSpawned} = %2 | assetType = %3",_secureAsset,alive _assetSpawned, _assetSpawned getVariable["assetType",-1]];
if (_secureAsset && (alive _assetSpawned)) then
{
if (_assetSpawned getVariable["assetType",0] isEqualTo 1) then if (_assetSpawned getVariable["assetType",0] isEqualTo 1) then
{ {
//diag_log "Processing Mission End for Hostage Rescue"; //diag_log "Processing Mission End for Hostage Rescue";
@ -585,10 +594,16 @@ if (_assetSpawned getVariable["assetType",0] isEqualTo 2) then
_assetSpawned setVariable["GMSAnimations",_assetSpawned getVariable["endAnimation",["AidlPercMstpSnonWnonDnon_AI"]],true]; _assetSpawned setVariable["GMSAnimations",_assetSpawned getVariable["endAnimation",["AidlPercMstpSnonWnonDnon_AI"]],true];
[_assetSpawned,selectRandom(_assetSpawned getVariable["endAnimation",["AidlPercMstpSnonWnonDnon_AI"]])] remoteExec["switchMove",-2]; [_assetSpawned,selectRandom(_assetSpawned getVariable["endAnimation",["AidlPercMstpSnonWnonDnon_AI"]])] remoteExec["switchMove",-2];
}; };
};
if (_secureAsset && !(alive _assetSpawned)) then
{
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_assetKilledMsg,_blck_localMissionMarker,_coords,_markerClass, -1] call blck_fnc_endMission;
};
//diag_log format["_fnc_missionSpawner (579) Build 123: <calling blck_fnc_endMission> _secureAsset = %1 | {alive _assetSpawned} = %2 | assetType = %3",_secureAsset,alive _assetSpawned, _assetSpawned getVariable["assetType",-1]]; //diag_log format["_fnc_missionSpawner (579) Build 123: <calling blck_fnc_endMission> _secureAsset = %1 | {alive _assetSpawned} = %2 | assetType = %3",_secureAsset,alive _assetSpawned, _assetSpawned getVariable["assetType",-1]];
if (!(_secureAsset) || (_secureAsset && (alive _assetSpawned))) then
{
_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 0] call blck_fnc_endMission; _result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 0] call blck_fnc_endMission;
};
#ifdef blck_debugMode #ifdef blck_debugMode
if (blck_debugLevel > 2) then {diag_log format["[blckeagls] missionSpawner:: (507)end of mission: blck_fnc_endMission has returned control to _fnc_missionSpawner"]}; if (blck_debugLevel > 2) then {diag_log format["[blckeagls] missionSpawner:: (507)end of mission: blck_fnc_endMission has returned control to _fnc_missionSpawner"]};

View File

@ -36,11 +36,13 @@ blck_modType = call blck_fnc_getModType;
publicVariable "blck_modType"; publicVariable "blck_modType";
execVM "\q\addons\custom_server\Configs\blck_configs.sqf"; execVM "\q\addons\custom_server\Configs\blck_configs.sqf";
waitUntil {(isNil "blck_configsLoaded") isEqualTo false;}; waitUntil {(isNil "blck_configsLoaded") isEqualTo false;};
waitUntil{blck_configsLoaded}; waitUntil{blck_configsLoaded};
blck_configsLoaded = nil; blck_configsLoaded = nil;
diag_log format["[blckeagls] blck_useHC = %1",blck_useHC]; diag_log format["[blckeagls] blck_useHC = %1",blck_useHC];
// Load any user-defined specifications or overrides
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf";
// spawn map addons to give the server time to position them before spawning in crates etc. // spawn map addons to give the server time to position them before spawning in crates etc.
if (blck_spawnMapAddons) then if (blck_spawnMapAddons) then
{ {
@ -59,9 +61,17 @@ blck_worldSet = nil;
// set up the lists of available missions for each mission category // set up the lists of available missions for each mission category
diag_log "[blckeagls] Loading Mission Lists"; diag_log "[blckeagls] Loading Mission Lists";
#include "\q\addons\custom_server\Missions\GMS_missionLists.sqf"; #include "\q\addons\custom_server\Missions\GMS_missionLists.sqf";
diag_log "[blckeagls] Mission Lists Loaded Successfully";
// Load any user-defined specifications or overrides [] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf";
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf"; [] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_init.sqf"; // loads functions and spawns any static missions.
diag_log "blck_init_server: ->> Static and UMS systems initialized.";
#ifdef useDynamicSimulation
diag_log "[blckegls] dynamic simulation manager enabled";
#else
diag_log "[blckegls] blckegls simulation manager enabled";
#endif
diag_log format["[blckeagls] version %1 Build %2 Loaded in %3 seconds",_blck_versionDate,_blck_version,diag_tickTime - _blck_loadingStartTime]; //,blck_modType]; diag_log format["[blckeagls] version %1 Build %2 Loaded in %3 seconds",_blck_versionDate,_blck_version,diag_tickTime - _blck_loadingStartTime]; //,blck_modType];
diag_log format["blckeagls] waiting for players to join ---- >>>>"]; diag_log format["blckeagls] waiting for players to join ---- >>>>"];
@ -74,34 +84,20 @@ if !(blck_debugON || (blck_debugLevel isEqualTo 0)) then
diag_log "[blckeagls] spawning Missions"; diag_log "[blckeagls] spawning Missions";
}; };
if (blck_spawnStaticLootCrates) then if (blck_spawnStaticLootCrates) then
{ {
// Start the static loot crate spawner // Start the static loot crate spawner
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Started"; diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Started";
[] spawn compileFinal preprocessFileLineNumbers "\q\addons\custom_server\SLS\SLS_init.sqf"; [] execVM "\q\addons\custom_server\SLS\SLS_init.sqf";
_wait = true; waitUntil {(isNil "blck_SLSComplete") isEqualTo false;};
while {_wait} do waitUntil {blck_SLSComplete};
{
if !(isNil "blck_SLSComplete") then {
if (blck_SLSComplete) then {
blck_SLSComplete = nil; blck_SLSComplete = nil;
_wait = false;
};
};
diag_log format["Waiting for SLS to be completed at %1",diag_tickTime];
uiSleep 1;
};
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Done"; diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Done";
}else{ }else{
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner disabled"; diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner disabled";
}; };
#ifdef useDynamicSimulation
diag_log "[blckegls] dynamic simulation manager enabled";
#else
diag_log "[blckegls] blckegls simulation manager enabled";
#endif
//Start the mission timers //Start the mission timers
if (blck_enableOrangeMissions > 0) then if (blck_enableOrangeMissions > 0) then
{ {
@ -127,7 +123,4 @@ if (blck_enableBlueMissions > 0) then
// start the main thread for the mission system which monitors missions running and stuff to be cleaned up // start the main thread for the mission system which monitors missions running and stuff to be cleaned up
[] spawn blck_fnc_mainThread; [] spawn blck_fnc_mainThread;
[] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf"; diag_log "[blckeagls] < MISSION SYSTEM FULLY INITIALIZED AND RUNNING >";
[] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_init.sqf"; // loads functions and spawns any static missions.
//diag_log "blck_init_server: ->> Static and UMS systems initialized.";
diag_log "[blckeagls] Mission spawner started";

View File

@ -0,0 +1,133 @@
/*
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/
*/
if ( !(isServer) || hasInterface) exitWith{};
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
if !(isNil "blck_Initialized") exitWith{};
private["_blck_loadingStartTime"];
_blck_loadingStartTime = diag_tickTime;
#include "\q\addons\custom_server\init\build.sqf";
diag_log format["[blckeagls] Loading Server Mission System Version %2 Build Date %1",_blck_versionDate,_blck_version];
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_variables.sqf";
waitUntil {(isNil "blck_variablesLoaded") isEqualTo false;};
waitUntil{blck_variablesLoaded};
blck_variablesLoaded = nil;
//if !(blck_debugON) then {uiSleep 60;};
// compile functions
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_functions.sqf";
waitUntil {(isNil "blck_functionsCompiled") isEqualTo false;};
waitUntil{blck_functionsCompiled};
blck_functionsCompiled = nil;
diag_log format["[blckeagls] debug mode settings:blck_debugON = %1 blck_debugLevel = %2",blck_debugON,blck_debugLevel];
blck_modType = call blck_fnc_getModType;
publicVariable "blck_modType";
execVM "\q\addons\custom_server\Configs\blck_configs.sqf";
waitUntil {(isNil "blck_configsLoaded") isEqualTo false;};
waitUntil{blck_configsLoaded};
blck_configsLoaded = nil;
diag_log format["[blckeagls] blck_useHC = %1",blck_useHC];
// spawn map addons to give the server time to position them before spawning in crates etc.
if (blck_spawnMapAddons) then
{
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\MapAddons\MapAddons_init.sqf";
}else{
diag_log "[blckegls] Map Addons disabled";
};
blck_spawnMapAddons = nil;
diag_log "[blckeagls] Loading Map-specific information";
execVM "\q\addons\custom_server\Compiles\Functions\GMS_fnc_findWorld.sqf";
waitUntil {(isNil "blck_worldSet") isEqualTo false;};
waitUntil{blck_worldSet};
blck_worldSet = nil;
// set up the lists of available missions for each mission category
diag_log "[blckeagls] Loading Mission Lists";
#include "\q\addons\custom_server\Missions\GMS_missionLists.sqf";
// Load any user-defined specifications or overrides
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf";
diag_log format["[blckeagls] version %1 Build %2 Loaded in %3 seconds",_blck_versionDate,_blck_version,diag_tickTime - _blck_loadingStartTime]; //,blck_modType];
diag_log format["blckeagls] waiting for players to join ---- >>>>"];
if !(blck_debugON || (blck_debugLevel isEqualTo 0)) then
{
waitUntil{{isPlayer _x}count allPlayers > 0};
diag_log "[blckeagls] Player Connected, spawning missions";
} else {
diag_log "[blckeagls] spawning Missions";
};
if (blck_spawnStaticLootCrates) then
{
// Start the static loot crate spawner
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Started";
[] spawn compileFinal preprocessFileLineNumbers "\q\addons\custom_server\SLS\SLS_init.sqf";
_wait = true;
while {_wait} do
{
if !(isNil "blck_SLSComplete") then {
if (blck_SLSComplete) then {
blck_SLSComplete = nil;
_wait = false;
};
};
diag_log format["Waiting for SLS to be completed at %1",diag_tickTime];
uiSleep 1;
};
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Done";
}else{
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner disabled";
};
#ifdef useDynamicSimulation
diag_log "[blckegls] dynamic simulation manager enabled";
#else
diag_log "[blckegls] blckegls simulation manager enabled";
#endif
//Start the mission timers
if (blck_enableOrangeMissions > 0) then
{
//[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange] spawn blck_fnc_missionTimer;//Starts major mission system (Orange Map Markers)
[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange,blck_enableOrangeMissions] call blck_fnc_addMissionToQue;
};
if (blck_enableGreenMissions > 0) then
{
//[_missionListGreen,_pathGreen,"GreenMarker","green",blck_TMin_Green,blck_TMax_Green] spawn blck_fnc_missionTimer;//Starts major mission system 2 (Green Map Markers)
[_missionListGreen,_pathGreen,"GreenMarker","green",blck_TMin_Green,blck_TMax_Green,blck_enableGreenMissions] call blck_fnc_addMissionToQue;
};
if (blck_enableRedMissions > 0) then
{
//[_missionListRed,_pathRed,"RedMarker","red",blck_TMin_Red,blck_TMax_Red] spawn blck_fnc_missionTimer;//Starts minor mission system (Red Map Markers)//Starts minor mission system 2 (Red Map Markers)
[_missionListRed,_pathRed,"RedMarker","red",blck_TMin_Red,blck_TMax_Red,blck_enableRedMissions] call blck_fnc_addMissionToQue;
};
if (blck_enableBlueMissions > 0) then
{
//[_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue] spawn blck_fnc_missionTimer;//Starts minor mission system (Blue Map Markers)
[_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue,blck_enableBlueMissions] call blck_fnc_addMissionToQue;
};
// start the main thread for the mission system which monitors missions running and stuff to be cleaned up
[] spawn blck_fnc_mainThread;
[] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf";
[] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_init.sqf"; // loads functions and spawns any static missions.
//diag_log "blck_init_server: ->> Static and UMS systems initialized.";
diag_log "[blckeagls] Mission spawner started";

View File

@ -1,6 +1,6 @@
private ["_version","_versionDate"]; private ["_version","_versionDate"];
blck_version = "6.84 Build 145"; blck_version = "6.84 Build 146";
_blck_version = blck_version; _blck_version = blck_version;
_blck_versionDate = "6-24-18 5:00 PM"; _blck_versionDate = "7-7-18 5:00 PM";
blck_pvs_version = _blck_version; blck_pvs_version = _blck_version;
publicVariable blck_pvs_version; publicVariable blck_pvs_version;