diff --git a/README.md b/README.md index 2fc11ec..2afe182 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ An AI spawner and monitor to be used in conjunction with DMS and will not work w http://www.exilemod.com/topic/61-dms-defents-mission-system/ Download the pbo version here: -https://www.dropbox.com/sh/00y7gqw0da9ugfj/AAD0sKAhupupaAjuPF2T7UIwa?dl=0 +https://www.dropbox.com/s/4c2dwwa6v86qhx9/a3_exile_occupation.pbo?dl=0 To install place the pbo into the @ExileServer/addons folder diff --git a/changeLog.txt b/changeLog.txt index 9d945c1..ecc3343 100644 --- a/changeLog.txt +++ b/changeLog.txt @@ -1,3 +1,12 @@ +================================================================================= +V56 (05-08-2016) +================================================================================= +config.sqf tidied up +Added the option to specify patrol locations and radius for roaming ai (land/sky/sea) +Updated the DMS anti freeze setting to work with the latest DMS version to stop +roaming vehicles from freezing +Added more info to the process reporter log entries + ================================================================================= V55 (27-07-2016) ================================================================================= diff --git a/config.cpp b/config.cpp index ebf3ed8..4926199 100644 --- a/config.cpp +++ b/config.cpp @@ -4,7 +4,7 @@ class CfgPatches units[] = {}; weapons[] = {}; requiredVersion = 0.1; - a3_exile_occupation_version = "v55 (27-07-2016)"; + a3_exile_occupation_version = "V56 (05-08-2016)"; requiredAddons[] = {"a3_dms"}; author[]= {"second_coming"}; }; diff --git a/config.sqf b/config.sqf index bfb247f..94f4f60 100644 --- a/config.sqf +++ b/config.sqf @@ -13,12 +13,11 @@ // Shared Config for each occupation monitor - -SC_debug = false; // set to true to turn on debug features (not for live servers) +SC_debug = false; // set to true to turn on debug features (not recommended for live servers) SC_useApexClasses = true; // true if you want to use the Apex class list over rides, false to use vanilla Arma gear SC_useMapOverrides = true; // set to true to enable over riding options per map (see the bottom of this file for examples) SC_extendedLogging = false; // set to true for additional logging -SC_processReporter = true; // log the a list of active server processes every 60 seconds (useful for debugging server problems) + SC_infiSTAR_log = true; // true Use infiSTAR logging, false logs to server rpt SC_maxAIcount = 100; // the maximum amount of AI, if the AI count is above this then additional AI won't spawn SC_mapMarkers = false; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false @@ -27,86 +26,79 @@ SC_scaleAI = 10; // any more than _scaleAI players on the server and _ SC_removeUserMapMarkers = true; // true to delete map markers placed by players every 10 seconds -SC_fastNights = true; // true if you want night time to go faster than daytime -SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm -SC_fastNightsMultiplierNight = 24; // the time multiplier to use at night (12 = 12x speed) -SC_fastNightsEnds = 6; // End fast nights at this hour (24 hour clock) eg. 6 for 6am -SC_fastNightsMultiplierDay = 4; // the time multiplier to use during daylight hours (4 = 4x speed) - -SC_useWaypoints = true; // When spawning AI create waypoints to make them enter buildings (can affect performance when the AI is spawned and the waypoints are calculated) - // Distance limits for selecting safe places to spawn AI SC_minDistanceToSpawnZones = 1000; // Minimum distance in metres to the nearest spawn zone SC_minDistanceToTraders = 1000; // Minimum distance in metres to the nearest trader zone SC_minDistanceToTerritory = 500; // Minimum distance in metres to the nearest player territory SC_minDistanceToPlayer = 400; // Minimum distance in metres to the nearest player +SC_useWaypoints = true; // When spawning AI create waypoints to make them enter buildings (can affect performance when the AI is spawned and the waypoints are calculated) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Turn Modules On or Off (can be overridden in the map overrides section) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +SC_processReporter = true; // log the a list of active server processes every 60 seconds (useful for debugging server problems) +SC_fastNights = true; // true if you want night time to go faster than daytime +SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits +SC_occupyTraders = true; // true if you want to create trader camps at positions specified in SC_occupyTraderDetails +SC_occupyStatic = false; // true if you want to add AI in specific locations +SC_occupyTransport = true; // true if you want pubic transport (travels between traders) +SC_occupyLootCrates = true; // true if you want to have random loot crates with guards SC_occupyRandomSpawn = false; // (WORK IN PROGRESS, NOT WORKING YET) true if you want random spawning AI that hunt for nearby players +SC_occupyMilitary = false; // true if you want military buildings patrolled +SC_occupyVehicle = true; // true if you want to have roaming AI land vehicles +SC_occupySky = true; // true if you want to have roaming AI helis +SC_occupySea = false; // true if you want to have roaming AI boats + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Fast nights Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm +SC_fastNightsMultiplierNight = 24; // the time multiplier to use at night (12 = 12x speed) +SC_fastNightsEnds = 6; // End fast nights at this hour (24 hour clock) eg. 6 for 6am +SC_fastNightsMultiplierDay = 4; // the time multiplier to use during daylight hours (4 = 4x speed) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Random Spawn Setup (not working yet) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + SC_randomSpawnMinPlayers = 1; // Minimum number of players to be online before random spawning AI can spawn SC_randomSpawnMaxAI = 5; // Maximum amount of random AI groups allowed at any time SC_randomSpawnIgnoreCount = true; // true if you want spawn random AI groups regardless of overall AI count (they still count towards the total though) -SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Occupy Places Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -SC_occupyVehicle = true; // true if you want to have roaming AI vehicles -SC_occupyVehicleIgnoreCount = true; // true if you want spawn vehicles regardless of overall AI count -SC_occupyVehiclesLocked = false; // true if AI vehicles to stay locked until all the linked AI are dead - -SC_occupyTraders = true; // (WORK IN PROGRESS) true if you want to create trader camps at positions specified in SC_occupyTraderDetails -SC_occupyTraderDetails = [ - //["Tanoa","Lifou Traders",[7317,7217,0],"trader1.sqf",true], - //["Tanoa","Lijnhaven Traders",[11580,2051,0],"trader1.sqf",true], - ["Napf","Hafen Traders",[9286,17606,0],"trader1.sqf",true] - ]; //["mapname","Name",[x,y,z],"filename",true] trader name, location, safezone true/false - -SC_SurvivorsChance = 20; // chance in % to spawn survivors instead of bandits (for places and land vehicles) SC_occupyPlacesSurvivors = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyPlaces must be true to use this option) -SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) -SC_SurvivorsFriendly = true; // true if you want survivors to be friendly to players (until they are attacked by players) - // false if you want survivors to be aggressive to players -// Possible equipment for survivor AI to spawn with -// spawning survivors without vests or backpacks will result in them having no ammunition -SC_SurvivorUniforms = ["Exile_Uniform_BambiOverall"]; -SC_SurvivorVests = ["V_BandollierB_blk","V_BandollierB_cbr","V_BandollierB_khk","V_BandollierB_oli"]; -SC_SurvivorHeadgear = []; -SC_SurvivorWeapon = ["arifle_MXC_F","arifle_TRG20_F"]; -SC_SurvivorWeaponAttachments = []; -SC_SurvivorMagazines = ["Exile_Item_Vishpirin","Exile_Item_Bandage"]; -SC_SurvivorPistol = ["hgun_Rook40_F"]; -SC_SurvivorPistolAttachments = []; -SC_SurvivorAssignedItems = ["ItemMap","ItemCompass","ItemRadio","ItemWatch","Exile_Item_XM8"]; // all these items will be added -SC_SurvivorLauncher = []; -SC_SurvivorBackpack = []; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Trader Base Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Possible equipment for bandit AI to spawn with -// spawning bandits without vests or backpacks will result in them having no ammunition -SC_BanditUniforms = ["U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_Guerilla3_1","U_BG_Guerilla2_1","U_IG_Guerilla3_2","U_BG_Guerrilla_6_1","U_BG_Guerilla1_1","U_BG_Guerilla2_2","U_BG_Guerilla2_3","U_BG_Guerilla3_1"]; -SC_BanditVests = ["V_BandollierB_blk","V_BandollierB_cbr","V_BandollierB_khk","V_BandollierB_oli"]; -SC_BanditHeadgear = ["H_Shemag_khk","H_Shemag_olive","H_Shemag_olive_hs","H_Shemag_tan","H_ShemagOpen_khk","H_ShemagOpen_tan"]; -SC_BanditWeapon = ["LMG_Zafir_F","arifle_Katiba_C_F","arifle_Katiba_F","arifle_Katiba_GL_F","arifle_MXC_Black_F","arifle_MXC_F","arifle_TRG20_F","arifle_TRG21_F","arifle_TRG21_GL_F"]; -SC_BanditWeaponAttachments = []; -SC_BanditMagazines = ["Exile_Item_InstaDoc","Exile_Item_Vishpirin","Exile_Item_Bandage","Exile_Item_DuctTape","Exile_Item_PlasticBottleFreshWater","Exile_Item_Energydrink","Exile_Item_EMRE","Exile_Item_Cheathas","Exile_Item_Noodles","Exile_Item_BBQSandwich","Exile_Item_Catfood"]; -SC_BanditPistol = ["hgun_ACPC2_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F","hgun_Rook40_F"]; -SC_BanditPistolAttachments = []; -SC_BanditAssignedItems = ["ItemMap","ItemCompass","ItemRadio","ItemWatch"]; // all these items will be added -SC_BanditLauncher = []; -SC_BanditBackpack = ["B_HuntingBackpack","B_Kitbag_cbr","B_Kitbag_mcamo","B_Kitbag_sgg","B_OutdoorPack_blk","B_OutdoorPack_blu","B_OutdoorPack_tan","B_TacticalPack_blk","B_TacticalPack_mcamo","B_TacticalPack_ocamo","B_TacticalPack_oli","B_TacticalPack_rgr"]; +SC_occupyTraderDetails = [ + //["Tanoa","Lifou Traders",[7317,7217,0],"trader1.sqf",true], + //["Tanoa","Lijnhaven Traders",[11580,2051,0],"trader1.sqf",true], + ["Napf","Hafen Traders",[9286,17606,0],"trader1.sqf",true] + ]; //["mapname","Name",[x,y,z],"filename",true] trader name, location, safezone true/false + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Occupy Static Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -SC_occupyStatic = false; // true if you want to add AI in specific locations -SC_staticBandits = [ //[[pos],ai count,radius,search buildings] +SC_staticBandits = [ //[[pos],ai count,radius,search buildings] - ]; -SC_staticSurvivors = [ //[[pos],ai count,radius,search buildings] - //[[3770,8791,0],8,250,true] - ]; + ]; +SC_staticSurvivors = [ //[[pos],ai count,radius,search buildings] + //[[3770,8791,0],8,250,true] + ]; -SC_occupySky = true; // true if you want to have roaming AI helis -SC_occupySea = false; // true if you want to have roaming AI boats - -SC_occupyTransport = true; // true if you want pubic transport (travels between traders) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Public Transport Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + SC_colourTransport = true; // true if you want the public transport coloured SC_secureTransport = true; // true if you want the public transport and pilot to be indestructible SC_occupyTransportClass = ["Exile_Chopper_Hummingbird_Green"]; // to always use the same vehicle, specify one option only @@ -128,8 +120,11 @@ SC_TransportLandWaypoints = [ [4000,4000,0] ]; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Loot Crate Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + -SC_occupyLootCrates = true; // true if you want to have random loot crates with guards SC_occupyLootCratesStatic = false; // true if you want to have random loot crates spawn in pre-defined locations set in SC_occupyLootCratesLocations SC_occupyLootCratesLocations = [ [1000,1000,0], @@ -140,7 +135,7 @@ SC_occupyLootCratesLocations = [ SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk) SC_LootCrateGuards = 3; // number of AI to spawn at each crate SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_LootCrateGuards (so between 1 and SC_LootCrateGuards) -SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns +SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns SC_ropeAttach = false; // Allow lootcrates to be airlifted (for SC_occupyLootCrates and SC_occupyHeliCrashes) @@ -174,6 +169,10 @@ SC_LootCrateItems = [ ["Exile_Item_MetalScrews",0,5] ]; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Blacklisted Zones +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + SC_blackListedAreas = [ [[3810,8887,0], 500, "Chernarus"], // Vybor Occupation DMS Static Mission [[12571,14337,0], 500, "Altis"], // Neochori Occupation DMS Static Mission @@ -184,6 +183,9 @@ SC_blackListedAreas = [ [[7228,6986,0], 250, "Tanoa"] // Tanoa Airport ]; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Heli Crash Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes SC_numberofHeliCrashesFire = true; // true if you want the crash on fire, false if you just want smoke @@ -192,6 +194,7 @@ SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes // Array of possible common items to go in heli crash crates ["classname",fixed amount,random amount] NOT INCLUDING WEAPONS // ["HandGrenade",0,2] this example would add between 0 and 2 HandGrenade to the crate (fixed 0 plus 0-2 random) // to add a fixed amount make the second number 0 + SC_HeliCrashItems = [ ["B_Parachute",1,1], ["H_CrewHelmetHeli_B",1,1], @@ -215,15 +218,36 @@ SC_HeliCrashWeapons = [ "srifle_DMR_05_hex_F" ]; -SC_HeliCrashWeaponsAmount = [1,3]; // [fixed amount to add, random amount to add] -SC_HeliCrashMagazinesAmount = [2,2]; // [fixed amount to add, random amount to add] +SC_HeliCrashWeaponsAmount = [1,3]; // [fixed amount to add, random amount to add] +SC_HeliCrashMagazinesAmount = [2,2]; // [fixed amount to add, random amount to add] -SC_minimumCrewAmount = 2; // Maximum amount of AI allowed in a vehicle (applies to ground, air and sea vehicles) -SC_maximumCrewAmount = 6; // Maximum amount of AI allowed in a vehicle (applies to ground, air and sea vehicles) - // (essential crew like drivers and gunners will always spawn regardless of these settings) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Roaming Vehicle Setup - (applies to ground, air and sea vehicles) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Settings for roaming ground vehicle AI -SC_maxNumberofVehicles = 4; +SC_minimumCrewAmount = 2; // Maximum amount of AI allowed in a vehicle +SC_maximumCrewAmount = 6; // Maximum amount of AI allowed in a vehicle + // (essential crew like drivers and gunners will always spawn regardless of these settings) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Roaming Land Vehicle Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +SC_maxNumberofVehicles = 4; // How many roaming vehicles to spawn +SC_occupyVehicleIgnoreCount = true; // true if you want spawn vehicles regardless of overall AI count +SC_occupyVehiclesLocked = false; // true if AI vehicles to stay locked until all the linked AI are dead +SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) + +SC_occupyVehicleUseFixedPos = false; // True if you want to specify the patrol positions and radius of the area to patrol / false for random + + // if you set SC_maxNumberofVehicles higher than the number of static positions, the remainder will be random + // they will also ignore any blacklisted areas +SC_occupyVehicleFixedPositions = [ + [[4434,2892,0],2000,"Tanoa"], // [[x,y,z],radius,"mapname"] leave no spaces between + [[2238,6717,0],2000,"Tanoa"], + [[8197,9081,0],3000,"Tanoa"], + [[13074,11817,0],3000,"Tanoa"] + ]; // Array of arrays of ground vehicles which can be used by AI patrols (the number next to next vehicle is the maximum amount of that class allowed, 0 for no limit) SC_VehicleClassToUse = [ @@ -240,11 +264,30 @@ SC_VehicleClassToUseRare = [ ["Exile_Car_Tempest",1] ]; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Roaming Aircraft Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Settings for roaming airborne AI (non armed helis will just fly around) -SC_maxNumberofHelis = 1; +SC_maxNumberofHelis = 1; // Array of aircraft which can be used by AI patrols (the number next to next vehicle is the maximum amount of that class allowed, 0 for no limit) -SC_HeliClassToUse = [ ["Exile_Chopper_Huey_Armed_Green",0] ]; +SC_HeliClassToUse = [ ["Exile_Chopper_Huey_Armed_Green",0] ]; + +SC_occupyHeliUseFixedPos = false; // True if you want to specify the patrol positions and radius of the area to patrol / false for random + + // if you set SC_maxNumberofHelis higher than the number of static positions, the remainder will be random + // they will also ignore any blacklisted areas +SC_occupyHeliFixedPositions = [ + [[4434,2892,400],2000,"Tanoa"], // [[x,y,z],radius,"mapname"] leave no spaces between + [[2238,6717,400],2000,"Tanoa"], + [[8197,9081,400],3000,"Tanoa"], + [[13074,11817,400],3000,"Tanoa"] + ]; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Roaming Boats Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Settings for roaming seaborne AI (non armed boats will just sail around) SC_maxNumberofBoats = 1; @@ -256,17 +299,21 @@ SC_BoatClassToUse = [ ["O_Boat_Transport_01_F",0], ["Exile_Boat_MotorBoat_Police",1] ]; - -SC_useRealNames = true; - -// Arrays of names used to generate names for AI -SC_SurvivorFirstNames = ["John","Dave","Steve","Rob","Richard","Bob","Andrew","Nick","Adrian","Mark","Adam","Will","Graham"]; -SC_SurvivorLastNames = ["Smith","Jones","Davids","Johnson","Jobs","Andrews","White","Brown","Taylor","Walker","Williams","Clarke","Jackson","Woods"]; -SC_BanditFirstNames = ["Alex","Nikita","George","Daniel","Adam","Alexander","Sasha","Sergey","Dmitry","Anton","Jakub","Vlad","Maxim","Oleg","Denis","Wojtek"]; -SC_BanditLastNames = ["Dimitrov","Petrov","Horvat","Novak","Dvorak","Vesely","Horak","Hansen","Larsen","Tamm","Ivanov","Pavlov","Virtanen"]; + +SC_occupyBoatUseFixedPos = false; // True if you want to specify the patrol positions and radius of the area to patrol / false for random + // if you set SC_maxNumberofHelis higher than the number of static positions, the remainder will be random + // they will also ignore any blacklisted areas +SC_occupyBoatFixedPositions = [ + [[200,200,0],2000,"Tanoa"], // [[x,y,z],radius,"mapname"] leave no spaces between + [[400,400,0],2000,"Tanoa"], + [[14000,5000,0],3000,"Tanoa"], + [[16000,16000,0],3000,"Tanoa"] + ]; -SC_occupyMilitary = true; // true if you want military buildings patrolled +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Occupy Military Setup +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Array of buildings to add military patrols to SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F","Land_Airport_Tower_F","Land_Cargo_House_V1_F", @@ -291,7 +338,56 @@ SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F","Land_Ai "Land_Cargo_Tower_V4_F" ]; -// namalsk specific settings (if you want to override settings for specific maps if you run multiple servers) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// AI Setup (used in multiple modules) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +SC_useRealNames = true; + +// Arrays of names used to generate names for AI +SC_SurvivorFirstNames = ["John","Dave","Steve","Rob","Richard","Bob","Andrew","Nick","Adrian","Mark","Adam","Will","Graham"]; +SC_SurvivorLastNames = ["Smith","Jones","Davids","Johnson","Jobs","Andrews","White","Brown","Taylor","Walker","Williams","Clarke","Jackson","Woods"]; +SC_BanditFirstNames = ["Alex","Nikita","George","Daniel","Adam","Alexander","Sasha","Sergey","Dmitry","Anton","Jakub","Vlad","Maxim","Oleg","Denis","Wojtek"]; +SC_BanditLastNames = ["Dimitrov","Petrov","Horvat","Novak","Dvorak","Vesely","Horak","Hansen","Larsen","Tamm","Ivanov","Pavlov","Virtanen"]; + +SC_SurvivorsChance = 20; // chance in % to spawn survivors instead of bandits (for places and land vehicles) + + +SC_SurvivorsFriendly = true; // true if you want survivors to be friendly to players (until they are attacked by players) + // false if you want survivors to be aggressive to players + +// Possible equipment for survivor AI to spawn with +// spawning survivors without vests or backpacks will result in them having no ammunition +SC_SurvivorUniforms = ["Exile_Uniform_BambiOverall"]; +SC_SurvivorVests = ["V_BandollierB_blk","V_BandollierB_cbr","V_BandollierB_khk","V_BandollierB_oli"]; +SC_SurvivorHeadgear = []; +SC_SurvivorWeapon = ["arifle_MXC_F","arifle_TRG20_F"]; +SC_SurvivorWeaponAttachments = []; +SC_SurvivorMagazines = ["Exile_Item_Vishpirin","Exile_Item_Bandage"]; +SC_SurvivorPistol = ["hgun_Rook40_F"]; +SC_SurvivorPistolAttachments = []; +SC_SurvivorAssignedItems = ["ItemMap","ItemCompass","ItemRadio","ItemWatch","Exile_Item_XM8"]; // all these items will be added +SC_SurvivorLauncher = []; +SC_SurvivorBackpack = []; + +// Possible equipment for bandit AI to spawn with +// spawning bandits without vests or backpacks will result in them having no ammunition +SC_BanditUniforms = ["U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_Guerilla3_1","U_BG_Guerilla2_1","U_IG_Guerilla3_2","U_BG_Guerrilla_6_1","U_BG_Guerilla1_1","U_BG_Guerilla2_2","U_BG_Guerilla2_3","U_BG_Guerilla3_1"]; +SC_BanditVests = ["V_BandollierB_blk","V_BandollierB_cbr","V_BandollierB_khk","V_BandollierB_oli"]; +SC_BanditHeadgear = ["H_Shemag_khk","H_Shemag_olive","H_Shemag_olive_hs","H_Shemag_tan","H_ShemagOpen_khk","H_ShemagOpen_tan"]; +SC_BanditWeapon = ["LMG_Zafir_F","arifle_Katiba_C_F","arifle_Katiba_F","arifle_Katiba_GL_F","arifle_MXC_Black_F","arifle_MXC_F","arifle_TRG20_F","arifle_TRG21_F","arifle_TRG21_GL_F"]; +SC_BanditWeaponAttachments = []; +SC_BanditMagazines = ["Exile_Item_InstaDoc","Exile_Item_Vishpirin","Exile_Item_Bandage","Exile_Item_DuctTape","Exile_Item_PlasticBottleFreshWater","Exile_Item_Energydrink","Exile_Item_EMRE","Exile_Item_Cheathas","Exile_Item_Noodles","Exile_Item_BBQSandwich","Exile_Item_Catfood"]; +SC_BanditPistol = ["hgun_ACPC2_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F","hgun_Rook40_F"]; +SC_BanditPistolAttachments = []; +SC_BanditAssignedItems = ["ItemMap","ItemCompass","ItemRadio","ItemWatch"]; // all these items will be added +SC_BanditLauncher = []; +SC_BanditBackpack = ["B_HuntingBackpack","B_Kitbag_cbr","B_Kitbag_mcamo","B_Kitbag_sgg","B_OutdoorPack_blk","B_OutdoorPack_blu","B_OutdoorPack_tan","B_TacticalPack_blk","B_TacticalPack_mcamo","B_TacticalPack_ocamo","B_TacticalPack_oli","B_TacticalPack_rgr"]; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Map Specific Overrides +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (worldName == 'Namalsk' AND SC_useMapOverrides) then { SC_maxAIcount = 80; @@ -303,20 +399,28 @@ if (worldName == 'Namalsk' AND SC_useMapOverrides) then SC_occupyTransportClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk }; -// Napf specific settings (if you want to override settings for specific maps if you run multiple servers) if (worldName == 'Napf' AND SC_useMapOverrides) then { - + //SC_maxAIcount = 160; + //SC_maxNumberofVehicles = 5; +}; + +if (worldName == 'Chernarus' AND SC_useMapOverrides) then +{ + //SC_maxAIcount = 160; + //SC_maxNumberofVehicles = 5; }; -// Napf specific settings (if you want to override settings for specific maps if you run multiple servers) if (worldName == 'Tanoa' AND SC_useMapOverrides) then { SC_useApexClasses = true; SC_maxAIcount = 80; }; -// Overrides to use Apex weapons, gear and vehicles if SC_useApexClasses = true +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Apex Specific Settings (only used if SC_useApexClasses = true) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(SC_useApexClasses) then { SC_BanditWeapon = [ "arifle_MX_khk_F","arifle_MX_GL_khk_F","arifle_MX_SW_khk_F","arifle_MXC_khk_F","arifle_MXM_khk_F","arifle_AK12_F","arifle_AK12_GL_F","arifle_AKM_F", @@ -337,27 +441,34 @@ if(SC_useApexClasses) then ]; }; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Debug Settings (only used if SC_debug = true) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (SC_debug) then { SC_extendedLogging = true; SC_processReporter = true; - SC_mapMarkers = true; - SC_occupyPlaces = true; + SC_mapMarkers = false; + SC_occupyPlaces = false; SC_occupyVehicle = true; - SC_occupyMilitary = true; - SC_occupyStatic = true; + SC_occupyMilitary = false; + SC_occupyStatic = false; SC_occupySky = true; - SC_occupySea = false; - SC_occupyTransport = true; - SC_occupyLootCrates = true; - SC_occupyHeliCrashes = true; - SC_maxNumberofVehicles = 4; - SC_maxNumberofBoats = 1; - SC_maxNumberofHelis = 1; + SC_occupySea = true; + SC_occupyTransport = false; + SC_occupyLootCrates = false; + SC_occupyHeliCrashes = false; + SC_maxAIcount = 160; + SC_maxNumberofVehicles = 5; + SC_maxNumberofBoats = 5; + SC_maxNumberofHelis = 5; }; +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Don't alter anything below this point, unless you want your server to explode :) +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(!SC_SurvivorsFriendly) then { CIVILIAN setFriend[RESISTANCE,0]; @@ -381,6 +492,17 @@ SC_liveBoatsArray = []; SC_liveStaticGroups = []; SC_transportArray = []; +// Remove spawn locations for roaming vehicles that aren't for this map +_occupyVehicleFixedPositions = []; +{ + _currentWorld = _x select 2; + if(worldName == _currentWorld) then + { + _occupyVehicleFixedPositions pushback _x; + }; +}forEach SC_occupyVehicleFixedPositions; +SC_occupyVehicleFixedPositions = _occupyVehicleFixedPositions; + publicVariable "SC_liveVehicles"; publicVariable "SC_liveVehiclesArray"; publicVariable "SC_liveHelis"; diff --git a/scripts/deleteMapMarkers.sqf b/scripts/deleteMapMarkers.sqf index 15f2f23..5d23db3 100644 --- a/scripts/deleteMapMarkers.sqf +++ b/scripts/deleteMapMarkers.sqf @@ -11,7 +11,7 @@ if (SC_occupyLootCratesMarkers) then if(!isNil "_pos") then { - if([_pos, 15] call ExileClient_util_world_isAlivePlayerInRange) then + if([_pos, 5] call ExileClient_util_world_isAlivePlayerInRange) then { deleteMarker _markerName; _logDetail = format ["[OCCUPATION:LootCrates]:: marker %1 removed at %2",_markerName,time]; diff --git a/scripts/eventHandlers/hitAir.sqf b/scripts/eventHandlers/hitAir.sqf index a9ea897..6502438 100644 --- a/scripts/eventHandlers/hitAir.sqf +++ b/scripts/eventHandlers/hitAir.sqf @@ -95,7 +95,7 @@ if(_heliDamage > 0.7 && _damagedEssentials > 0) then _heli setVehicleLock "UNLOCKED"; _target = _this select 1; _group = group _heli; - _group reveal [_target,2.5]; + _destination = position _target; _heli land "LAND"; @@ -105,6 +105,7 @@ if(_heliDamage > 0.7 && _damagedEssentials > 0) then } forEach (fullCrew _heli); _group2 allowFleeing 0; + _group2 reveal [_target,2.5]; _wp = _group2 addWaypoint [_destination, 0] ; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; @@ -117,4 +118,7 @@ if(_heliDamage > 0.7 && _damagedEssentials > 0) then _group2 setCombatMode "RED"; }; -_heli addMPEventHandler ["mphit", "_this call SC_fnc_hitAir;"]; \ No newline at end of file +if(_heliDamage <= 0.2 && _damagedEssentials == 0) then +{ + _heli addMPEventHandler ["mphit", "_this call SC_fnc_hitAir;"]; +}; \ No newline at end of file diff --git a/scripts/eventHandlers/hitLand.sqf b/scripts/eventHandlers/hitLand.sqf index db48785..024fbd3 100644 --- a/scripts/eventHandlers/hitLand.sqf +++ b/scripts/eventHandlers/hitLand.sqf @@ -122,10 +122,12 @@ if(_wheelDamage OR _engineDamage OR _fueltankDamage) then _wp setWaypointCompletionRadius 1; _wp setWaypointType "GETIN"; sleep 5; - _spawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _tempLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; _driver action ["movetodriver", _vehicle]; _vehicle forceSpeed -1; - [_group, _spawnLocation, 2000] call bis_fnc_taskPatrol; + [_group, _originalSpawnLocation, _radius] call bis_fnc_taskPatrol; _group setBehaviour "SAFE"; _group setCombatMode "RED"; _driver enableAI "MOVE"; diff --git a/scripts/eventHandlers/hitSea.sqf b/scripts/eventHandlers/hitSea.sqf index d6d8398..fa1bba7 100644 --- a/scripts/eventHandlers/hitSea.sqf +++ b/scripts/eventHandlers/hitSea.sqf @@ -1,9 +1,10 @@ _boat = _this select 0; _boat removeAllMPEventHandlers "mphit"; -_boatDamage = getDammage _boat; -_boatPosition = getPosATL _boat; -_boatHeight = getPosATL _boat select 2; -_crewEjected = _boat getVariable "SC_crewEjected"; + +_boatDamage = damage _boat; +_boatPosition = getPosATL _boat; +_boatHeight = getPosATL _boat select 2; +_crewEjected = _boat getVariable "SC_crewEjected"; _damageLimit = 0.2; _engineDamage = false; @@ -47,7 +48,7 @@ if(_boatDamage > 0.2 && _damagedEssentials > 0 && !_crewEjected && _ejectChance if(SC_extendedLogging) then { _boatPosition = getPosATL _veh; - _logDetail = format ["[OCCUPATION:Sky]:: Air unit %2 ejecting passengers at %3 (time: %1)",time,_veh,_boatPosition]; + _logDetail = format ["[OCCUPATION:Sky]:: Sea unit %2 ejecting passengers at %3 (time: %1)",time,_veh,_boatPosition]; [_logDetail] call SC_fnc_log; }; _cargo = assignedCargo _veh; diff --git a/scripts/extras/processReporter.sqf b/scripts/extras/processReporter.sqf index 0c0a632..87634ee 100644 --- a/scripts/extras/processReporter.sqf +++ b/scripts/extras/processReporter.sqf @@ -6,6 +6,15 @@ _logDetail = "================================================================== _logDetail = "======================================================================================================="; [_logDetail,'A3_EXILE_PROCESSREPORTER'] call SC_fnc_log; +_activeProcesses = diag_activeScripts; +_spawnedCount = _activeProcesses select 0; +_execVMCount = _activeProcesses select 1; +_execCount = _activeProcesses select 2; +_execFSMCount = _activeProcesses select 3; + +_logDetail = format ["[processReporter] Process Counts: spawn-ed: %1 execVM-ed: %2 exec-ed: %3 execFSM-ed: %4",_spawnedCount,_execVMCount,_execCount,_execFSMCount]; +[_logDetail,'A3_EXILE_PROCESSREPORTER'] call SC_fnc_log; + { _logDetail = format ["[processReporter] %1 @ %2",_x,time]; [_logDetail,'A3_EXILE_PROCESSREPORTER'] call SC_fnc_log; @@ -18,4 +27,6 @@ _logDetail = "================================================================== _logDetail = format ["[processReporter] Ended @ %1",time]; -[_logDetail,'A3_EXILE_PROCESSREPORTER'] call SC_fnc_log; \ No newline at end of file +[_logDetail,'A3_EXILE_PROCESSREPORTER'] call SC_fnc_log; + + diff --git a/scripts/functions/fnc_unstick.sqf b/scripts/functions/fnc_unstick.sqf index 5766182..81f7156 100644 --- a/scripts/functions/fnc_unstick.sqf +++ b/scripts/functions/fnc_unstick.sqf @@ -10,6 +10,7 @@ if(isNil "_vehicle") exitWith{}; if(count(crew _vehicle) > 0)then { _vehicleType = TypeOf _vehicle; + _vehicleName = getText (configFile >> "CfgVehicles" >> _vehicleType >> "displayName"); _curPos = position _vehicle; _newPos = _curPos; _oldvehPos = _vehicle getVariable["vehPos",[0,0,0]]; @@ -26,7 +27,7 @@ if(count(crew _vehicle) > 0)then if(time - _engineTime > 10)then { - _logDetail = format ["[OCCUPATION:Unstuck]:: %1 is stuck,attempting to unstick from %2 @ %3",_vehicleType,_curPos,time]; + _logDetail = format ["[OCCUPATION:Unstuck]:: %4 (%1) is stuck,attempting to unstick from %2 @ %3",_vehicleType,_curPos,time,_vehicleName]; [_logDetail] call SC_fnc_log; _vehicle setVariable["engineTime",-1]; @@ -34,38 +35,47 @@ if(count(crew _vehicle) > 0)then _vehicle setVectorUp [0,0,1]; _originalSpawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _radius = 2000; _group = group _vehicle; _vehClass = typeOf _vehicle; if(_vehicle isKindOf "LandVehicle") then { - _tempPos = _curPos findEmptyPosition [0,150,_vehClass]; + _tempLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; + _tempPos = _curPos findEmptyPosition [0,150,_vehClass]; _newPos = [_tempPos select 0, _tempPos select 1, 0]; }; if(_vehicle isKindOf "Ship") then { - _newPos = [_curPos, 5, 100, 3, 2, 20, 0] call BIS_fnc_findSafePos; - _newPos = _curPos; - _vehicle setDamage 0.2; + _tempLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; + _newPos = _curPos; }; if(_vehicle isKindOf "Air") then { - _newPos = _curPos; + _tempLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; + _newPos = _curPos; }; _side = side _group; _group2 = createGroup _side; - _group2 setVariable ["DMS_AllowFreezing",false,true]; - _group2 setVariable ["DMS_LockLocality",nil]; + _group2 setVariable ["DMS_AllowFreezing",false]; + [_group2,false] call DMS_fnc_FreezeToggle; + _group2 setVariable ["DMS_LockLocality",true]; _group2 setVariable ["DMS_SpawnedGroup",true]; _group2 setVariable ["DMS_Group_Side", _side]; [_vehicle] joinSilent _group2; { _unit = _x; - [_unit] joinSilent grpNull; + //[_unit] joinSilent grpNull; [_unit] joinSilent _group2; _unit enableAI "FSM"; _unit enableAI "MOVE"; @@ -75,11 +85,10 @@ if(count(crew _vehicle) > 0)then _GroupLeader = leader (group _vehicle); _GroupLeader doMove _originalSpawnLocation; - [_group2, _originalSpawnLocation, 2000] call bis_fnc_taskPatrol; + [_group2, _originalSpawnLocation, _radius] call bis_fnc_taskPatrol; _group2 setBehaviour "AWARE"; _group2 setCombatMode "RED"; - - _logDetail = format ["[OCCUPATION:Unstuck]:: %1 was stuck and was moved from %2 to %3 resetting patrol around point %5 @ %4",_vehicleType,_curPos,_newPos, time,_originalSpawnLocation]; + _logDetail = format ["[OCCUPATION:Unstuck]:: %6 (%1) was stuck and was moved from %2 to %3 resetting patrol around point %5 @ %4",_vehicleType,_curPos,_newPos, time,_originalSpawnLocation,_vehicleName]; [_logDetail] call SC_fnc_log; }; diff --git a/scripts/occupationMonitor.sqf b/scripts/occupationMonitor.sqf index 68153d9..d11bfe0 100644 --- a/scripts/occupationMonitor.sqf +++ b/scripts/occupationMonitor.sqf @@ -7,23 +7,36 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time]; [_logDetail] call SC_fnc_log; _x setFuel 1; sleep 2; - _originalSpawnLocation = _x getVariable "SC_vehicleSpawnLocation"; + _tempLocation = _x getVariable "SC_vehicleSpawnLocation"; + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; + _pos = position _x; _nearestMarker = [allMapMarkers, _pos] call BIS_fnc_nearestPosition; // Nearest Marker to the Location _posNearestMarker = getMarkerPos _nearestMarker; _group = group _x; _isFrozen = _group getVariable["DMS_isGroupFrozen",false]; - if (!_isFrozen && (_pos distance _posNearestMarker < 750)) then + if (!_isFrozen) then { _GroupLeader = leader (group _x); _GroupLeader doMove _originalSpawnLocation; } else { - _logDetail = format ["[OCCUPATION:Unstick]:: Air: %1 is currently frozen",_x]; - [_logDetail] call SC_fnc_log; - }; + _logDetail = format ["[OCCUPATION:Unstick]:: Air: %1 is currently frozen, resetting DMS_AllowFreezing variable and forcing unfreeze",_x]; + [_logDetail] call SC_fnc_log; + _group setVariable ["DMS_AllowFreezing",false]; + [_group,false] call DMS_fnc_FreezeToggle; + }; + if (_pos distance _posNearestMarker < 750) then + { + _logDetail = format ["[OCCUPATION:Unstick]:: Air: %1 is too close to a map marker, redirecting destination",_x]; + [_logDetail] call SC_fnc_log; + _GroupLeader = leader (group _x); + _GroupLeader doMove _originalSpawnLocation; + } + }forEach SC_liveHelisArray; { @@ -39,8 +52,10 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time]; } else { - _logDetail = format ["[OCCUPATION:Unstick]:: Land: %1 is currently frozen",_x]; - [_logDetail] call SC_fnc_log; + _logDetail = format ["[OCCUPATION:Unstick]:: Land: %1 is currently frozen, resetting DMS_AllowFreezing variable and forcing unfreeze",_x]; + [_logDetail] call SC_fnc_log; + _group setVariable ["DMS_AllowFreezing",false]; + [_group,false] call DMS_fnc_FreezeToggle; }; sleep 2; }forEach SC_liveVehiclesArray; @@ -58,8 +73,10 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time]; } else { - _logDetail = format ["[OCCUPATION:Unstick]:: Sea: %1 is currently frozen",_x]; - [_logDetail] call SC_fnc_log; + _logDetail = format ["[OCCUPATION:Unstick]:: Sea: %1 is currently frozen, resetting DMS_AllowFreezing variable and forcing unfreeze",_x]; + [_logDetail] call SC_fnc_log; + _group setVariable ["DMS_AllowFreezing",false]; + [_group,false] call DMS_fnc_FreezeToggle; }; sleep 2; }forEach SC_liveBoatsArray; diff --git a/scripts/occupationSea.sqf b/scripts/occupationSea.sqf index c2dc96e..d54ad1f 100644 --- a/scripts/occupationSea.sqf +++ b/scripts/occupationSea.sqf @@ -7,6 +7,7 @@ _logDetail = format['[OCCUPATION:Sea] Started']; _currentPlayerCount = count playableUnits; _maxAIcount = SC_maxAIcount; + if(_currentPlayerCount > SC_scaleAI) then { _maxAIcount = _maxAIcount - (_currentPlayerCount - SC_scaleAI) ; @@ -43,11 +44,49 @@ _maxDistance = _middle; for "_i" from 1 to _vehiclesToSpawn do { private["_group"]; - _potentialspawnLocation = [ _spawnCenter, 0, _maxDistance + 500, 25, 2, 1, 1] call BIS_fnc_findSafePos; - _spawnLocation = [_potentialspawnLocation select 0, _potentialspawnLocation select 1,0]; - + + _locationArray = SC_occupyBoatFixedPositions; + // Select the spawn position + _spawnLocation = [0,0,0]; + _radius = 4000; + if(SC_occupyBoatUseFixedPos) then + { + { + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _locationArray = _locationArray - _vehLocation; + }forEach SC_liveBoatsArray; + + if(count _locationArray > 0) then + { + _randomLocation = _locationArray call BIS_fnc_selectRandom; + diag_log format["_randomLocation: %1",_randomLocation]; + _tempLocation = _randomLocation select 0; + _spawnLocation = [_tempLocation select 0, _tempLocation select 1, _tempLocation select 2]; + _radius = _randomLocation select 1; + _locationArray = _locationArray - _randomLocation; + + } + else + { + _potentialspawnLocation = [ _spawnCenter, 0, _maxDistance + 500, 25, 2, 1, 1] call BIS_fnc_findSafePos; + _spawnLocation = [_potentialspawnLocation select 0, _potentialspawnLocation select 1,0]; + _radius = 4000; + }; + } + else + { + _potentialspawnLocation = [ _spawnCenter, 0, _maxDistance + 500, 25, 2, 1, 1] call BIS_fnc_findSafePos; + _spawnLocation = [_potentialspawnLocation select 0, _potentialspawnLocation select 1,0]; + _radius = 4000; + }; + + diag_log format["[OCCUPATION:Sea] found position %1",_spawnLocation]; _group = createGroup SC_BanditSide; - _group setVariable ["DMS_AllowFreezing",false,true]; + _group setVariable ["DMS_AllowFreezing",false]; + [_group,false] call DMS_fnc_FreezeToggle; + _group setVariable ["DMS_LockLocality",true]; + _group setVariable ["DMS_SpawnedGroup",true]; + _group setVariable ["DMS_Group_Side", SC_BanditSide]; _VehicleClass = SC_BoatClassToUse call BIS_fnc_selectRandom; _VehicleClassToUse = _VehicleClass select 0; @@ -71,7 +110,7 @@ for "_i" from 1 to _vehiclesToSpawn do _vehicle setPosASL _spawnLocation; _vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; + _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; // Remove the overpowered weapons from boats _vehicle removeWeaponTurret ["HMG_01",[0]]; @@ -204,7 +243,7 @@ for "_i" from 1 to _vehiclesToSpawn do }; - [_group, _spawnLocation, 4000] call bis_fnc_taskPatrol; + [_group, _spawnLocation, _radius] call bis_fnc_taskPatrol; _group setBehaviour "AWARE"; _group setCombatMode "RED"; _vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"]; diff --git a/scripts/occupationSky.sqf b/scripts/occupationSky.sqf index d8eb201..19211d0 100644 --- a/scripts/occupationSky.sqf +++ b/scripts/occupationSky.sqf @@ -59,18 +59,61 @@ _i = 0; } forEach _locations; + + for "_i" from 1 to _vehiclesToSpawn do { private["_group"]; - _Location = _locations call BIS_fnc_selectRandom; - _pos = position _Location; - _position = [_pos select 0, _pos select 1, 300]; - _safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos; _height = 350 + (round (random 200)); - _spawnLocation = [_safePos select 0, _safePos select 1, _height]; - + _locationArray = SC_occupyHeliFixedPositions; + + // Select the spawn position + _spawnLocation = [0,0,0]; + _radius = 2000; + if(SC_occupyHeliUseFixedPos) then + { + { + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _locationArray = _locationArray - _vehLocation; + }forEach SC_liveHelisArray; + + if(count _locationArray > 0) then + { + _randomLocation = _locationArray call BIS_fnc_selectRandom; + diag_log format["_randomLocation: %1",_randomLocation]; + _tempLocation = _randomLocation select 0; + _spawnLocation = [_tempLocation select 0, _tempLocation select 1, _tempLocation select 2]; + _radius = _randomLocation select 1; + } + else + { + _Location = _locations call BIS_fnc_selectRandom; + _pos = position _Location; + _position = [_pos select 0, _pos select 1, 300]; + _safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos; + _spawnLocation = [_safePos select 0, _safePos select 1, _height]; + _spawnLocation = [_safePos select 0, _safePos select 1, _height]; + _radius = 2000; + }; + } + else + { + _Location = _locations call BIS_fnc_selectRandom; + _pos = position _Location; + _position = [_pos select 0, _pos select 1, 300]; + _safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos; + _spawnLocation = [_safePos select 0, _safePos select 1, _height]; + _spawnLocation = [_safePos select 0, _safePos select 1, _height]; + _radius = 2000; + }; + + diag_log format["[OCCUPATION:Sky] found position %1",_spawnLocation]; _group = createGroup SC_BanditSide; - _group setVariable ["DMS_AllowFreezing",false,true]; + _group setVariable ["DMS_AllowFreezing",false]; + [_group,false] call DMS_fnc_FreezeToggle; + _group setVariable ["DMS_LockLocality",true]; + _group setVariable ["DMS_SpawnedGroup",true]; + _group setVariable ["DMS_Group_Side", SC_BanditSide]; _VehicleClass = SC_HeliClassToUse call BIS_fnc_selectRandom; _VehicleClassToUse = _VehicleClass select 0; @@ -95,7 +138,7 @@ for "_i" from 1 to _vehiclesToSpawn do _group addVehicle _vehicle; _vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; + _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; SC_liveHelis = SC_liveHelis + 1; SC_liveHelisArray = SC_liveHelisArray + [_vehicle]; @@ -176,8 +219,6 @@ for "_i" from 1 to _vehiclesToSpawn do [_unit] joinSilent _group; }foreach units _group; - _group setVariable ["DMS_AllowFreezing",false,true]; - if(SC_extendedLogging && _unitPlaced) then { _logDetail = format['[OCCUPATION:Sky] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation]; @@ -233,7 +274,7 @@ for "_i" from 1 to _vehiclesToSpawn do }; - [_group, _spawnLocation, 2000] call bis_fnc_taskPatrol; + [_group, _spawnLocation, _radius] call bis_fnc_taskPatrol; _group setBehaviour "AWARE"; _group setCombatMode "RED"; _vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"]; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index ee0aebb..bb1dabe 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -79,7 +79,39 @@ if(_vehiclesToSpawn >= 1) then for "_j" from 1 to _vehiclesToSpawn do { private["_group"]; - _spawnLocation = [ true, false ] call SC_fnc_findsafePos; + + _locationArray = SC_occupyVehicleFixedPositions; + + // Select the spawn position + _spawnLocation = [0,0,0]; + _radius = 2000; + if(SC_occupyVehicleUseFixedPos) then + { + { + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _locationArray = _locationArray - _vehLocation; + }forEach SC_liveVehiclesArray; + + if(count _locationArray > 0) then + { + _randomLocation = _locationArray call BIS_fnc_selectRandom; + diag_log format["_randomLocation: %1",_randomLocation]; + _spawnLocation = _randomLocation select 0; + _radius = _randomLocation select 1; + _locationArray = _locationArray - _randomLocation; + } + else + { + _spawnLocation = [ true, false ] call SC_fnc_findsafePos; + _radius = 2000; + }; + } + else + { + _spawnLocation = [ true, false ] call SC_fnc_findsafePos; + _radius = 2000; + }; + diag_log format["[OCCUPATION:Vehicle] found position %1",_spawnLocation]; _group = createGroup SC_BanditSide; if(_side == "survivor") then @@ -87,8 +119,8 @@ if(_vehiclesToSpawn >= 1) then deleteGroup _group; _group = createGroup SC_SurvivorSide; }; - _group setVariable ["DMS_AllowFreezing",false,true]; - _group setVariable ["DMS_LockLocality",nil]; + _group setVariable ["DMS_AllowFreezing",false]; + _group setVariable ["DMS_LockLocality",true]; _group setVariable ["DMS_SpawnedGroup",true]; _group setVariable ["DMS_Group_Side", _side]; @@ -140,7 +172,7 @@ if(_vehiclesToSpawn >= 1) then _vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; + _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; _vehicle setFuel 1; _vehicle engineOn true; @@ -252,6 +284,7 @@ if(_vehiclesToSpawn >= 1) then _unitName = [_side] call SC_fnc_selectName; if(!isNil "_unitName") then { _unit setName _unitName; }; }forEach units _group; + [_group,false] call DMS_fnc_FreezeToggle; [units _group] orderGetIn true; sleep 10;