From 0544cfe9e7f97a77abe5b9fb8de220a0979365df Mon Sep 17 00:00:00 2001 From: eraser1 Date: Fri, 9 Oct 2015 20:35:07 -0500 Subject: [PATCH] Readme changes, new debug fnc, fixes, tweaks Created disclaimer for DMS. Now mentioning that HC for DMS isn't that good. Some structure stuff in readme (let's see if it works lol) * **NEW CONFIG VALUE: DMS_Use_Map_Config** * You can now overwrite "main config values" with map-specific config values located in the new "map_configs" folder. This should allow you to use one DMS PBO if you have multiple servers with different maps. Included examples for Altis, Bornholm, Esseker, and Tavi (Taviana). * Because of the above implementation, DMS by default will not include the salt flats blacklist for findSafePos. In addition, it is preconfigured to the hilly terrains in Esseker and Taviana, as well as reducing all of the blacklist distances due to the smaller map size in Esseker. * Created new function "DMS_fnc_DebugLog". All DMS files (that produced debug logs) have been changed, including mission files. However, updating them is not important (and completely pointless if you don't even use DMS_DEBUG). * Fixed a few locations where it said "sized" instead of "seized". Thanks to [icomrade](https://github.com/icomrade) for pointing them out. * DMS now utilizes the "ARMA_LOG" DLL (if it exists) by infiSTAR to produce debug logs (if enabled). All debug logs now also include server uptime (in seconds) and server FPS. * The FSM no longer produces debug logs. * AI Locality manager will now run every minute. * Debug logs for "DMS_fnc_MissionsMonitor" will only output the mission name and the position, instead of all of the parameters. * "DMS_fnc_IsNearWater" will now check the provided position itself for water. * "DMS_fnc_IsValidPosition" will now do a surfaceNormal check within a 5 meter radius of the provided position as well. * "_customGearSet" should now actually work for "DMS_fnc_SpawnAISoldier", and the function title comment has been updated for the slightly tweaked syntax. --- @ExileServer/addons/a3_dms/FSM/missions.fsm | 28 +++---- @ExileServer/addons/a3_dms/config.cpp | 1 + @ExileServer/addons/a3_dms/config.sqf | 15 +++- @ExileServer/addons/a3_dms/fn_DMS_preInit.sqf | 10 ++- .../a3_dms/map_configs/altis_config.sqf | 20 +++++ .../a3_dms/map_configs/bornholm_config.sqf | 20 +++++ .../a3_dms/map_configs/esseker_config.sqf | 23 ++++++ .../addons/a3_dms/map_configs/tavi_config.sqf | 23 ++++++ .../addons/a3_dms/missions/bandit/bandits.sqf | 5 +- .../addons/a3_dms/missions/bandit/bauhaus.sqf | 5 +- .../a3_dms/missions/bandit/beertransport.sqf | 5 +- .../missions/bandit/behindenemylines.sqf | 5 +- .../a3_dms/missions/bandit/blackhawkdown.sqf | 7 +- .../a3_dms/missions/bandit/cardealer.sqf | 5 +- .../a3_dms/missions/bandit/construction.sqf | 5 +- .../missions/bandit/donthasslethehoff.sqf | 5 +- .../a3_dms/missions/bandit/foodtransport.sqf | 7 +- .../a3_dms/missions/bandit/guntransport.sqf | 5 +- .../a3_dms/missions/bandit/humanitarian.sqf | 7 +- .../a3_dms/missions/bandit/lost_battalion.sqf | 5 +- .../addons/a3_dms/missions/bandit/medical.sqf | 5 +- .../a3_dms/missions/bandit/mercbase.sqf | 5 +- .../a3_dms/missions/bandit/mercenaries.sqf | 5 +- .../a3_dms/missions/bandit/roguenavyseals.sqf | 5 +- .../a3_dms/missions/bandit/testmission.sqf | 5 +- .../addons/a3_dms/missions/bandit/thieves.sqf | 5 +- .../addons/a3_dms/missions/bandit/walmart.sqf | 5 +- .../a3_dms/scripts/fn_AILocalityManager.sqf | 11 +-- .../a3_dms/scripts/fn_AddMissionToMonitor.sqf | 7 +- .../scripts/fn_BroadcastMissionStatus.sqf | 5 +- .../addons/a3_dms/scripts/fn_CleanUp.sqf | 15 +--- .../a3_dms/scripts/fn_CleanUpManager.sqf | 10 +-- .../addons/a3_dms/scripts/fn_CreateMarker.sqf | 10 +-- .../addons/a3_dms/scripts/fn_DebugLog.sqf | 16 ++++ .../addons/a3_dms/scripts/fn_FillCrate.sqf | 5 +- .../addons/a3_dms/scripts/fn_FindSafePos.sqf | 10 +-- .../addons/a3_dms/scripts/fn_IsNearWater.sqf | 9 +- .../a3_dms/scripts/fn_IsPlayerNearby.sqf | 5 +- .../a3_dms/scripts/fn_IsValidPosition.sqf | 16 ++-- .../a3_dms/scripts/fn_MissionSuccessState.sqf | 10 +-- .../a3_dms/scripts/fn_MissionsMonitor.sqf | 11 +-- .../addons/a3_dms/scripts/fn_OnKilled.sqf | 20 +---- .../a3_dms/scripts/fn_RemoveMarkers.sqf | 15 +--- .../a3_dms/scripts/fn_SetAILocality.sqf | 10 +-- .../addons/a3_dms/scripts/fn_SpawnAIGroup.sqf | 10 +-- .../a3_dms/scripts/fn_SpawnAISoldier.sqf | 78 +++++++++--------- .../a3_dms/scripts/fn_SpawnAIStatic.sqf | 10 +-- .../a3_dms/scripts/fn_SpawnAIVehicle.sqf | 5 +- .../a3_dms/scripts/fn_SpawnBanditMission.sqf | 5 +- .../a3_dms/scripts/fn_SpawnMinefield.sqf | 5 +- .../scripts/fn_SpawnNonPersistentVehicle.sqf | 5 +- .../a3_dms/scripts/fn_TargetsKilled.sqf | 5 +- Pre-Packed PBO/a3_dms.pbo | Bin 232659 -> 236323 bytes README.md | 48 +++++++++-- 54 files changed, 296 insertions(+), 301 deletions(-) create mode 100644 @ExileServer/addons/a3_dms/map_configs/altis_config.sqf create mode 100644 @ExileServer/addons/a3_dms/map_configs/bornholm_config.sqf create mode 100644 @ExileServer/addons/a3_dms/map_configs/esseker_config.sqf create mode 100644 @ExileServer/addons/a3_dms/map_configs/tavi_config.sqf create mode 100644 @ExileServer/addons/a3_dms/scripts/fn_DebugLog.sqf diff --git a/@ExileServer/addons/a3_dms/FSM/missions.fsm b/@ExileServer/addons/a3_dms/FSM/missions.fsm index 17ee825..1e022dd 100644 --- a/@ExileServer/addons/a3_dms/FSM/missions.fsm +++ b/@ExileServer/addons/a3_dms/FSM/missions.fsm @@ -18,7 +18,7 @@ item13[] = {"PREPARE",2,250,763.528931,-107.864372,853.528931,-57.864372,0.00000 item14[] = {"___min_loop",4,218,838.578918,171.729218,928.578918,221.729218,3.000000,"1 min loop"}; item15[] = {"Select_Mission",2,250,839.279602,248.118042,929.279663,298.118042,0.000000,"Select Mission"}; item16[] = {"",7,210,880.582092,366.639160,888.582092,374.639160,0.000000,""}; -item17[] = {"__min_loop",4,218,975.237671,175.934219,1065.237793,225.934219,0.000000,"5min loop"}; +item17[] = {"___min_loop__AI",4,4314,975.237671,175.934219,1065.237793,225.934219,0.000000,"1 min loop (AI)"}; item18[] = {"Set_AI_Ownership",2,250,975.237732,250.921417,1065.237305,300.921417,0.000000,"Set AI Ownership"}; item19[] = {"",7,210,1016.540222,366.725281,1024.540283,374.725281,0.000000,""}; link0[] = {0,10}; @@ -44,8 +44,8 @@ link19[] = {16,0}; link20[] = {17,18}; link21[] = {18,19}; link22[] = {19,16}; -globals[] = {0.000000,0,0,0,0,640,480,2,454,6316128,1,70.838631,1581.788208,823.258911,-305.297394,1217,909,1}; -window[] = {2,-1,-1,-1,-1,890,156,1450,156,3,1235}; +globals[] = {0.000000,0,0,0,0,640,480,2,454,6316128,1,432.812775,1219.813965,504.306030,-50.239235,799,563,1}; +window[] = {0,-1,-1,-1,-1,1045,285,1579,311,1,817}; *//*%FSM*/ class FSM { @@ -118,14 +118,14 @@ class FSM action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ - /*%FSM*/ - class __min_loop + /*%FSM*/ + class ___min_loop__AI { itemno = 17; priority = 0.000000; to="Set_AI_Ownership"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"((diag_tickTime - _aiLocality) > 300)"/*%FSM*/; + condition=/*%FSM*/"((diag_tickTime - _aiLocality) > 60)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -137,9 +137,7 @@ class FSM { name = "Check_Mission_Running"; itemno = 6; - init = /*%FSM*/"if(DMS_DEBUG) then {" \n - " diag_log format [""DMS_DEBUG FSM CHECK :: calling DMS_fnc_MissionsMonitor""];" \n - "};" \n + init = /*%FSM*/"//(format [""FSM CHECK :: calling DMS_fnc_MissionsMonitor""]) call DMS_fnc_DebugLog;" \n "" \n "_missionsMonitor = diag_tickTime;" \n "call DMS_fnc_MissionsMonitor;"/*%FSM*/; @@ -165,9 +163,7 @@ class FSM { name = "Mission_Cleanup"; itemno = 11; - init = /*%FSM*/"if(DMS_DEBUG) then {" \n - " diag_log format [""DMS_DEBUG FSM CHECK :: calling DMS_fnc_CleanUpManager""];" \n - "};" \n + init = /*%FSM*/"//(format [""FSM CHECK :: calling DMS_fnc_CleanUpManager""]) call DMS_fnc_DebugLog;" \n "" \n "_cleanupTime = diag_tickTime;" \n "call DMS_fnc_CleanUpManager;"/*%FSM*/; @@ -222,9 +218,7 @@ class FSM { name = "Select_Mission"; itemno = 15; - init = /*%FSM*/"if(DMS_DEBUG) then {" \n - " diag_log format [""DMS_DEBUG FSM CHECK :: calling DMS_fnc_SelectMission""];" \n - "};" \n + init = /*%FSM*/"//(format [""FSM CHECK :: calling DMS_fnc_SelectMission""]) call DMS_fnc_DebugLog;" \n "" \n "_selectMission = diag_tickTime;" \n "call DMS_fnc_SelectMission;"/*%FSM*/; @@ -250,9 +244,7 @@ class FSM { name = "Set_AI_Ownership"; itemno = 18; - init = /*%FSM*/"if(DMS_DEBUG) then {" \n - " diag_log format [""DMS_DEBUG FSM CHECK :: calling DMS_fnc_AILocalityManager""];" \n - "};" \n + init = /*%FSM*/"//(format [""FSM CHECK :: calling DMS_fnc_AILocalityManager""]) call DMS_fnc_DebugLog;" \n "" \n "_aiLocality = diag_tickTime;" \n "call DMS_fnc_AILocalityManager;"/*%FSM*/; diff --git a/@ExileServer/addons/a3_dms/config.cpp b/@ExileServer/addons/a3_dms/config.cpp index 5c2ba01..a651da2 100644 --- a/@ExileServer/addons/a3_dms/config.cpp +++ b/@ExileServer/addons/a3_dms/config.cpp @@ -35,6 +35,7 @@ class CfgFunctions class CleanUp {}; class CleanUpManager {}; class CreateMarker {}; + class DebugLog {}; class FillCrate {}; class FindSafePos {}; class FindSuppressor {}; diff --git a/@ExileServer/addons/a3_dms/config.sqf b/@ExileServer/addons/a3_dms/config.sqf index df2b297..c63cab0 100644 --- a/@ExileServer/addons/a3_dms/config.sqf +++ b/@ExileServer/addons/a3_dms/config.sqf @@ -5,12 +5,21 @@ Created by eraser1 */ + // Enables debug logging in DMS functions. This will also make missions spawn and timeout more quickly (for testing purposes). // Disable this on live servers, unless you know what you're doing. DMS_DEBUG = false; +DMS_Use_Map_Config = true; // Whether or not to use config overwrites specific to the map. +/* + If you are using a map other than Altis, Bornholm, Esseker, or Tavi (Taviana) you should set this to false OR create a new file within the map_configs folder for the map so that you don't get a missing file error. + To share your map-specific config, please create a merge request on GitHub and/or leave a message on the DMS thread in the Exile forums. + For any questions regarding map-specific configs, please leave a reply in the DMS thread on the Exile forums. +*/ + + /* Mission System Settings */ /*General settings for dynamic missions*/ DMS_DynamicMission = true; // Enable/disable dynamic mission system @@ -61,7 +70,7 @@ DMS_DEBUG = false; DMS_TraderZoneNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to a trader zone DMS_MissionNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to another mission DMS_WaterNearBlacklist = 500; // Missions won't spawn in a position this many meters close to water - DMS_MaxSurfaceNormal = 0.95; // Missions won't spawn if the surface normal of the location is less than this amount. The lower the value, the steeper the location. Greater values means flatter locations + DMS_MaxSurfaceNormal = 0.95; // Missions won't spawn if the surface normal of the location is less than this amount. The lower the value, the steeper the location. Greater values means flatter locations. Values can range from 0-1, with 0 being sideways, and 1 being perfectly flat. For reference: SurfaceNormal of about 0.7 is when you are forced to walk up a surface. /*Mission spawn location settings*/ DMS_MinWaterDepth = 20; // Minimum depth of water that an underwater mission can spawn at. @@ -145,8 +154,8 @@ DMS_DEBUG = false; ["mercbase",5] ]; - DMS_findSafePosBlacklist = [ // For BIS_fnc_findSafePos position blacklist info refer to: https://community.bistudio.com/wiki/BIS_fnc_findSafePos - [[22500,19420],[24870,16725]] // Salt flats + DMS_findSafePosBlacklist = [ // For BIS_fnc_findSafePos position blacklist info refer to: https://community.bistudio.com/wiki/BIS_fnc_findSafePos + // An example is given in the altis_config.sqf (it blacklists the salt flats). ]; /* Mission System Settings */ diff --git a/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf index 3151c35..878e4a5 100644 --- a/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf +++ b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf @@ -6,10 +6,18 @@ DMS_HC_Object = objNull; -//Load config +//Load main config call compileFinal preprocessFileLineNumbers "\x\addons\dms\config.sqf"; +//Load map-specific configs. Should make it easier for people with multiple servers/maps. One PBO to rule them all... +if (DMS_Use_Map_Config) then +{ + call compileFinal preprocessFileLineNumbers (format ["\x\addons\dms\map_configs\%1_config.sqf",toLower worldName]); +}; + + + /* Original Functions from http://maca134.co.uk/portfolio/m3editor-arma-3-map-editor/ diff --git a/@ExileServer/addons/a3_dms/map_configs/altis_config.sqf b/@ExileServer/addons/a3_dms/map_configs/altis_config.sqf new file mode 100644 index 0000000..53c1e16 --- /dev/null +++ b/@ExileServer/addons/a3_dms/map_configs/altis_config.sqf @@ -0,0 +1,20 @@ +/* + Custom configs for Altis. + Sample by eraser1 + + All of these configs exist in the main config. The configs below will simply override any config from the main config (although the majority of them are the same). + Explanations to all of these configs also exist in the main config. +*/ + +DMS_findSafePosBlacklist = +[ + [[22500,19420],[24870,16725]] // Salt flats are blacklisted for Altis by default. +]; + +// These configs are the default values from the main config. Just included here as an example. +DMS_PlayerNearBlacklist = 2000; +DMS_SpawnZoneNearBlacklist = 2500; +DMS_TraderZoneNearBlacklist = 2500; +DMS_MissionNearBlacklist = 2500; +DMS_WaterNearBlacklist = 500; +DMS_MaxSurfaceNormal = 0.95; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/map_configs/bornholm_config.sqf b/@ExileServer/addons/a3_dms/map_configs/bornholm_config.sqf new file mode 100644 index 0000000..dbdcf13 --- /dev/null +++ b/@ExileServer/addons/a3_dms/map_configs/bornholm_config.sqf @@ -0,0 +1,20 @@ +/* + Custom configs for Bornholm. + Sample by eraser1 + + All of these configs exist in the main config. The configs below will simply override any config from the main config (although the majority of them are the same). + Explanations to all of these configs also exist in the main config. +*/ + +DMS_findSafePosBlacklist = +[ + //Insert position blacklists here. +]; + +// These configs are the default values from the main config. Just included here as an example. +DMS_PlayerNearBlacklist = 2000; +DMS_SpawnZoneNearBlacklist = 2500; +DMS_TraderZoneNearBlacklist = 2500; +DMS_MissionNearBlacklist = 2500; +DMS_WaterNearBlacklist = 500; +DMS_MaxSurfaceNormal = 0.95; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/map_configs/esseker_config.sqf b/@ExileServer/addons/a3_dms/map_configs/esseker_config.sqf new file mode 100644 index 0000000..55f3bbc --- /dev/null +++ b/@ExileServer/addons/a3_dms/map_configs/esseker_config.sqf @@ -0,0 +1,23 @@ +/* + Custom configs for Esseker. + Sample by eraser1 + Credit goes to "Flowrider" and "Darth Rogue" for providing tested configs. + + All of these configs exist in the main config. The configs below will simply override any config from the main config. + Explanations to all of these configs also exist in the main config. +*/ + +DMS_findSafePosBlacklist = +[ + //Insert position blacklists here. +]; + +// Reduce the blacklist range since Esseker is a smaller map. +DMS_PlayerNearBlacklist = 750; +DMS_SpawnZoneNearBlacklist = 1250; +DMS_TraderZoneNearBlacklist = 1250; +DMS_MissionNearBlacklist = 1250; +DMS_WaterNearBlacklist = 250; + +// Esseker is a hilly map, so reduced surfaceNormal so all the missions don't spawn in the south. +DMS_MaxSurfaceNormal = 0.9; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/map_configs/tavi_config.sqf b/@ExileServer/addons/a3_dms/map_configs/tavi_config.sqf new file mode 100644 index 0000000..8b6f64a --- /dev/null +++ b/@ExileServer/addons/a3_dms/map_configs/tavi_config.sqf @@ -0,0 +1,23 @@ +/* + Custom configs for Tavi (Taviana). + Sample by eraser1 + + All of these configs exist in the main config. The configs below will simply override any config from the main config (although the majority of them are the same). + Explanations to all of these configs also exist in the main config. +*/ + +DMS_findSafePosBlacklist = +[ + //Insert position blacklists here. +]; + +// These configs are the default values from the main config. Just included here as an example. +DMS_PlayerNearBlacklist = 2000; +DMS_SpawnZoneNearBlacklist = 2500; +DMS_TraderZoneNearBlacklist = 2500; +DMS_MissionNearBlacklist = 2500; +DMS_WaterNearBlacklist = 500; + + +// Taviana is a pretty hilly/mountainous map, so we should be a little more lenient for surfaceNormal on it +DMS_MaxSurfaceNormal = 0.9; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/bandits.sqf b/@ExileServer/addons/a3_dms/missions/bandit/bandits.sqf index 5a5b1b4..7ac99bc 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/bandits.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/bandits.sqf @@ -148,7 +148,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/bauhaus.sqf b/@ExileServer/addons/a3_dms/missions/bandit/bauhaus.sqf index 8b89b4d..f54a92c 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/bauhaus.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/bauhaus.sqf @@ -159,7 +159,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/beertransport.sqf b/@ExileServer/addons/a3_dms/missions/bandit/beertransport.sqf index 47e4592..87d459a 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/beertransport.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/beertransport.sqf @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/behindenemylines.sqf b/@ExileServer/addons/a3_dms/missions/bandit/behindenemylines.sqf index a3af84a..22bcaa2 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/behindenemylines.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/behindenemylines.sqf @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/blackhawkdown.sqf b/@ExileServer/addons/a3_dms/missions/bandit/blackhawkdown.sqf index 1ff0763..1f8c5e6 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/blackhawkdown.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/blackhawkdown.sqf @@ -75,7 +75,7 @@ _msgStart = ['#FFFF00',"We got a Blackhawk down, Super 6-1 is down, secure the p _msgWIN = ['#0080ff',"Convicts have secured the blackhawk and claimed the remaining loot!"]; // Define Mission Lose message -_msgLOSE = ['#FF0000',"The blackhawk has been sized by the enemy and the loot has been destroyed!"]; +_msgLOSE = ['#FF0000',"The blackhawk has been seized by the enemy and the loot has been destroyed!"]; // Define mission name (for map marker and logging) _missionName = "Blackhawk Down"; @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/cardealer.sqf b/@ExileServer/addons/a3_dms/missions/bandit/cardealer.sqf index 7ac8d99..2890511 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/cardealer.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/cardealer.sqf @@ -163,7 +163,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/construction.sqf b/@ExileServer/addons/a3_dms/missions/bandit/construction.sqf index e604b3d..067de11 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/construction.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/construction.sqf @@ -155,7 +155,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/donthasslethehoff.sqf b/@ExileServer/addons/a3_dms/missions/bandit/donthasslethehoff.sqf index 631523e..f1e5d82 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/donthasslethehoff.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/donthasslethehoff.sqf @@ -166,7 +166,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/foodtransport.sqf b/@ExileServer/addons/a3_dms/missions/bandit/foodtransport.sqf index c9f419f..9cb847b 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/foodtransport.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/foodtransport.sqf @@ -69,7 +69,7 @@ _missionObjs = ]; // Define Mission Start message -_msgStart = ['#FFFF00',"A food supply truck has been sized by ruthless bandits. Stop them!"]; +_msgStart = ['#FFFF00',"A food supply truck has been seized by ruthless bandits. Stop them!"]; // Define Mission Win message _msgWIN = ['#0080ff',"Convicts have successfully claimed the food supplies!"]; @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/guntransport.sqf b/@ExileServer/addons/a3_dms/missions/bandit/guntransport.sqf index c9f9345..927c536 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/guntransport.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/guntransport.sqf @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/humanitarian.sqf b/@ExileServer/addons/a3_dms/missions/bandit/humanitarian.sqf index 20f9ff5..f0932b5 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/humanitarian.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/humanitarian.sqf @@ -69,7 +69,7 @@ _missionObjs = ]; // Define Mission Start message -_msgStart = ['#FFFF00',"A truck carrying humanitarian supplies has been sized by bandits. Stop them!"]; +_msgStart = ['#FFFF00',"A truck carrying humanitarian supplies has been seized by bandits. Stop them!"]; // Define Mission Win message _msgWIN = ['#0080ff',"Convicts have successfully claimed the humanitarian supplies for themselves!"]; @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/lost_battalion.sqf b/@ExileServer/addons/a3_dms/missions/bandit/lost_battalion.sqf index 023a658..f696d07 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/lost_battalion.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/lost_battalion.sqf @@ -150,7 +150,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; diff --git a/@ExileServer/addons/a3_dms/missions/bandit/medical.sqf b/@ExileServer/addons/a3_dms/missions/bandit/medical.sqf index 4b688cf..4fc3127 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/medical.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/medical.sqf @@ -152,7 +152,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/mercbase.sqf b/@ExileServer/addons/a3_dms/missions/bandit/mercbase.sqf index 7c422f3..0dc75a9 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/mercbase.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/mercbase.sqf @@ -183,7 +183,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/mercenaries.sqf b/@ExileServer/addons/a3_dms/missions/bandit/mercenaries.sqf index c3b0423..907d50a 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/mercenaries.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/mercenaries.sqf @@ -150,7 +150,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/roguenavyseals.sqf b/@ExileServer/addons/a3_dms/missions/bandit/roguenavyseals.sqf index 22bbeee..1d92fcb 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/roguenavyseals.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/roguenavyseals.sqf @@ -150,7 +150,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/testmission.sqf b/@ExileServer/addons/a3_dms/missions/bandit/testmission.sqf index f80df0a..4af3910 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/testmission.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/testmission.sqf @@ -197,7 +197,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf b/@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf index 0e8a341..3b3b133 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf @@ -143,7 +143,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/missions/bandit/walmart.sqf b/@ExileServer/addons/a3_dms/missions/bandit/walmart.sqf index 7a99aa8..b2b7b5b 100644 --- a/@ExileServer/addons/a3_dms/missions/bandit/walmart.sqf +++ b/@ExileServer/addons/a3_dms/missions/bandit/walmart.sqf @@ -151,7 +151,4 @@ if !(_added) exitWith -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]; -}; \ No newline at end of file +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_AILocalityManager.sqf b/@ExileServer/addons/a3_dms/scripts/fn_AILocalityManager.sqf index cc3bafe..9d1f0ad 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_AILocalityManager.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_AILocalityManager.sqf @@ -18,10 +18,8 @@ if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {}; { if (isNull DMS_HC_Object) then { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]; - }; + + (format ["AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]) call DMS_fnc_DebugLog; _owner = objNull; { @@ -41,10 +39,7 @@ if (!DMS_ai_offload_to_client && {isNull DMS_HC_Object}) exitWith {}; if !((groupOwner _group) isEqualTo (owner DMS_HC_Object)) then { _transferSuccess = _group setGroupOwner (owner DMS_HC_Object); - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess]; - }; + (format ["AILocalityManager :: Setting ownership of group %1 to HC (%2). Success: %3",_group,DMS_HC_Object,_transferSuccess]) call DMS_fnc_DebugLog; }; }; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_AddMissionToMonitor.sqf b/@ExileServer/addons/a3_dms/scripts/fn_AddMissionToMonitor.sqf index 274b259..7373e20 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_AddMissionToMonitor.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_AddMissionToMonitor.sqf @@ -193,14 +193,11 @@ try _markerDot setMarkerText (format ["%1 (%2 %3 remaining)",markerText _markerDot,count _units,DMS_MarkerText_AIName]); }; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG AddMissionToMonitor :: Added |%1| to DMS_Mission_Arr!",_arr]; - }; + (format ["AddMissionToMonitor :: Added |%1| to DMS_Mission_Arr!",_arr]) call DMS_fnc_DebugLog; } catch { - diag_log format ["DMS_AddMissionToMonitor ERROR :: Invalid parameter: %1",_exception]; + diag_log format ["DMS ERROR :: Calling DMS_AddMissionToMonitor with invalid parameter: %1",_exception]; }; _added \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_BroadcastMissionStatus.sqf b/@ExileServer/addons/a3_dms/scripts/fn_BroadcastMissionStatus.sqf index a0465ea..f57c3e0 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_BroadcastMissionStatus.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_BroadcastMissionStatus.sqf @@ -34,10 +34,7 @@ _messageInfo params ["_message","",[""]] ]; -if (DMS_DEBUG) then -{ - diag_log format["DMS_DEBUG BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_message]; -}; +(format["BroadcastMissionStatus :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_message]) call DMS_fnc_DebugLog; if ((typeName _message) != "STRING") then { diff --git a/@ExileServer/addons/a3_dms/scripts/fn_CleanUp.sqf b/@ExileServer/addons/a3_dms/scripts/fn_CleanUp.sqf index b0d9a89..a0d54b9 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_CleanUp.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_CleanUp.sqf @@ -15,10 +15,7 @@ */ -if (DMS_DEBUG) then -{ - diag_log ("DMS_DEBUG CleanUp :: CLEANING UP: "+str _this); -}; +(format ["CleanUp :: CLEANING UP: %1",_this]) call DMS_fnc_DebugLog; if !((typeName _this) == "ARRAY") then { @@ -62,10 +59,7 @@ _clean = else { _skippedObjects pushBack _x; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG CleanUp :: Skipping cleanup for |%1|, player within %2 meters!",_x,DMS_CleanUp_PlayerNearLimit]; - }; + (format ["CleanUp :: Skipping cleanup for |%1|, player within %2 meters!",_x,DMS_CleanUp_PlayerNearLimit]) call DMS_fnc_DebugLog; }; } else @@ -91,10 +85,7 @@ _clean = }; if ((typeName _x) == "ARRAY") exitWith { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG CleanUp :: Doing recursive call for ARRAY: %1",_x]; - }; + (format ["CleanUp :: Doing recursive call for ARRAY: %1",_x]) call DMS_fnc_DebugLog; _x call DMS_fnc_CleanUp; }; diag_log format ["DMS ERROR :: Attempted to call DMS_fnc_CleanUp on non- group or object %1 from array %2",_x,_this]; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_CleanUpManager.sqf b/@ExileServer/addons/a3_dms/scripts/fn_CleanUpManager.sqf index 7d9e319..d2b4e80 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_CleanUpManager.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_CleanUpManager.sqf @@ -20,10 +20,7 @@ if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to clean :) { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG CleanUpManager :: Checking Cleaning Status for: %1",_x]; - }; + (format ["CleanUpManager :: Checking Cleaning Status for: %1",_x]) call DMS_fnc_DebugLog; private ["_objs","_timeAddedToList","_timeUntilClean"]; @@ -45,9 +42,6 @@ if (DMS_CleanUpList isEqualTo []) exitWith {}; // Empty array, no objects to cl } else { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG CleanUpManager :: %1 is not yet ready to clean!",_x]; - }; + (format ["CleanUpManager :: %1 is not yet ready to clean!",_x]) call DMS_fnc_DebugLog; }; } forEach DMS_CleanUpList; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_CreateMarker.sqf b/@ExileServer/addons/a3_dms/scripts/fn_CreateMarker.sqf index 086bc74..44ffdc3 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_CreateMarker.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_CreateMarker.sqf @@ -83,16 +83,10 @@ if (_randomMarker) then _dot setMarkerPos _npos; _circle setMarkerBrush DMS_RandomMarkerBrush; - if (DMS_DEBUG) then - { - diag_log format ["Moving markers %1 from %2 to %3 (%4m away)",[_dot,_circle],_pos,_npos,_dis]; - }; + (format ["CreateMarker :: Moving markers %1 from %2 to %3 (%4m away)",[_dot,_circle],_pos,_npos,_dis]) call DMS_fnc_DebugLog; }; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG CreateMarker :: Created markers |%1| at %2 with text |%3| colored %4",[_dot,_circle],_pos,_text,_color]; -}; +(format ["CreateMarker :: Created markers |%1| at %2 with text |%3| colored %4",[_dot,_circle],_pos,_text,_color]) call DMS_fnc_DebugLog; [_dot,_circle]; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_DebugLog.sqf b/@ExileServer/addons/a3_dms/scripts/fn_DebugLog.sqf new file mode 100644 index 0000000..8f10a6f --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/fn_DebugLog.sqf @@ -0,0 +1,16 @@ +/* + DMS_fnc_DebugLog + Created by eraser1 + + Usage: + _anyValue call DMS_fnc_DebugLog; + + If DMS_DEBUG is true, then it will write the passed parameter to RPT. If you have infistar, then it will also utilize the "ARMA_LOG" dll to write debug info. +*/ + +if (DMS_DEBUG) then +{ + _this = format ["%1 |::|::| (UpTime: %2 | %3 FPS)",_this,time,diag_fps]; + "ARMA_LOG" callExtension format ["DMS_DEBUG:%1",_this]; + diag_log format ["DMS_DEBUG :: %1",_this]; +}; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_FillCrate.sqf b/@ExileServer/addons/a3_dms/scripts/fn_FillCrate.sqf index 9b0b8a4..9bff2dd 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_FillCrate.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_FillCrate.sqf @@ -90,10 +90,7 @@ if ((typeName _lootValues)=="ARRAY") then }; - if(DMS_DEBUG) then - { - diag_log format["DMS_DEBUG FillCrate :: Filling %4 with %1 guns, %2 items and %3 backpacks",_wepCount,_itemCount,_backpackCount,_crate]; - }; + (format["FillCrate :: Filling %4 with %1 guns, %2 items and %3 backpacks",_wepCount,_itemCount,_backpackCount,_crate]) call DMS_fnc_DebugLog; if ((_wepCount>0) && {count _weps>0}) then diff --git a/@ExileServer/addons/a3_dms/scripts/fn_FindSafePos.sqf b/@ExileServer/addons/a3_dms/scripts/fn_FindSafePos.sqf index f5d10a9..817a462 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_FindSafePos.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_FindSafePos.sqf @@ -64,20 +64,14 @@ while{!_validspot} do _missionNearLimit = (DMS_ThrottleCoefficient * _missionNearLimit) max DMS_MinThrottledDistance; _playerNearLimit = (DMS_ThrottleCoefficient * _playerNearLimit) max DMS_MinThrottledDistance; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG FindSafePos :: Throttling _missionNearLimit to %1 and _playerNearLimit to %2 after %3 failed attempts to find a safe position! FPS: %4",_missionNearLimit,_playerNearLimit,_attempts,diag_fps]; - }; + (format ["FindSafePos :: Throttling _missionNearLimit to %1 and _playerNearLimit to %2 after %3 failed attempts to find a safe position! FPS: %4",_missionNearLimit,_playerNearLimit,_attempts,diag_fps]) call DMS_fnc_DebugLog; }; _validspot = [_pos, _waterNearLimit, _maxSurfaceNormal, _spawnZoneNearLimit, _traderZoneNearLimit, _missionNearLimit, _playerNearLimit] call DMS_fnc_IsValidPosition; }; -if(DMS_DEBUG) then -{ - diag_log format["DMS_DEBUG FindSafePos :: Found mission position %1 with %2 params in %3 attempts. _this: %4",_pos,_safePosParams,_attempts,_this]; -}; +(format["FindSafePos :: Found mission position %1 with %2 params in %3 attempts. _this: %4",_pos,_safePosParams,_attempts,_this]) call DMS_fnc_DebugLog; _pos set [2, 0]; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf b/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf index 10196cb..29041ca 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_IsNearWater.sqf @@ -13,12 +13,19 @@ private["_result","_position","_radius"]; -_result = false; _position = _this select 0; _radius = _this select 1; + +_result = false; + try { + if (surfaceIsWater _position) then + { + throw true; + }; + for "_i" from 0 to 359 step 45 do { if (surfaceIsWater ([_position,_radius,_i] call DMS_fnc_SelectOffsetPos)) then diff --git a/@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf b/@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf index e4ef1a2..3ebefe4 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_IsPlayerNearby.sqf @@ -40,10 +40,7 @@ try catch { _isNear = true; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos]; - }; + (format ["IsPlayerNearby :: %1 is within %2 meters of %3!",_exception,_dis,_pos]) call DMS_fnc_DebugLog; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_IsValidPosition.sqf b/@ExileServer/addons/a3_dms/scripts/fn_IsValidPosition.sqf index f4068bc..8391474 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_IsValidPosition.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_IsValidPosition.sqf @@ -17,7 +17,7 @@ */ -private ["_pos", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit"]; +private ["_pos", "_waterNearLimit", "_maxSurfaceNormal", "_spawnZoneNearLimit", "_traderZoneNearLimit", "_missionNearLimit", "_playerNearLimit", "_dir"]; _OK = params [ @@ -51,6 +51,15 @@ else if (((surfaceNormal _pos) select 2)<_maxSurfaceNormal) then { throw ("a steep location"); + + // Check the surrounding area (within 5 meters) + for "_dir" from 0 to 359 step 45 do + { + if (((surfaceNormal ([_position,5,_dir] call DMS_fnc_SelectOffsetPos)) select 2)<_maxSurfaceNormal) then + { + throw ("a nearby steep location"); + }; + }; }; { @@ -89,10 +98,7 @@ else } catch { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG IsValidPosition :: Exception in attempt %1 | Position %2 is too close to %3!",_attempts,_pos,_exception]; - }; + (format ["IsValidPosition :: Exception in attempt %1 | Position %2 is too close to %3!",_attempts,_pos,_exception]) call DMS_fnc_DebugLog; }; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_MissionSuccessState.sqf b/@ExileServer/addons/a3_dms/scripts/fn_MissionSuccessState.sqf index 19b606e..6d37359 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_MissionSuccessState.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_MissionSuccessState.sqf @@ -53,10 +53,7 @@ _exit = false; }; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG MissionSuccessState :: Checking completion type %1 with parameter %2. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]; - }; + (format ["MissionSuccessState :: Checking completion type ""%1"" with argument |%2|. Absolute: %3",_completionType,_completionArgs,_absoluteWinCondition]) call DMS_fnc_DebugLog; switch (toLower _completionType) do { @@ -90,10 +87,7 @@ _exit = false; } catch { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG MissionSuccessState :: %1",_exception]; - }; + (format ["MissionSuccessState :: %1",_exception]) call DMS_fnc_DebugLog; }; } forEach _this; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_MissionsMonitor.sqf b/@ExileServer/addons/a3_dms/scripts/fn_MissionsMonitor.sqf index bc0edfa..67f96bd 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_MissionsMonitor.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_MissionsMonitor.sqf @@ -31,10 +31,6 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build { try { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG MissionStatusCheck :: Checking Mission Status (index %1): %2",_forEachIndex,_x]; - }; _pos = _x select 0; _success = (_x select 1) call DMS_fnc_MissionSuccessState; _timeStarted = _x select 2 select 0; @@ -50,6 +46,8 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build _markers = _x select 6; _missionSide = _x select 7; + (format ["MissionStatusCheck :: Checking Mission Status (index %1): ""%2"" at %3",_forEachIndex,_missionName,_pos]) call DMS_fnc_DebugLog; + if (_success) then { DMS_CleanUpList pushBack [_units+_buildings,diag_tickTime,DMS_CompletedMissionCleanupTime]; @@ -163,9 +161,6 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build } catch { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG MissionStatusCheck :: %1",_exception]; - }; + (format ["MissionStatusCheck :: %1",_exception]) call DMS_fnc_DebugLog; }; } forEach DMS_Mission_Arr; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf index d9c9cdf..8c997ae 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_OnKilled.sqf @@ -18,10 +18,7 @@ private ["_unit", "_killer", "_side", "_type", "_launcher", "_launcherVar", "_playerObj", "_removeAll", "_rockets", "_grpUnits", "_av", "_memCount", "_gunner", "_driver", "_gunnerIsAlive", "_driverIsAlive", "_grp", "_owner", "_start", "_roadKilled", "_veh", "_boom", "_revealAmount", "_silencer", "_moneyChange", "_repChange", "_money", "_respect", "_msgType", "_msgParams"]; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG OnKilled :: Logging AI death with parameters: %1",_this]; -}; +(format ["OnKilled :: Logging AI death with parameters: %1",_this]) call DMS_fnc_DebugLog; _unit = _this select 0 select 0; _killer = _this select 0 select 1; @@ -112,10 +109,7 @@ if (!isNull _av) then _av spawn {sleep 1;_this enableSimulationGlobal false;}; - if (DMS_DEBUG) then - { - diag_log format["DMS_DEBUG OnKilled :: Destroying used AI vehicle %1, disabling simulation, and adding to cleanup.",typeOf _av]; - }; + (format["OnKilled :: Destroying used AI vehicle %1, disabling simulation, and adding to cleanup.",typeOf _av]) call DMS_fnc_DebugLog; } else { @@ -188,10 +182,7 @@ if (!isNull _av) then _driver enableCollisionWith _av; - if (DMS_DEBUG) then - { - diag_log format["DMS_DEBUG OnKilled :: Switched driver of AI Vehicle (%1) to gunner.",typeOf _av]; - }; + (format["OnKilled :: Switched driver of AI Vehicle (%1) to gunner.",typeOf _av]) call DMS_fnc_DebugLog; if (_owner!=2) then { @@ -263,10 +254,7 @@ if (isPlayer _killer) then { _boom = createVehicle ["SLAMDirectionalMine_Wire_Ammo", ASLToAGL(getPosWorld _unit), [], 0, "CAN_COLLIDE"]; _boom setDamage 1; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG OnKilled :: %1 roadkilled an AI! Creating mine at the roadkilled AI's position!",name _killer]; - }; + (format ["OnKilled :: %1 roadkilled an AI! Creating mine at the roadkilled AI's position!",name _killer]) call DMS_fnc_DebugLog; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_RemoveMarkers.sqf b/@ExileServer/addons/a3_dms/scripts/fn_RemoveMarkers.sqf index 3d9f2b6..a00ed49 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_RemoveMarkers.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_RemoveMarkers.sqf @@ -20,10 +20,7 @@ _status = _this select 1; _text = missionNamespace getVariable [format ["%1_text",_markerDot],markerText _markerDot]; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG RemoveMarkers :: Calling DMS_RemoveMarkers with parameters %1.",_this]; -}; +(format ["RemoveMarkers :: Calling DMS_RemoveMarkers with parameters %1.",_this]) call DMS_fnc_DebugLog; deleteMarker _markerCircle; @@ -40,10 +37,7 @@ if (_status == "win") then _markerDot setMarkerColor DMS_MissionMarkerWinDotColor; //_markerDot spawn {sleep DMS_MissionMarkerWinDotTime;deleteMarker _this;}; [DMS_MissionMarkerWinDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerWinDotTime]; - }; + (format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerWinDotTime]) call DMS_fnc_DebugLog; } else { @@ -55,8 +49,5 @@ else _markerDot setMarkerColor DMS_MissionMarkerLoseDotColor; //_markerDot spawn {sleep DMS_MissionMarkerLoseDotTime;deleteMarker _this;}; [DMS_MissionMarkerLoseDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerLoseDotTime]; - }; + (format ["RemoveMarkers :: %1 Marker will be removed in %2 seconds!",_markerDot,DMS_MissionMarkerLoseDotTime]) call DMS_fnc_DebugLog; }; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf index df3a459..48535b6 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SetAILocality.sqf @@ -48,15 +48,9 @@ _client = objNull; if (!isNull _client) then { ExileServerOwnershipSwapQueue pushBack [_AI,_client]; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SetAILocality :: Ownership swap of %1 (%4) to %2 (%3) is added to ExileServerOwnershipSwapQueue.",_AI,name _client,getPlayerUID _client,typeName _AI]; - }; + (format ["SetAILocality :: Ownership swap of %1 (%4) to %2 (%3) is added to ExileServerOwnershipSwapQueue.",_AI,name _client,getPlayerUID _client,typeName _AI]) call DMS_fnc_DebugLog; } else { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SetAILocality :: No viable client found for the ownership of %1!",_AI]; - }; + (format ["SetAILocality :: No viable client found for the ownership of %1!",_AI]) call DMS_fnc_DebugLog; }; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf index ca1fea1..f70535d 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIGroup.sqf @@ -35,10 +35,7 @@ _pos_y = _pos select 1; _pos_z = _pos select 2; -if(DMS_DEBUG) then -{ - diag_log format["DMS_DEBUG SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_class,_side,_pos,_difficulty]; -}; +(format["SpawnAIGroup :: Spawning %1 %2 %3 AI at %4 with %5 difficulty.",_count,_class,_side,_pos,_difficulty]) call DMS_fnc_DebugLog; // if soldier have AT/AA weapons if (typeName _class == "ARRAY") then @@ -100,10 +97,7 @@ if ((!isNil "_launcher") || {DMS_ai_use_launchers && {(random 100) <= DMS_ai_use _unit setVariable ["DMS_AI_Launcher",_launcher]; - if(DMS_DEBUG) then - { - diag_log format["DMS_DEBUG SpawnAIGroup :: Giving %1 a %2 launcher with %3 %4 rockets",_unit,_launcher,DMS_AI_launcher_ammo_count,_rocket]; - }; + (format["SpawnAIGroup :: Giving %1 a %2 launcher with %3 %4 rockets",_unit,_launcher,DMS_AI_launcher_ammo_count,_rocket]) call DMS_fnc_DebugLog; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf index dce9b24..cbf71f8 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf @@ -7,7 +7,7 @@ [ _group, // Group the AI will belong to _pos, // Position of AI - _class, // Classname: "random","assault","MG","sniper" or "unarmed" + _class, // Classname: "random","assault","MG","sniper" or "unarmed". Use "custom" to use "_customGearSet" _difficulty, // Difficulty: "random","static","hardcore","difficult","moderate", or "easy" _side, // "bandit","hero", etc. _type, // Type of AI: "soldier","static","vehicle","heli", etc. @@ -18,10 +18,10 @@ [ _weapon, // String | EG: "LMG_Zafir_F" _weaponAttachments, // Array of strings | EG: ["optic_dms","bipod_03_F_blk"] - _magazines, // Array of arrays | EG: [["150Rnd_762x54_Box",2],["16Rnd_9x21_Mag",3]] + _magazines, // Array of arrays | EG: [["150Rnd_762x54_Box",2],["16Rnd_9x21_Mag",3],["Exile_Item_InstaDoc",3]] _pistol, // String | EG: "hgun_Pistol_heavy_01_snds_F" _pistolAttachments, // Array of strings | EG: ["optic_MRD","muzzle_snds_acp"] - _items, // Array of strings | EG: ["Rangefinder","ItemGPS","Exile_Item_InstaDoc"] + _assignedItems, // Array of strings | EG: ["Rangefinder","ItemGPS","NVGoggles"] _launcher, // String | EG: "launch_RPG32_F" _helmet, // String | EG: "H_HelmetLeaderO_ocamo" _uniform, // String | EG: "U_O_GhillieSuit" @@ -32,7 +32,7 @@ Returns AI Unit */ -private ["_OK", "_useCustomGear", "_unarmed", "_class", "_type", "_unit", "_side", "_nighttime", "_weapon", "_muzzle", "_suppressor", "_pistols", "_pistol", "_customGearSet", "_helmet", "_uniform", "_vest", "_backpack", "_launcher", "_magazines", "_weaponAttachments", "_pistolAttachments", "_items", "_difficulty", "_skillArray"]; +private ["_OK", "_useCustomGear", "_unarmed", "_class", "_type", "_unit", "_side", "_nighttime", "_weapon", "_muzzle", "_suppressor", "_pistols", "_pistol", "_customGearSet", "_helmet", "_uniform", "_vest", "_backpack", "_launcher", "_magazines", "_weaponAttachments", "_pistolAttachments", "_assignedItems", "_difficulty", "_skillArray"]; _OK = params [ @@ -55,7 +55,7 @@ else { if ((_class == "custom") && {((count _this)>6)}) then { - _customGearSet = _this select 5; + _customGearSet = _this select 6; _useCustomGear = true; }; }; @@ -71,14 +71,14 @@ _unit allowFleeing 0; [_unit] joinSilent _group; // Remove existing gear -removeAllWeapons _unit; -removeAllItems _unit; -removeAllAssignedItems _unit; -removeUniform _unit; -removeVest _unit; -removeBackpack _unit; -removeHeadgear _unit; -removeGoggles _unit; +{_unit removeWeaponGlobal _x;} forEach (weapons _unit); +{_unit unlinkItem _x;} forEach (assignedItems _unit); +{_unit removeItem _x;} forEach (items _unit); +removeAllItemsWithMagazines _unit; +removeHeadgear _unit; +removeUniform _unit; +removeVest _unit; +removeBackpackGlobal _unit; // Give default items if !(DMS_ai_default_items isEqualTo []) then @@ -111,6 +111,7 @@ if (!_useCustomGear) then if !(_class in DMS_ai_SupportedClasses) exitWith { diag_log format ["DMS ERROR :: DMS_SpawnAISoldier called with unsupported _class: %1 | _this: %2",_class,_this]; + deleteVehicle _unit; }; @@ -207,7 +208,7 @@ else ["_magazines",[],[[]]], ["_pistol","",[""]], ["_pistolAttachments",[],[[]]], - ["_items",[],[[]]], + ["_assignedItems",[],[[]]], ["_launcher","",[""]], ["_helmet","",[""]], ["_uniform","",[""]], @@ -220,10 +221,7 @@ else diag_log format ["DMS ERROR :: Calling DMS_SpawnAISoldier with invalid _customGearSet: %1 | _this: %2",_customGearSet,_this]; }; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SpawnAISoldier :: Equipping unit %1 with _customGearSet: %2",_unit,_customGearSet]; - }; + (format ["SpawnAISoldier :: Equipping unit %1 with _customGearSet: %2",_unit,_customGearSet]) call DMS_fnc_DebugLog; // Clothes if !(_helmet isEqualTo "") then @@ -261,6 +259,29 @@ else _unit addMagazines _x; } forEach _magazines; + // Add items + { + if (_x in ["Binocular","Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03"]) then + { + _unit addWeapon _x; + } + else + { + _unit linkItem _x; + }; + } forEach _assignedItems; + + + // Add pistol and attachments + if !(_pistol isEqualTo "") then + { + [_unit, _pistol, 0] call BIS_fnc_addWeapon; + + { + _unit addHandgunItem _x; + } forEach _pistolAttachments; + }; + // Add gun and attachments if !(_weapon isEqualTo "") then @@ -273,22 +294,6 @@ else _unit selectWeapon _weapon; }; - - - // Add pistol and attachments - if !(_pistol isEqualTo "") then - { - [_unit, _pistol, 0] call BIS_fnc_addWeapon; - - { - _unit addPrimaryWeaponItem _x; - } forEach _pistolAttachments; - }; - - // Add items - { - _unit addItem _x; - } forEach _items; }; { @@ -325,9 +330,6 @@ if (_type=="Soldier") then _unit setVariable ["DMS_LastAIDistanceCheck",time]; }; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG SpawnAISoldier :: Spawned a %1 %2 %6 AI at %3 with %4 difficulty to group %5",_class,_side,_pos,_difficulty,_group,_type]; -}; +(format ["SpawnAISoldier :: Spawned a %1 %2 %6 AI at %3 with %4 difficulty to group %5",_class,_side,_pos,_difficulty,_group,_type]) call DMS_fnc_DebugLog; _unit diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf index 00c6b91..a12a9ec 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIStatic.sqf @@ -70,16 +70,10 @@ _guns = []; reload _unit; _unit setVariable ["DMS_AssignedVeh",_gun]; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SpawnAIStatic :: Created unit %1 at %2 as static gunner in %3",_unit,_pos,_gun]; - }; + (format ["SpawnAIStatic :: Created unit %1 at %2 as static gunner in %3",_unit,_pos,_gun]) call DMS_fnc_DebugLog; } forEach _positions; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG SpawnAIStatic :: Created %1 static AI with parameters: %2",count _positions,_this]; -}; +(format ["SpawnAIStatic :: Created %1 static AI with parameters: %2",count _positions,_this]) call DMS_fnc_DebugLog; _guns \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIVehicle.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIVehicle.sqf index c4cc50f..63652c3 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIVehicle.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAIVehicle.sqf @@ -81,9 +81,6 @@ _gunner setVariable ["DMS_AssignedVeh",_veh]; [_driver,_gunner] joinSilent _group; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG SpawnAIVehicle :: Created a %1 armed vehicle (%2) at %3 with %4 difficulty to group %5",_side,_vehClass,_spawnPos,_difficulty,_group]; -}; +(format ["SpawnAIVehicle :: Created a %1 armed vehicle (%2) at %3 with %4 difficulty to group %5",_side,_vehClass,_spawnPos,_difficulty,_group]) call DMS_fnc_DebugLog; _veh \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnBanditMission.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnBanditMission.sqf index b8ba686..8f715b6 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnBanditMission.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnBanditMission.sqf @@ -39,8 +39,5 @@ else DMS_BMissionLastStart = diag_tickTime; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SelectMission :: Spawned mission %1 with parameters (%2) | DMS_BMissionDelay set to %3 seconds",str _missionType,_parameters,DMS_BMissionDelay]; - }; + (format ["SelectMission :: Spawned mission %1 with parameters (%2) | DMS_BMissionDelay set to %3 seconds",str _missionType,_parameters,DMS_BMissionDelay]) call DMS_fnc_DebugLog; }; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnMinefield.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnMinefield.sqf index ccc212d..d1342c1 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnMinefield.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnMinefield.sqf @@ -92,10 +92,7 @@ if (DMS_SpawnMinesAroundMissions) then }; }; - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG SpawnMinefield :: Spawned %1 mines around %2 with _minesInfo: %3 | Warning signs spawned: %5 | _mines: %4",_mineCount,_centerPos,_minesInfo,_mines,_spawnWarningSign]; - }; + (format ["SpawnMinefield :: Spawned %1 mines around %2 with _minesInfo: %3 | Warning signs spawned: %5 | _mines: %4",_mineCount,_centerPos,_minesInfo,_mines,_spawnWarningSign]) call DMS_fnc_DebugLog; }; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnNonPersistentVehicle.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnNonPersistentVehicle.sqf index fdabd21..dcaecde 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnNonPersistentVehicle.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnNonPersistentVehicle.sqf @@ -95,10 +95,7 @@ _vehObj allowDamage false; _vehObj enableRopeAttach false; _vehObj enableSimulationGlobal false; -if (DMS_DEBUG) then -{ - diag_log format ["DMS_DEBUG SpawnNonPersistentVehicle :: Created %1 at %2 with calling parameters: %3",_vehObj,_vehpos,_this]; -}; +(format ["SpawnNonPersistentVehicle :: Created %1 at %2 with calling parameters: %3",_vehObj,_vehpos,_this]) call DMS_fnc_DebugLog; _vehObj diff --git a/@ExileServer/addons/a3_dms/scripts/fn_TargetsKilled.sqf b/@ExileServer/addons/a3_dms/scripts/fn_TargetsKilled.sqf index 49098aa..2682c4f 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_TargetsKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_TargetsKilled.sqf @@ -80,10 +80,7 @@ try } catch { - if (DMS_DEBUG) then - { - diag_log format ["DMS_DEBUG TargetsKilled :: %1 is still alive! All of %2 are not yet killed!",_exception,_this]; - }; + (format ["TargetsKilled :: %1 is still alive! All of %2 are not yet killed!",_exception,_this]) call DMS_fnc_DebugLog; }; _killed; \ No newline at end of file diff --git a/Pre-Packed PBO/a3_dms.pbo b/Pre-Packed PBO/a3_dms.pbo index eb5aa44292ed8a48b3aa836c7e27c2095bb5462a..051a318ebc7fd7a3b8862dbdc9faeacf604badbe 100644 GIT binary patch delta 9342 zcmdTp3v?6Lm6*a z>ZaSx<}6((4?6vvU7B=2 znXxSyhJ#O=vuA~EMtAP--FJWQzSG|-{ob>sdt-Gk6x?8Zo^N&q>2p|0M#Y$4xi@Nn zxrfZxb&Fg)W`TGsqYHw*X%SQp8%wplo#}sK43vkw!4B4ILT1Kd``X?5_Y)NOn3srH^<_$nT=A;3FP#*g3ECY@rDn0i?5qX(=%8I?*Tb4=h1jt*Yr?{Vcx!5FI4Um_~qs0wexkc3rkaF^i;(IvBT1gW?q|sF+ z4z_5_+=MBs91WHUdE|!`=Vx}W>JM#HgwQI;8B2|9gco5|P7596PD!&sHDIwW9-Yd`0#ujQPMz9=4%(wLV8oL0nS4D<9YmH474UiRZ4gJd}c`wdTUdoV^jz_Q}sK7u}sL&`M2gTN`$6;CE zRRM$~g<%{O;{qNQ0Vz4AmX%=?9F^h`&>#vjERC^3mFHDM--wi~R&fkOfW9=pg66<3 zBVa+6B^g%d*dT!>bX}m6Oczx*ZU)mrKAegRJT=&uQVBth30M~HO$&;Or6leZ)#d3y z%qJuDpa@`Zr@AK~ee!?^2vj%N68Il@L~zDhNzV?tG*CXBP^d1;fSON^V1qHO1t28G z%Mq&fRWt*0TdIwTl!a7$1Y6v*1X?PL$#Yl&YwJh%S6-~h_;HYr!(wn4Hd5x3pmbE0 z61br*;4>_b8}Oh&wNS)}FwBpDWLPW?SkROpM}@EoqN8zM^<%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;Z?HX zkHARl%h4cUFCaxzQ65+yaCP`@cU5>i3tdh>`zqxftG(_{*3i*~Sz+F5;R^N@+v;^S zkG0(Bb+ZH35#uDdf}Ik?kMOHzI9Im&*`FtA(@`?1orB`EV(4mLYpcf<GVc)I}%?P`WK-)#kSQpp%aSnwn6c7R3~Oa9$(H{5_!3N zWjU%B{Vh(Uju*j-c66@@o@ht8vBM*3119>>!{NP^LJ#}VbKH3GyVjv+B_&GNqpi~0 z+&n)>B}4b4--!X|Jb;SzSosEOunvW>#cR> VWKZcgPG|d#s~eX0?0Wi>{{mdXDfa*X diff --git a/README.md b/README.md index fc4843f..89c8eb0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ +# To the User: +####Please read through the instructions carefully. Please read through the [DMS "config.sqf"](https://github.com/Defent/DMS_Exile/blob/master/%40ExileServer/addons/a3_dms/config.sqf) before leaving any questions regarding DMS; the majority of the questions we receive are answered (directly or indirectly) by the config. + +####Disclaimer: +Defent's Mission System (DMS) is written from the ground up to be an efficient, easy to install, and vastly customizable mission system for the ArmA 3 [Exile Mod](http://www.exilemod.com/). You are perfectly welcome to port DMS or any of its functions for any other mod or (legal) purposes; and leaving credits is appreciated. + +However, creating such a mission system takes a lot of time and testing. We (the authors of DMS) are not perfect, and as a result, there may be bugs, glitches, and/or errors within DMS. We appreciate your co-operation in identifying and resolving such issues to improve DMS; however we are not liable for any issues resulting from the usage of DMS on/by your server. We are also not liable to help you in resolving any issues that may arise, although we will attempt to help you to some degree in most cases. + + +___ + + # Instructions See also: http://www.exilemod.com/topic/61-dms-defents-mission-system/?do=findComment&comment=242 @@ -13,15 +25,17 @@ If you are using infiSTAR and want to keep ```_CGM = true;```, then set ```_UMW ### To modify the config: -* Download the a3_dms folder -* Edit the config.sqf to your preferences. -* Pack the a3_dms folder with a PBO tool (**PBO Manager**, Eliteness, or Arma 3 Tools suite) -* Follow the ["To install:" steps](https://github.com/Defent/DMS_Exile#to-install) using the PBO you just created instead of the pre-packed one. +1. Download the a3_dms folder +2. Edit the config.sqf to your preferences. +3. Pack the a3_dms folder with a PBO tool (**PBO Manager**, Eliteness, or Arma 3 Tools suite) +4. Follow the ["To install:" steps](https://github.com/Defent/DMS_Exile#to-install) using the PBO you just created instead of the pre-packed one. ### HEADLESS CLIENT: -**People have reported Headless Client working properly in ArmA v1.52** +**The way DMS utilizes HC is unfavorable for large maps. As a result, we are dropping HC support for DMS until it is completed, then we will create proper Headless Client support.** + +People have reported Headless Client working properly in ArmA v1.52 Add this code to the TOP of your initPlayerLocal.sqf @@ -37,7 +51,9 @@ if (!hasInterface && !isServer) then }; ``` -## Credits: +___ + +# Credits: ### Authors: - [Defent](https://github.com/Defent) from [NumenaDayZ](http://numenadayz.com/). - [eraser1](https://github.com/eraser1) from [TrainwreckDayZ](http://www.trainwreckdayz.com/home). @@ -49,11 +65,29 @@ if (!hasInterface && !isServer) then - [maca134](http://maca134.co.uk/portfolio/m3editor-arma-3-map-editor/) for M3Editor Stuff - Everbody's feedback on [the DMS thread on exile forums](http://www.exilemod.com/topic/61-dms-defents-mission-system/?do=findComment&comment=242) +___ + +# Changelog: +#### October 9, 2015 (8:30 PM CST-America): +* **NEW CONFIG VALUE: DMS_Use_Map_Config** +* You can now overwrite "main config values" with map-specific config values located in the new "map_configs" folder. This should allow you to use one DMS PBO if you have multiple servers with different maps. Included examples for Altis, Bornholm, Esseker, and Tavi (Taviana). +* Because of the above implementation, DMS by default will not include the salt flats blacklist for findSafePos. In addition, it is preconfigured to the hilly terrains in Esseker and Taviana, as well as reducing all of the blacklist distances due to the smaller map size in Esseker. +* Created new function "DMS_fnc_DebugLog". All DMS files (that produced debug logs) have been changed, including mission files. However, updating them is not important (and completely pointless if you don't even use DMS_DEBUG). +* Fixed a few locations where it said "sized" instead of "seized". Thanks to [icomrade](https://github.com/icomrade) for pointing them out. +* DMS now utilizes the "ARMA_LOG" DLL (if it exists) by infiSTAR to produce debug logs (if enabled). All debug logs now also include server uptime (in seconds) and server FPS. +* The FSM no longer produces debug logs. +* AI Locality manager will now run every minute. +* Debug logs for "DMS_fnc_MissionsMonitor" will only output the mission name and the position, instead of all of the parameters. +* "DMS_fnc_IsNearWater" will now check the provided position itself for water. +* "DMS_fnc_IsValidPosition" will now do a surfaceNormal check within a 5 meter radius of the provided position as well. +* "_customGearSet" should now actually work for "DMS_fnc_SpawnAISoldier", and the function title comment has been updated for the slightly tweaked syntax. + -## Changelog: #### October 8, 2015 (7:15 PM CST-America): * **NEW CONFIG VALUES**: + |NEW| + |:---:| |DMS_Show_Kill_Poptabs_Notification| |DMS_Show_Kill_Respect_Notification| |DMS_dynamicText_Duration|