From 74f562de7e4bf46d04eb9be44d99dc8350a3959b Mon Sep 17 00:00:00 2001 From: eraser1 Date: Fri, 28 Aug 2015 03:38:46 -0500 Subject: [PATCH] Bunch of stuff Renamed preInit/postInit All config.sqf options setup and named (for now :P ) Removed "tools" from FillCrate since it was just addItemCargoGlobal as well FindSafePos adjustments + renames IsNearWater function (from WAI) Add "_markers" array to MissionStatusCheck params (planned implemention: [_dot,_circle] for the ability to rename a marker after mission completion. EG: "COMPLETED: Weapons Crate" for X seconds) Created SelectMagazine fnc Created files for a couple TODO functions --- @ExileServer/addons/a3_dms/config.cpp | 4 +- @ExileServer/addons/a3_dms/config.sqf | 370 +++++++++--------- .../{fn_start_DMS.sqf => fn_DMS_postInit.sqf} | 0 .../{fn_init_dms.sqf => fn_DMS_preInit.sqf} | 9 +- .../a3_dms/scripts/BroadcastMissionStatus.sqf | 4 +- .../addons/a3_dms/scripts/FillCrate.sqf | 41 +- .../addons/a3_dms/scripts/IsNearWater.sqf | 13 + .../a3_dms/scripts/MissionStatusCheck.sqf | 12 +- .../addons/a3_dms/scripts/RemoveMarkers.sqf | 1 + .../addons/a3_dms/scripts/SelectMagazine.sqf | 10 + .../addons/a3_dms/scripts/findSafePos.sqf | 34 +- 11 files changed, 248 insertions(+), 250 deletions(-) rename @ExileServer/addons/a3_dms/{fn_start_DMS.sqf => fn_DMS_postInit.sqf} (100%) rename @ExileServer/addons/a3_dms/{fn_init_dms.sqf => fn_DMS_preInit.sqf} (82%) create mode 100644 @ExileServer/addons/a3_dms/scripts/IsNearWater.sqf create mode 100644 @ExileServer/addons/a3_dms/scripts/RemoveMarkers.sqf create mode 100644 @ExileServer/addons/a3_dms/scripts/SelectMagazine.sqf diff --git a/@ExileServer/addons/a3_dms/config.cpp b/@ExileServer/addons/a3_dms/config.cpp index 4313975..514ae79 100644 --- a/@ExileServer/addons/a3_dms/config.cpp +++ b/@ExileServer/addons/a3_dms/config.cpp @@ -11,11 +11,11 @@ class CfgFunctions { class dms { class main { file = "\x\addons\dms"; - class init_dms + class DMS_preInit { preInit = 1; }; - class start_dms { + class DMS_postInit { postInit = 1; }; }; diff --git a/@ExileServer/addons/a3_dms/config.sqf b/@ExileServer/addons/a3_dms/config.sqf index 32042f4..e7c18cb 100644 --- a/@ExileServer/addons/a3_dms/config.sqf +++ b/@ExileServer/addons/a3_dms/config.sqf @@ -1,215 +1,201 @@ -/* GENERAL CONFIG */ - - DMS_DEBUG = false; // enable debug - blacklist = // I'm not using it - [ - ]; -/* END GENERAL CONFIG */ - - /* + Most of this stuff is stolen from WAI :P + https://github.com/nerdalertdk/WICKED-AI + + Created by eraser1 [_delay, _function, _params, _persistance] call ExileServer_system_thread_addTask; */ + DMS_DEBUG = false; + +/* Mission System Settings */ + DMS_DynamicMission = true; // Enable/disable dynamic mission system + DMS_MaxBanditMissions = 1; // Maximum number of Bandit Missions + DMS_StaticMission = false; // Enable/disable static missions + DMS_TimeBetweenMissions = [600,900]; // [Minimum,Maximum] time between missions (if mission limit is not reached) | DEFAULT: 10-15 mins + DMS_MissionTimeOut = [900,1800]; // [Minimum,Maximum] time it will take for a mission to timeout | Default: 15-30 mins + + DMS_MissionMarkerWinDot = true; // Keep the mission marker dot with a "win" message after mission is over + DMS_MissionMarkerLoseDot = true; // Keep the mission marker dot with a "lose" message after mission is over + DMS_MissionMarkerWinDotTime = 30; // How many seconds the "win" mission dot will remain on the map + DMS_MissionMarkerLoseDotTime = 30; // How many seconds the "lose" mission dot will remain on the map DMS_CompletedMissionCleanup = true; // Cleanup mission-spawned buildings and AI bodies after some time - DMS_CompletedMissionCleanup_Time = 3600; // How long until mission-spawned buildings and AI are cleaned up - DMS_player_reset_timeout = true; // If a player is this close to a mission then it won't time-out - DMS_player_reset_timeout_range = true; // If a player is this close to a mission then it won't time-out - DMS_player_notification_types = ["standardHintRequest"]; // Notification types. Supported values are: ["advancedHintRequest","dynamicTextRequest","standardHintRequest","systemChatRequest"] + DMS_CompletedMissionCleanupTime = 3600; // How long until mission-spawned buildings and AI are cleaned up + DMS_MissionTimeoutReset = true; // Enable mission timeout timer reset if a player is close + DMS_MissionTimeoutResetRange = 1000; // If a player is this close to a mission then it won't time-out + + DMS_PlayerNearBlacklist = 2000; // Missions won't spawn in a position this many meters close to a player + DMS_SpawnZoneNearBlacklist = 2500; // Missions won't spawn in a position this many meters close to a spawn zone + DMS_TraderZoneNearBlacklist = 3000; // Missions won't spawn in a position this many meters close to a trader zone + DMS_MissionNearBlacklist = 4000; // Missions won't spawn in a position this many meters close to another mission + DMS_WaterNearBlacklist = 750; // Missions won't spawn in a position this many meters close to water + + DMS_SpawnBoxSmoke = true; // Spawn a smoke grenade on mission box upon misson completion + DMS_SpawnBoxIRGrenade = true; // Spawn an IR grenade on mission box upon misson completion + + DMS_MinPlayerCount = 0; // Minimum number of players until mission start + DMS_MinServerFPS = 10; // Minimum server FPS for missions to start + + //Mission notification settings + DMS_PlayerNotificationTypes = ["standardHintRequest"]; // Notification types. Supported values are: ["advancedHintRequest","dynamicTextRequest","standardHintRequest","systemChatRequest"] DMS_dynamicText_Size = 0.55; // Dynamic Text size for "dynamicTextRequest" notification type. DMS_dynamicText_Color = "#FFCC00"; // Dynamic Text color for "dynamicTextRequest" notification type. -/* AI CONFIG */ + DMS_MissionTypes = [ // List of missions with spawn chances. If they add up to 100%, they represent the percentage chance each one will spawn + ["mission1",25], + ["mission2",50], + ["mission3",15], + ["mission4",10] + ]; - ai_clear_body = false; // instantly clear bodies - ai_clean_dead = true; // clear bodies after certain amount of time - ai_cleanup_time = 3600; // time to clear bodies in seconds - ai_clean_roadkill = false; // clean bodies that are roadkills - ai_roadkill_damageweapon = 0; // percentage of chance a roadkill will destroy weapon AI is carrying - wai_bandit_side = east; + DMS_findSafePosBlacklist = [ // For BIS_fnc_findSafePos position blacklist info refer to: https://community.bistudio.com/wiki/BIS_fnc_findSafePos + ]; +/* Mission System Settings */ - ai_bandit_combatmode = "RED"; // combatmode of bandit AI - ai_bandit_behaviour = "COMBAT"; // behaviour of bandit AI - ai_share_info = true; // AI share info on player position - ai_share_distance = 300; // distance from killed AI for AI to share your rough position +/* AI Settings */ + DMS_ai_wep_accessories = ["acc_pointer_IR","acc_flashlight"]; + DMS_ai_wep_suppressors = ["muzzle_snds_H","muzzle_snds_L","muzzle_snds_M","muzzle_snds_B","muzzle_snds_H_MG","muzzle_snds_acp"]; + + + DMS_banditSide = EAST; // The side (team) that AI Bandits will spawn on + DMS_clear_AI_body = false; // Clear AI body when they die + DMS_remove_roadkill = false; // Delete AI bodies that are roadkill + DMS_remove_roadkill_chance = 0; // Percentage chance that roadkilled AI bodies will be deleted + + DMS_ai_share_info = true; // Share info about killer + DMS_ai_share_info_distance = 300; // The distance killer's info will be shared to other AI + + DMS_ai_use_launchers = true; // Enable/disable spawning an AI in a group with a launcher + DMS_ai_use_launchers_chance = 0.5; // Percentage chance to actually spawn the launcher (per-group) + DMS_ai_remove_launchers = false; // Remove rocket launchers on AI death + DMS_ai_enable_water_equipment = true; // Enable/disable overriding default weapons of an AI if it spawns on/in water // https://community.bistudio.com/wiki/AI_Sub-skills#general - ai_skill_extreme = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Extreme - ai_skill_hard = [["aimingAccuracy",0.70],["aimingShake",0.70],["aimingSpeed",0.70],["spotDistance",0.70],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.70]]; // Hard - ai_skill_medium = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Medium - ai_skill_easy = [["aimingAccuracy",0.30],["aimingShake",0.50],["aimingSpeed",0.50],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.50]]; // Easy - ai_skill_random = [ai_skill_extreme,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_easy]; + DMS_ai_static_skills = true; // Use "DMS_ai_skill_static" for AI on static guns + DMS_ai_skill_extreme = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Extreme + DMS_ai_skill_hard = [["aimingAccuracy",0.70],["aimingShake",0.70],["aimingSpeed",0.70],["spotDistance",0.70],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.70]]; // Hard + DMS_ai_skill_medium = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Medium + DMS_ai_skill_easy = [["aimingAccuracy",0.30],["aimingShake",0.50],["aimingSpeed",0.50],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.50]]; // Easy + DMS_ai_skill_static = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; + DMS_ai_skill_random = [ai_skill_extreme,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_easy]; + DMS_static_weapons = ["O_HMG_01_F","O_HMG_01_high_F"]; // Static weapons for AI - ai_static_useweapon = true; // Allows AI on static guns to have a loadout - ai_static_weapons = ["O_HMG_01_F","O_HMG_01_high_F"]; // static guns + DMS_assault_weps = ["arifle_Katiba_GL_F","arifle_MX_GL_Black_F","arifle_Mk20_GL_F","arifle_TRG21_GL_F","arifle_Katiba_F","arifle_MX_Black_F","arifle_TRG21_F","arifle_TRG20_F","arifle_Mk20_plain_F","arifle_Mk20_F"]; // Assault + DMS_assault_pistols = ["hgun_PDW2000_F","hgun_ACPC2_F","hgun_Rook40_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F"]; + DMS_assault_scopes = ["optic_Arco","optic_Hamr","optic_Aco","optic_Holosight","optic_MRCO","optic_DMS"]; + DMS_assault_scope_chance = 0.75; // Percentage chance that assault AI will get a scope on their weapon + DMS_assault_items = ["ItemGPS"]; + DMS_assault_helmets = ["H_HelmetSpecB_paint1","H_HelmetIA_camo","H_HelmetLeaderO_ocamo","H_HelmetLeaderO_oucamo"]; + DMS_assault_clothes = ["U_O_CombatUniform_ocamo","U_O_PilotCoveralls","U_B_Wetsuit","U_BG_Guerilla3_1","U_BG_Guerilla2_3","U_BG_Guerilla2_2","U_BG_Guerilla1_1","U_BG_Guerrilla_6_1","U_IG_Guerilla3_2","U_B_SpecopsUniform_sgg","U_I_OfficerUniform","U_B_CTRG_3","U_I_G_resistanceLeader_F"]; + DMS_assault_vests = ["V_PlateCarrierH_CTRG","V_PlateCarrierSpec_rgr","V_PlateCarrierGL_blk","V_PlateCarrierGL_mtp","V_PlateCarrierGL_rgr","V_PlateCarrierSpec_blk","V_PlateCarrierSpec_mtp","V_PlateCarrierL_CTRG","V_TacVest_blk_POLICE","V_PlateCarrierIA2_dgtl"]; + DMS_assault_backpacks = ["B_Bergen_rgr","B_Carryall_oli","B_Kitbag_mcamo","B_Carryall_cbr","B_FieldPack_oucamo","B_FieldPack_cbr","B_Bergen_blk"]; - ai_static_skills = false; // Allows you to set custom array for AI on static weapons. (true: On false: Off) - ai_static_array = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["endurance",1.00],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; - - ai_assault_wep = ["arifle_Katiba_GL_F","arifle_MX_GL_Black_F","arifle_Mk20_GL_F","arifle_TRG21_GL_F","arifle_Katiba_F","arifle_MX_Black_F","arifle_TRG21_F","arifle_TRG20_F","arifle_Mk20_plain_F","arifle_Mk20_F"]; // Assault - ai_assault_scope = ["optic_Arco","optic_Hamr","optic_Aco","optic_Holosight","optic_MRCO","optic_DMS"]; - ai_assault_gear = ["ItemGPS","Binocular"]; - ai_assault_skin = ['U_O_CombatUniform_ocamo','U_O_PilotCoveralls','U_B_Wetsuit','U_BG_Guerilla3_1','U_BG_Guerilla2_3','U_BG_Guerilla2_2','U_BG_Guerilla1_1','U_BG_Guerrilla_6_1','U_IG_Guerilla3_2','U_B_SpecopsUniform_sgg','U_I_OfficerUniform','U_B_CTRG_3','U_I_G_resistanceLeader_F']; - ai_assault_skin = ai_assault_skin + ["U_I_Protagonist_VR"];//Give the VR suit half as much of a chance to spawn as another - ai_assault_backpack = ["B_Bergen_rgr","B_Carryall_oli","B_Kitbag_mcamo","B_Carryall_cbr","B_FieldPack_oucamo","B_FieldPack_cbr","B_Bergen_blk"]; - ai_assault_vest = ["V_PlateCarrierH_CTRG","V_PlateCarrierSpec_rgr","V_PlateCarrierGL_blk","V_PlateCarrierGL_mtp","V_PlateCarrierGL_rgr","V_PlateCarrierSpec_blk","V_PlateCarrierSpec_mtp","V_PlateCarrierL_CTRG","V_TacVest_blk_POLICE","V_PlateCarrierIA2_dgtl"]; - ai_assault = [ai_assault_wep,ai_assault_scope,ai_assault_gear,ai_assault_skin,ai_assault_backpack,ai_assault_vest]; - - ai_machine_wep = ["LMG_Zafir_F","LMG_Mk200_F","arifle_MX_SW_Black_F","MMG_01_hex_F"]; // Light machine guns - ai_machine_scope = ["optic_Arco","optic_Hamr","optic_Aco","optic_Holosight","optic_MRCO","optic_DMS"]; - ai_machine_gear = ["ItemWatch","ItemMap","ItemCompass"]; - ai_machine_skin = ai_assault_skin;//Use the same skins as assault :P - ai_machine_backback = ["B_Bergen_rgr","B_Carryall_oli","B_Kitbag_mcamo","B_Carryall_cbr","B_Bergen_blk"]; - ai_machine_vest = ai_assault_vest + ["V_HarnessO_brn","V_HarnessO_gry"]; - ai_machine = [ai_machine_wep,ai_machine_scope,ai_machine_gear,ai_machine_skin,ai_machine_backback,ai_machine_vest]; - - ai_sniper_wep = ["srifle_EBR_F","srifle_DMR_01_F","srifle_GM6_F","srifle_LRR_F","arifle_MXM_F","arifle_MXM_Black_F","srifle_DMR_02_F"]; // Sniper rifles - ai_sniper_scope = ["optic_SOS","optic_DMS","optic_LRPS"]; - ai_sniper_scope = ai_sniper_scope + ai_sniper_scope + ["optic_Nightstalker","optic_tws"];//Approximately 1/3rd as much chance to spawn thermal sight - ai_sniper_gear = ["Rangefinder","ItemGPS"]; - ai_sniper_skin = ["U_O_GhillieSuit","U_B_FullGhillie_ard","U_B_FullGhillie_lsh","U_B_FullGhillie_sard","U_B_GhillieSuit","U_I_FullGhillie_ard","U_I_FullGhillie_lsh","U_I_FullGhillie_sard","U_I_GhillieSuit","U_O_FullGhillie_ard","U_O_FullGhillie_lsh","U_O_FullGhillie_sard"]; - ai_sniper_backpack = ai_machine_backback;//Same backpacks as machinegunners - ai_sniper_vest = ai_machine_vest;//Same vests as machinegunners - ai_sniper = [ai_sniper_wep,ai_sniper_scope,ai_sniper_gear,ai_sniper_skin,ai_sniper_backpack,ai_sniper_vest]; - ai_headgear_list = ["H_PilotHelmetHeli_I","H_PilotHelmetHeli_O","H_PilotHelmetFighter_I","H_PilotHelmetFighter_O","H_HelmetCrew_O","H_CrewHelmetHeli_I","H_HelmetSpecB_paint1","H_HelmetIA_camo","H_HelmetLeaderO_ocamo","H_HelmetLeaderO_oucamo"]; + DMS_MG_weps = ["LMG_Zafir_F","LMG_Mk200_F","arifle_MX_SW_Black_F","MMG_01_hex_F"]; // LMGs + DMS_MG_pistols = ["hgun_PDW2000_F","hgun_ACPC2_F","hgun_Rook40_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F"]; + DMS_MG_scopes = ["optic_Hamr","optic_Aco","optic_Holosight","optic_MRCO"]; + DMS_MG_scope_chance = 0.5; // Percentage chance that MG AI will get a scope on their weapon + DMS_MG_items = ["ItemWatch","ItemMap","ItemCompass","Binocular"]; + DMS_MG_helmets = ["H_PilotHelmetHeli_I","H_PilotHelmetHeli_O","H_PilotHelmetFighter_I","H_PilotHelmetFighter_O","H_HelmetCrew_O","H_CrewHelmetHeli_I","H_HelmetSpecB_paint1","H_HelmetIA_camo","H_HelmetLeaderO_ocamo","H_HelmetLeaderO_oucamo"]; + DMS_MG_clothes = ["U_O_CombatUniform_ocamo","U_O_PilotCoveralls","U_B_Wetsuit","U_BG_Guerilla3_1","U_BG_Guerilla2_3","U_BG_Guerilla2_2","U_BG_Guerilla1_1","U_BG_Guerrilla_6_1","U_IG_Guerilla3_2","U_B_SpecopsUniform_sgg","U_I_OfficerUniform","U_B_CTRG_3","U_I_G_resistanceLeader_F"]; + DMS_MG_vests = ["V_PlateCarrierH_CTRG","V_PlateCarrierSpec_rgr","V_PlateCarrierGL_blk","V_PlateCarrierGL_mtp","V_PlateCarrierGL_rgr","V_PlateCarrierSpec_blk","V_PlateCarrierSpec_mtp","V_PlateCarrierL_CTRG","V_TacVest_blk_POLICE","V_PlateCarrierIA2_dgtl","V_HarnessO_brn","V_HarnessO_gry"]; + DMS_MG_backpacks = ["B_Bergen_rgr","B_Carryall_oli","B_Kitbag_mcamo","B_Carryall_cbr","B_Bergen_blk"]; - ai_random = [ai_assault,ai_assault,ai_assault,ai_sniper,ai_machine]; // random weapon 60% chance assault rifle,20% light machine gun,20% sniper rifle - - // Weapons accessories - ai_wep_item = ["acc_pointer_IR","acc_flashlight"]; - ai_wep_Suppressor = ["muzzle_snds_H","muzzle_snds_L","muzzle_snds_M","muzzle_snds_B","muzzle_snds_H_MG","muzzle_snds_acp"]; - - - ai_pistols = ["hgun_PDW2000_F","hgun_ACPC2_F","hgun_Rook40_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F"]; - ai_wep_water = ["arifle_SDAR_F"]; - - // AT/AA launchers - ai_wep_launchers_AT = []; - ai_wep_launchers_AA = []; - -/* END AI CONFIG */ + DMS_sniper_weps = ["srifle_EBR_F","srifle_DMR_01_F","srifle_GM6_F","srifle_LRR_F","arifle_MXM_F","arifle_MXM_Black_F","srifle_DMR_02_F"]; // Sniper rifles + DMS_sniper_pistols = ["hgun_PDW2000_F","hgun_ACPC2_F","hgun_Rook40_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F"]; + DMS_sniper_scopes = ["optic_SOS","optic_DMS","optic_LRPS"]; + DMS_sniper_scope_chance = 1; // Percentage chance that sniper AI will get a scope on their weapon + DMS_sniper_items = ["Rangefinder","ItemGPS"]; + DMS_sniper_helmets = ["H_HelmetSpecB_paint1","H_HelmetIA_camo","H_HelmetLeaderO_ocamo","H_HelmetLeaderO_oucamo"]; + DMS_sniper_clothes = ["U_O_GhillieSuit","U_B_FullGhillie_ard","U_B_FullGhillie_lsh","U_B_FullGhillie_sard","U_B_GhillieSuit","U_I_FullGhillie_ard","U_I_FullGhillie_lsh","U_I_FullGhillie_sard","U_I_GhillieSuit","U_O_FullGhillie_ard","U_O_FullGhillie_lsh","U_O_FullGhillie_sard"]; + DMS_sniper_vests = ["V_PlateCarrierH_CTRG","V_PlateCarrierSpec_rgr","V_PlateCarrierGL_blk","V_PlateCarrierGL_mtp","V_PlateCarrierGL_rgr","V_PlateCarrierSpec_blk","V_PlateCarrierSpec_mtp","V_PlateCarrierL_CTRG","V_TacVest_blk_POLICE","V_PlateCarrierIA2_dgtl","V_HarnessO_brn","V_HarnessO_gry"]; + DMS_sniper_backpacks = ["B_Bergen_rgr","B_Carryall_oli","B_Kitbag_mcamo","B_Carryall_cbr","B_Bergen_blk"]; + DMS_random_AI = ["assault","assault","assault","sniper","machine"]; // random weapon 60% chance assault rifle,20% light machine gun,20% sniper rifle -/* WAI MISSIONS CONFIG */ - wai_mission_system = true; // use built in mission system + DMS_AI_wep_launchers = ["Exile_Melee_Axe"]; +/* AI Settings */ - wai_mission_markers = []; - wai_avoid_missions = 2000; // avoid spawning missions this close to other missions, these are defined in wai_mission_markers - //wai_avoid_traders = 0; // avoid spawning missions this close to traders - //wai_avoid_town = 0; // avoid spawning missions this close to towns, *** doesn't function with infiSTAR enabled *** - //wai_avoid_road = 0; // avoid spawning missions this close to roads - wai_near_water = 500; // avoid spawning missions this close to water - - wai_blacklist_players_range = 2000; // distance to players - wai_blacklist_range = 2000; // distance to base, traders, spawnpoint +/* Loot Settings */ + DMS_BoxWeapons = [ //List of weapons that can potentially spawn in a crate + "Exile_Melee_Axe", + "arifle_Katiba_GL_F", + "arifle_MX_GL_Black_F", + "arifle_Mk20_GL_F", + "arifle_TRG21_GL_F", + "arifle_Katiba_F", + "arifle_MX_Black_F", + "arifle_TRG21_F", + "arifle_TRG20_F", + "arifle_Mk20_plain_F", + "arifle_Mk20_F", + "LMG_Zafir_F", + "LMG_Mk200_F", + "arifle_MX_SW_Black_F", + "MMG_01_hex_F", + "srifle_EBR_F", + "srifle_DMR_01_F", + "srifle_GM6_F", + "srifle_LRR_F", + "arifle_MXM_F", + "arifle_MXM_Black_F", + "srifle_DMR_02_F" + ]; + DMS_BoxSurvivalSupplies = [ //List of survival supplies (food/drink/meds) + "Exile_Item_Catfood_Cooked", + "Exile_Item_SausageGravy_Cooked", + "Exile_Item_BBQSandwich_Cooked", + "Exile_Item_PlasticBottleFreshWater", + "Exile_Item_PlasticBottleFreshWater", + "Exile_Item_Matches", + "Exile_Item_CookingPot" + ]; + DMS_BoxBuildingSupplies = [ //List of building supplies + "Exile_Item_CamoTentKit", + "Exile_Item_MetalPole", + "Exile_Item_MetalBoard", + "Exile_Item_LightBulb", + "Exile_Item_JunkMetal", + "Exile_Item_ExtensionCord", + "Exile_Item_DuctTape" + ]; + DMS_BoxOptics = [ + "optic_Arco", + "optic_Hamr", + "optic_Aco", + "optic_Holosight", + "optic_MRCO", + "optic_SOS", + "optic_DMS", + "optic_LRPS", + "optic_Nightstalker" + ]; + DMS_BoxBackpacks = [ //List of backpacks that can potentially spawn in a crate + "B_Bergen_rgr", + "B_Carryall_oli", + "B_Kitbag_mcamo", + "B_Carryall_cbr", + "B_FieldPack_oucamo", + "B_FieldPack_cbr", + "B_Bergen_blk" + ]; + DMS_BoxItems = DMS_BoxSurvivalSupplies+DMS_BoxBuildingSupplies+DMS_BoxOptics; // Random "items" can spawn optics, survival supplies, or building supplies + DMS_RareLoot = true; // Potential chance to spawn rare loot in any crate. + DMS_RareLootList = ["Exile_Item_SafeKit","Exile_Item_CodeLock"]; // List of rare loot to spawn + DMS_RareLootChance = 0.1; // Chance to spawn rare loot in any crate | Default: 10% - wai_mission_timer = [600,900]; // time between missions 10-15 minutes - wai_mission_timeout = [900,1800]; // time each missions takes to despawn if inactive 15-30 minutes - wai_timeout_bomb = 1800; // How long bomb missions is, when it times out it gos BOOM + // Vehicles + DMS_ArmedVehicles = ["Exile_Car_Offroad_Armed_Guerilla01"]; + DMS_RefuelTrucks = ["Exile_Car_Van_Fuel_Black","Exile_Car_Van_Fuel_White","Exile_Car_Van_Fuel_Red","Exile_Car_Van_Fuel_Guerilla01","Exile_Car_Van_Fuel_Guerilla02","Exile_Car_Van_Fuel_Guerilla03"]; + DMS_TransportTrucks = ["Exile_Car_Van_Guerilla01","Exile_Car_Van_Black"]; - wai_clean_mission = true; // clean all mission buildings after a certain period - wai_clean_mission_time = 900; // time after a mission is complete to clean mission buildings + DMS_TransportHelis = ["Exile_Chopper_Hummingbird_Green","Exile_Chopper_Orca_BlackCustom","Exile_Chopper_Mohawk_FIA","Exile_Chopper_Huron_Black","Exile_Chopper_Hellcat_Green","Exile_Chopper_Taru_Transport_Black"]; + DMS_MilitaryVehicles = ["Exile_Car_Strider","Exile_Car_Hunter","Exile_Car_Ifrit"]; - //wai_mission_fuel = [5,60]; // fuel inside mission spawned vehicles [min%,max%] - //wai_vehicle_damage = [20,70]; // damages to spawn vehicles with [min%,max%] - //wai_keep_vehicles = true; // save vehicles to database and keep them after restart - //wai_lock_vehicles = true; // lock mission vehicles and add keys to random AI bodies (be careful with ai_clean_dead if this is true + DMS_CivilianVehicles = ["Exile_Car_Hatchback_Rusty1","Exile_Car_Hatchback_Rusty2","Exile_Car_Hatchback_Sport_Red","Exile_Car_SUV_Red","Exile_Car_Offroad_Rusty2","Exile_Bike_QuadBike_Fia"]; +/* Loot Settings */ - wai_crates_smoke = true; // pop smoke on crate when mission is finished during daytime - wai_crates_flares = true; // pop flare on crate when mission is finished during nighttime - - wai_players_online = 0; // number of players online before mission starts - wai_server_fps = 10; // missions only starts if server FPS is over wai_server_fps - - // Don't use might be buged - wai_kill_percent = 0; // percentage of AI players that must be killed at "crate" missions to be able to trigger completion - - wai_high_value = true; // enable the possibility of finding a high value item (defined below crate_items_high_value) inside a crate - wai_high_value_chance = 10; // chance in percent you find above mentioned item - - wai_enable_minefield = false; // enable minefields to better defend missions - wai_use_launchers = false; // add a rocket launcher to each spawned AI group - wai_remove_launcher = true; // remove rocket launcher from AI on death - - // Missions - wai_announce = "text"; // Setting this to true will announce the missions to those that hold a radio only "radio", "global", "hint", "text" - wai_bandit_limit = 1; // define how many bandit missions can run at once - - //Syntax ["MISSION NAME","CHANGE"] Change must equal 100 when put together - wai_bandit_missions = [ - // ["nuke",2], - ["sniper_team",1], - ["rebel_base",1], - ["medi_camp",1], - // ["ikea_convoy",30], - ["patrol",0], - ["armed_vehicle",0], - ["black_hawk_crash",0], - ["captured_mv22",0], - ["broken_down_ural",0], - ["presidents_mansion",0], - ["weapon_cache",1], - - ["debug",0] - ]; - - // Vehicle arrays - armed_vehicle = ["Exile_Car_Offroad_Armed_Guerilla01"]; - armed_chopper = ["Exile_Chopper_Orca_BlackCustom"]; - refuel_trucks = ["Exile_Car_Van_Fuel_Guerilla01"]; - - civil_chopper = ["Exile_Chopper_Hummingbird_Green","Exile_Chopper_Orca_BlackCustom","Exile_Chopper_Mohawk_FIA","Exile_Chopper_Huron_Black","Exile_Chopper_Hellcat_Green","Exile_Chopper_Taru_Transport_Black"]; - military_unarmed = ["Exile_Car_Strider","Exile_Car_Hunter","Exile_Car_Ifrit"]; - cargo_trucks = ["Exile_Car_Van_Guerilla01","Exile_Car_Van_Black"]; - - civil_vehicles = ["Exile_Car_Hatchback_Rusty1","Exile_Car_Hatchback_Rusty2","Exile_Car_Hatchback_Sport_Red","Exile_Car_SUV_Red","Exile_Car_Offroad_Rusty2","Exile_Bike_QuadBike_Fia"]; - boots = []; - - wreck_water = ["Land_UWreck_FishingBoat_F","Land_UWreck_Heli_Attack_02_F","Land_UWreck_MV22_F","Land_Wreck_Traw2_F","Land_Wreck_Traw_F"]; - wreck = []; - - // Dynamic box array - crates_large = ["Box_NATO_AmmoVeh_F"]; - crates_medium = ["C_supplyCrate_F"]; - crates_small = ["Box_NATO_WpsSpecial_F"]; - - // weapons - crate_weapons_buildables = ["Exile_Melee_Axe"];//<--- TODO Setup Ikea Mission - crate_tools = ["Binocular","Rangefinder","ItemGPS","NVGoggles"]; - crate_tools_sniper = ["Laserdesignator","Rangefinder","NVGoggles","ItemGPS"]; - - //item - crate_tools_buildable = [];//<--- TODO Setup Ikea Mission - - crate_items = ["Exile_Item_Catfood_Cooked","Exile_Item_SausageGravy_Cooked","Exile_Item_BBQSandwich_Cooked","Exile_Item_GloriousKnakworst","Exile_Item_PlasticBottleFreshWater","Exile_Item_PlasticBottleFreshWater","Exile_Item_Energydrink","Exile_Item_Beer","Exile_Item_Matches","Exile_Item_CookingPot","Exile_Item_DuctTape","Exile_Item_InstaDoc"]; - crate_items_high_value = ["Exile_Item_SafeKit"]; - - crate_items_food = ["Exile_Item_Catfood_Cooked","Exile_Item_SausageGravy_Cooked","Exile_Item_BBQSandwich_Cooked","Exile_Item_PlasticBottleFreshWater","Exile_Item_PlasticBottleFreshWater","Exile_Item_Matches","Exile_Item_CookingPot"]; - crate_items_buildables = [];//<--- TODO Setup Ikea Mission - - crate_items_vehicle_repair = []; - crate_items_medical = ["Exile_Item_BBQSandwich_Cooked","Exile_Item_PlasticBottleFreshWater","Exile_Item_InstaDoc"]; - crate_items_sniper = ["U_O_GhillieSuit",["Exile_Item_InstaDoc",2]];//<--- Not used - crate_items_president = ["Exile_Item_InstaDoc"];//<--- Not used - - crate_backpacks_all = ai_assault_backpack; - crate_backpacks_large = ["B_Carryall_cbr","B_Carryall_khk","B_Carryall_mcamo"]; - - crate_random = [crate_items,crate_items_food,crate_items_vehicle_repair,crate_items_medical]; - -/* END WAI MISSIONS CONFIG */ - - // DEBUG SETTINGS + // Debug Overwrites if(DMS_DEBUG) then { - wai_remove_launcher = false; - wai_mission_timer = [60,60]; - wai_mission_timeout = [300,300]; - //wai_bandit_missions = [["debug",100]]; - //wai_bandit_missions = [["nuke",100]]; - //wai_bandit_missions = [["treasure_hunt_water",100]]; - }; - -/* STATIC MISSIONS CONFIG */ - - static_missions = false; // use static mission file - custom_per_world = false; // use a custom mission file per world \ No newline at end of file + DMS_TimeBetweenMissions = [60,60]; + DMS_MissionTimeOut = [300,300]; + }; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/fn_start_DMS.sqf b/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf similarity index 100% rename from @ExileServer/addons/a3_dms/fn_start_DMS.sqf rename to @ExileServer/addons/a3_dms/fn_DMS_postInit.sqf diff --git a/@ExileServer/addons/a3_dms/fn_init_dms.sqf b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf similarity index 82% rename from @ExileServer/addons/a3_dms/fn_init_dms.sqf rename to @ExileServer/addons/a3_dms/fn_DMS_preInit.sqf index 74ffeaa..73d0363 100644 --- a/@ExileServer/addons/a3_dms/fn_init_dms.sqf +++ b/@ExileServer/addons/a3_dms/fn_DMS_preInit.sqf @@ -25,8 +25,11 @@ load_ammo = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\loa //Completed DMS_MissionStatusCheck = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionStatusCheck.sqf"; DMS_MissionSuccessState = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionSuccessState.sqf";//<--- TODO -DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\findSafePos.sqf";//<--- TODO +DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSafePos.sqf";//<--- TODO DMS_BroadcastMissionStatus = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\BroadcastMissionStatus.sqf"; DMS_CleanUp = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\CleanUp.sqf"; -DMS_isPlayerNearbyARRAY = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\isPlayerNearbyARRAY.sqf"; -DMS_FillCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FillCrate.sqf"; \ No newline at end of file +DMS_isPlayerNearbyARRAY = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\IsPlayerNearbyARRAY.sqf"; +DMS_FillCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FillCrate.sqf"; +DMS_isNearWater = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\IsNearWater.sqf"; +DMS_RemoveMarkers = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\RemoveMarkers.sqf";//<--- TODO +DMS_selectMagazine = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SelectMagazine.sqf"; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/BroadcastMissionStatus.sqf b/@ExileServer/addons/a3_dms/scripts/BroadcastMissionStatus.sqf index 8635620..474943c 100644 --- a/@ExileServer/addons/a3_dms/scripts/BroadcastMissionStatus.sqf +++ b/@ExileServer/addons/a3_dms/scripts/BroadcastMissionStatus.sqf @@ -1,6 +1,6 @@ if (DMS_DEBUG) then { - diag_log format["DMS :: Notification types: |%1| for broadcasting mission status: %2",DMS_player_notification_types,_this]; + diag_log format["DMS :: Notification types: |%1| for broadcasting mission status: %2",DMS_PlayerNotificationTypes,_this]; }; { switch (_x) do @@ -11,4 +11,4 @@ if (DMS_DEBUG) then case "systemChatRequest":{[_x, [_this]] call ExileServer_system_network_send_broadcast;}; }; false; -} count DMS_player_notification_types; \ No newline at end of file +} count DMS_PlayerNotificationTypes; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/FillCrate.sqf b/@ExileServer/addons/a3_dms/scripts/FillCrate.sqf index 8a32057..597686b 100644 --- a/@ExileServer/addons/a3_dms/scripts/FillCrate.sqf +++ b/@ExileServer/addons/a3_dms/scripts/FillCrate.sqf @@ -12,11 +12,11 @@ Each argument can be an explicitly defined array of weapons with a number to spa */ -private ["_ammo","_tool","_box","_weapon","_item","_backpack","_toolCount","_itemCount","_backpackCount","_wepCount","_weps","_tools","_items","_backpacks"]; +private ["_ammo","_tool","_box","_weapon","_item","_backpack","_itemCount","_backpackCount","_wepCount","_weps","_items","_backpacks"]; _box = _this select 0; -// WEAPONS +// Weapons if(typeName (_this select 1) == "ARRAY") then { _wepCount = (_this select 1) select 0; _weps = (_this select 1) select 1; @@ -24,34 +24,26 @@ if(typeName (_this select 1) == "ARRAY") then { _wepCount = _this select 1; _weps = DMS_boxWeapons; }; -// TOOLS +// Items if(typeName (_this select 2) == "ARRAY") then { - _toolCount = (_this select 2) select 0; - _tools = (_this select 2) select 1; + _itemCount = (_this select 2) select 0; + _items = (_this select 2) select 1; } else { - _toolCount = _this select 2; - _tools = DMS_boxTools; -}; -// RANDOM -if(typeName (_this select 3) == "ARRAY") then { - _itemCount = (_this select 3) select 0; - _items = (_this select 3) select 1; -} else { - _itemCount = _this select 3; + _itemCount = _this select 2; _items = DMS_boxItems; }; -// BACKPACK -if(typeName (_this select 4) == "ARRAY") then { - _backpackCount = (_this select 4) select 0; - _backpacks = (_this select 4) select 1; +// Backpacks +if(typeName (_this select 3) == "ARRAY") then { + _backpackCount = (_this select 3) select 0; + _backpacks = (_this select 3) select 1; } else { - _backpackCount = _this select 4; + _backpackCount = _this select 3; _backpacks = DMS_boxBackpacks; }; if(DMS_DEBUG) then { - diag_log format["DMS :: Filling a dynamic crate with %1 guns, %2 tools, %3 items and %4 backpacks",_wepCount,_toolCount,_itemCount,_backpackCount]; + diag_log format["DMS :: Filling a dynamic crate with %1 guns, %2 items and %3 backpacks",_wepCount,_itemCount,_backpackCount]; }; @@ -66,15 +58,6 @@ if ((_wepCount>0) && {count _weps>0}) then { }; -if ((_toolCount > 0) && {count _tools>0}) then { - - for "_i" from 1 to _toolCount do { - _tool = _tools call BIS_fnc_selectRandom; - _box addItemCargoGlobal _tool; - }; - -}; - if ((_itemCount > 0) && {count _items>0}) then { for "_i" from 1 to _itemCount do { diff --git a/@ExileServer/addons/a3_dms/scripts/IsNearWater.sqf b/@ExileServer/addons/a3_dms/scripts/IsNearWater.sqf new file mode 100644 index 0000000..1ab456c --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/IsNearWater.sqf @@ -0,0 +1,13 @@ +private["_result","_position","_radius"]; + +_result = false; +_position = _this select 0; +_radius = _this select 1; + +for "_i" from 0 to 359 step 45 do { + _position = [(_position select 0) + (sin(_i)*_radius), (_position select 1) + (cos(_i)*_radius)]; + if (surfaceIsWater _position) exitWith { + _result = true; + }; +}; +_result \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/MissionStatusCheck.sqf b/@ExileServer/addons/a3_dms/scripts/MissionStatusCheck.sqf index 88f0a3f..4cebcba 100644 --- a/@ExileServer/addons/a3_dms/scripts/MissionStatusCheck.sqf +++ b/@ExileServer/addons/a3_dms/scripts/MissionStatusCheck.sqf @@ -8,7 +8,8 @@ [_cleanupObj1,_cleanupObj2,...,_cleanupObjX], [_crate,_vehicle1,_vehicle2,...,_vehicleX] ], - [_msgWIN,_msgLose] + [_msgWIN,_msgLose], + _markers ] */ if !(DMS_Mission_Arr isEqualTo []) then { @@ -21,7 +22,7 @@ if !(DMS_Mission_Arr isEqualTo []) then { diag_log ("DMS :: Checking Mission Status: "+str _x); }; _position = _x select 0; - _success = (_x select 1) call MissionSuccessState; + _success = (_x select 1) call DMS_MissionSuccessState; _timeStarted = _x select 2 select 0; _timeUntilFail = _x select 2 select 1; _units = _x select 3; @@ -29,15 +30,17 @@ if !(DMS_Mission_Arr isEqualTo []) then { _loot = _x select 4 select 1; _msgSuccess = _x select 5 select 0; _msgFail = _x select 5 select 1; + _markers = _x select 6; if (_success) exitWith { - [DMS_CompletedMissionCleanup_Time,DMS_CleanUp,(_units+_buildings),false] call ExileServer_system_thread_addTask; + [DMS_CompletedMissionCleanupTime,DMS_CleanUp,(_units+_buildings),false] call ExileServer_system_thread_addTask; _arr = DMS_Mission_Arr deleteAt _index; (_loot select 0) call DMS_FillCrate; _msgSuccess call DMS_BroadcastMissionStatus; + [_markers,"win"] call DMS_RemoveMarkers; }; - if (DMS_player_reset_timeout && {[_position,DMS_player_reset_timeout_range] call ExileServer_util_position_isPlayerNearby}) exitWith + if (DMS_MissionTimeoutReset && {[_position,DMS_MissionTimeoutResetRange] call ExileServer_util_position_isPlayerNearby}) exitWith { _x set [2,[diag_tickTime,_timeUntilFail]]; }; @@ -47,6 +50,7 @@ if !(DMS_Mission_Arr isEqualTo []) then { _arr = DMS_Mission_Arr deleteAt _index; (_units+_buildings+_loot) call DMS_CleanUp; _msgFail call DMS_BroadcastMissionStatus; + [_markers,"lose"] call DMS_RemoveMarkers; }; }; false; diff --git a/@ExileServer/addons/a3_dms/scripts/RemoveMarkers.sqf b/@ExileServer/addons/a3_dms/scripts/RemoveMarkers.sqf new file mode 100644 index 0000000..565c785 --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/RemoveMarkers.sqf @@ -0,0 +1 @@ +/*TODO*/ \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/SelectMagazine.sqf b/@ExileServer/addons/a3_dms/scripts/SelectMagazine.sqf new file mode 100644 index 0000000..db564a9 --- /dev/null +++ b/@ExileServer/addons/a3_dms/scripts/SelectMagazine.sqf @@ -0,0 +1,10 @@ +private["_result","_ammoArray"]; + +_result = ""; +_ammoArray = getArray (configFile >> "CfgWeapons" >> _this >> "magazines"); + +if (count _ammoArray > 0) then { + _result = _ammoArray select 0; +}; + +_result \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf b/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf index 47332bb..d613d1d 100644 --- a/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf +++ b/@ExileServer/addons/a3_dms/scripts/findSafePos.sqf @@ -1,8 +1,10 @@ -private ["_i","_traders","_safePosParams","_validspot","_position"]; +private ["_i","_safePosParams","_validspot","_position"]; -markerready = false; - -_safePosParams = [[16000,16000,0],1500,16000,(_this select 0),0,0.5,0]; +if (worldName=="Altis") then { + _safePosParams = [[16000,16000],0,16000,(_this select 0),0,0.5,0,DMS_findSafePosBlacklist]; +} else { + _safePosParams = [[],0,-1,(_this select 0),0,0.5,0,DMS_findSafePosBlacklist]; +}; _validspot = false; _i = 0; @@ -11,38 +13,34 @@ while{!_validspot} do { _validspot = true; _i = _i+1; call { - if (_position distance [14570, 16760, 0]<2000) exitWith + if ([_position,wai_near_water] call DMS_isNearWater) exitWith { _validspot = false; - if (debug_mode) then {diag_log "Position is too close to trader zone!";}; - }; - if ([_position,wai_near_water] call wai_isNearWater) exitWith - { - _validspot = false; - if (debug_mode) then {diag_log "Position is too close to water!";}; + if (DMS_DEBUG) then {diag_log "Position is too close to water!";}; }; - if ([_position] call wai_nearbyPlayers) exitWith + if ([_position,DMS_PlayerNearBlacklist] call ExileServer_util_position_isPlayerNearby) exitWith { _validspot = false; - if (debug_mode) then {diag_log "Position has players nearby!";}; + if (DMS_DEBUG) then {diag_log "Position has players nearby!";}; }; /* - Leave this off for now + markertype _x=="ExileSpawnZone" || "ExileTraderZone" - if(debug_mode) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); }; + if(DMS_DEBUG) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); }; { if ({getMarkerColor _x != "" && {_position distance (getMarkerPos _x) < wai_avoid_missions}}) exitWith { _validspot = false; - if (debug_mode) then {diag_log "Position is too close to another mission!";}; + if (DMS_DEBUG) then {diag_log "Position is too close to another mission!";}; }; - } count wai_mission_markers; + false; + } count allMapMarkers; */ }; if(_validspot) then { - if(debug_mode) then { diag_log("Loop complete, valid position " +str(_position) + " in " + str(_i) + " attempts"); }; + if(DMS_DEBUG) then { diag_log format["Mission position %1 with %2 params found in %3 attempts.",_position,_safePosParams,_i]; }; }; }; _position set [2, 0];