From 48c160dcb21a3a84a88577c692b92b4a38385810 Mon Sep 17 00:00:00 2001 From: second_coming Date: Fri, 15 Apr 2016 18:06:35 +0100 Subject: [PATCH 1/6] bus fix make the bus stop when you eject so that you don't get run over --- scripts/reactions/getOffBus.sqf | 10 ++++++---- scripts/reactions/getOnBus.sqf | 6 ------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/reactions/getOffBus.sqf b/scripts/reactions/getOffBus.sqf index bbf18ab..7bee72d 100644 --- a/scripts/reactions/getOffBus.sqf +++ b/scripts/reactions/getOffBus.sqf @@ -3,7 +3,9 @@ _bus = _this select 0; _unit = _this select 2; -if(isPlayer _unit) then -{ - _bus removeAction SC_bustop; -}; \ No newline at end of file +_bus setFuel 0; +_busDriver = driver _bus; +_busDriver disableAI "MOVE"; +_bus animateDoor ["Doors_1", 1]; +_bus animateDoor ["Doors_2", 1]; +_bus animateDoor ["Doors_3", 1]; \ No newline at end of file diff --git a/scripts/reactions/getOnBus.sqf b/scripts/reactions/getOnBus.sqf index efc9224..cd06d58 100644 --- a/scripts/reactions/getOnBus.sqf +++ b/scripts/reactions/getOnBus.sqf @@ -3,9 +3,3 @@ _bus = _this select 0; _unit = _this select 2; -if(isPlayer _unit) then -{ - hint "You got on the bus"; - SC_bustop = _bus addAction ["Stop the bus", { SC_StopTheBus = true } ]; -}; - From f6aac5155562f57c79b4f3a0458e1b3d4fb5fa29 Mon Sep 17 00:00:00 2001 From: second_coming Date: Sat, 16 Apr 2016 02:32:48 +0100 Subject: [PATCH 2/6] v21 fixes & tweaks --- config.sqf | 86 +++++++++++++++++------------- initServer.sqf | 22 ++++---- scripts/occupationPlaces.sqf | 5 +- scripts/occupationVehicle.sqf | 6 ++- scripts/reactions/driverKilled.sqf | 4 +- scripts/reactions/unitMPKilled.sqf | 1 - 6 files changed, 70 insertions(+), 54 deletions(-) diff --git a/config.sqf b/config.sqf index 227b486..432118b 100644 --- a/config.sqf +++ b/config.sqf @@ -12,30 +12,32 @@ // Shared Config for each occupation monitor -SC_debug = false; // set to true to turn on debug features (not for live servers) -SC_extendedLogging = false; // set to true for additional logging +SC_debug = false; // set to true to turn on debug features (not for live servers) +SC_extendedLogging = true; // set to true for additional logging 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 -SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn +SC_mapMarkers = true; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false +SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra 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) -SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits +SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits -SC_occupyVehicle = true; // true if you want to have roaming AI vehicles +SC_occupyVehicle = true; // true if you want to have roaming AI vehicles SC_occupyVehiclesLocked = true; // true if AI vehicles to stay locked until all the linked AI are dead +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 + +SC_SurvivorsChance = 33; // 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 = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) -SC_SurvivorsChance = 33; // 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 = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) - -SC_occupyMilitary = true; // true if you want military buildings patrolled (specify which types of building below) +SC_occupyMilitary = false; // true if you want military buildings patrolled (specify which types of building below) SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F", "Land_Airport_Tower_F","Land_Cargo_House_V1_F", @@ -68,31 +70,31 @@ SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F", ]; -SC_occupyStatic = true; // true if you want to garrison AI in specific locations +SC_occupyStatic = false; // true if you want to garrison AI in specific locations -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_occupySky = true; // true if you want to have roaming AI helis +SC_occupySea = false; // true if you want to have roaming AI boats SC_occupyPublicBus = true; // true if you want a roaming bus service -SC_occupyPublicBusClass = "Exile_Car_Ikarus_Party"; // class name for the vehicle to use as the public bus +SC_occupyPublicBusClass = "Exile_Car_Ikarus_Party"; // class name for the vehicle to use as the public bus SC_occupyLootCrates = true; // true if you want to have random loot crates with guards -SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk) -SC_LootCrateGuards = 4; // number of AI to spawn at each crate -SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards) -SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns +SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk) +SC_LootCrateGuards = 4; // number of AI to spawn at each crate +SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards) +SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns -SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes -SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk) +SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes +SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk) -SC_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings] +SC_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings] // Settings for roaming ground vehicle AI SC_maxNumberofVehicles = 4; -SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; +SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; // Settings for roaming airborne AI (non armed helis will just fly around) SC_maxNumberofHelis = 1; @@ -108,25 +110,33 @@ SC_BoatClassToUse = [ "B_Boat_Armed_01_minigun_F","I_Boat_Armed_01_minigun if (worldName == 'Namalsk') then { SC_maxAIcount = 80; - SC_occupySky = false; + SC_occupySky = false; SC_maxNumberofVehicles = 2; - SC_numberofLootCrates = 3; - SC_numberofHeliCrashes = 2; + SC_numberofLootCrates = 3; + SC_numberofHeliCrashes = 2; SC_maxNumberofBoats = 1; - SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk + SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk }; -// Don't alter anything below this point -SC_SurvivorSide = CIVILIAN; -SC_BanditSide = EAST; -SC_liveVehicles = 0; -SC_liveVehiclesArray = []; -SC_liveHelis = 0; -SC_liveHelisArray = []; -SC_liveBoats = 0; -SC_liveBoatsArray = []; -SC_publicBusArray = []; -SC_StopTheBus = false; +// Don't alter anything below this point, unless you want your server to explode :) +if(!SC_SurvivorsFriendly) then +{ + CIVILIAN setFriend[RESISTANCE,0]; + CIVILIAN setFriend[EAST,0]; + CIVILIAN setFriend[WEST,0]; + EAST setFriend[CIVILIAN,0]; + WEST setFriend[CIVILIAN,0]; +}; +SC_SurvivorSide = CIVILIAN; +SC_BanditSide = EAST; +SC_liveVehicles = 0; +SC_liveVehiclesArray = []; +SC_liveHelis = 0; +SC_liveHelisArray = []; +SC_liveBoats = 0; +SC_liveBoatsArray = []; +SC_publicBusArray = []; +SC_StopTheBus = false; publicVariable "SC_liveVehicles"; publicVariable "SC_liveVehiclesArray"; diff --git a/initServer.sqf b/initServer.sqf index f6f9d70..e1a32bd 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v20 (15-04-2016)"; +SC_occupationVersion = "v21 (16-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // @@ -34,19 +34,19 @@ SC_occupationVersion = "v20 (15-04-2016)"; SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf"; // EventHandlers for AI reactions & player interactions - SC_fnc_repairVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\repairVehicle.sqf"; - SC_fnc_vehicleDestroyed = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\vehicleDestroyed.sqf"; - SC_fnc_reactUnit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\reactUnit.sqf"; - SC_fnc_driverKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\driverKilled.sqf"; + SC_fnc_repairVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\repairVehicle.sqf"; + SC_fnc_vehicleDestroyed = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\vehicleDestroyed.sqf"; + SC_fnc_reactUnit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\reactUnit.sqf"; + SC_fnc_driverKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\driverKilled.sqf"; SC_fnc_airHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\airHit.sqf"; SC_fnc_boatHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\boatHit.sqf"; - SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getIn.sqf"; - SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.sqf"; - SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf"; - SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf"; - SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf"; + SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getIn.sqf"; + SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.sqf"; + SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf"; + SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf"; + SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf"; SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf"; - SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf"; + SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf"; _logDetail = "============================================================================================================="; [_logDetail] call SC_fnc_log; diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index e893d7e..0137605 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -192,6 +192,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; + _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; _unit forceAddUniform "Exile_Uniform_BambiOverall"; if(SC_debug) then @@ -289,6 +290,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; + _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; _unit forceAddUniform "Exile_Uniform_BambiOverall"; if(SC_debug) then @@ -321,16 +323,17 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _marker setMarkerType "mil_dot"; _marker setMarkerBrush "Solid"; _marker setMarkerAlpha 0.5; - _marker setMarkerColor "ColorOrange"; _marker setMarkerText "Occupied Area"; }; if(_side == "survivor") then { + _marker setMarkerColor "ColorGreen"; _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; } else { + _marker setMarkerColor "ColorOrange"; _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; }; [_logDetail] call SC_fnc_log; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index b2bd654..f38af2c 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -158,6 +158,8 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Driver") then { _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit removeAllMPEventHandlers "mphit"; + _unit removeAllMPEventHandlers "mpkilled"; _unit disableAI "FSM"; if(_side == "survivor") then { @@ -192,6 +194,7 @@ if(_vehiclesToSpawn >= 1) then if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; + _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; _unit forceAddUniform "Exile_Uniform_BambiOverall"; }; @@ -205,11 +208,12 @@ if(_vehiclesToSpawn >= 1) then if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; + _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; _unit forceAddUniform "Exile_Uniform_BambiOverall"; }; _unit assignAsCargo _vehicle; - _unit moveInCargo _vehicle; + _unit moveInCargo [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; diff --git a/scripts/reactions/driverKilled.sqf b/scripts/reactions/driverKilled.sqf index 9b8ebb8..eeda02e 100644 --- a/scripts/reactions/driverKilled.sqf +++ b/scripts/reactions/driverKilled.sqf @@ -8,10 +8,9 @@ if(SC_extendedLogging) then }; _deadDriver = _this select 0; -_deadDriver removeAllMPEventHandlers "mpkilled"; +//_deadDriver removeAllMPEventHandlers "mpkilled"; _vehicle = _deadDriver getVariable "SC_drivenVehicle"; - if(SC_debug) then { { detach _x; deleteVehicle _x; } forEach attachedObjects _deadDriver; @@ -48,6 +47,7 @@ if(count units _group > 0) then _driver setVariable ["SC_drivenVehicle", _vehicle,true]; _vehicle setVariable ["SC_assignedDriver", _driver,true]; _vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"]; + _driver removeAllMPEventHandlers "mpkilled"; _driver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"]; if(SC_debug) then diff --git a/scripts/reactions/unitMPKilled.sqf b/scripts/reactions/unitMPKilled.sqf index 8b2ef57..b32e088 100644 --- a/scripts/reactions/unitMPKilled.sqf +++ b/scripts/reactions/unitMPKilled.sqf @@ -4,7 +4,6 @@ _killer = _this select 1; // remove all eventhandlers from the dead unit _unit removeAllMPEventHandlers "mphit"; -_unit removeAllMPEventHandlers "mpkilled"; if(SC_debug) then { From fb3a0de122212c2e521dca88a8251653daa032cc Mon Sep 17 00:00:00 2001 From: second_coming Date: Sat, 16 Apr 2016 20:12:56 +0100 Subject: [PATCH 3/6] v22 fixes --- config.sqf | 72 +++++++++++++++++------------------ initServer.sqf | 12 +++--- scripts/occupationPlaces.sqf | 22 +++++------ scripts/occupationVehicle.sqf | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/config.sqf b/config.sqf index 432118b..05db6b9 100644 --- a/config.sqf +++ b/config.sqf @@ -12,32 +12,32 @@ // Shared Config for each occupation monitor -SC_debug = false; // set to true to turn on debug features (not for live servers) -SC_extendedLogging = true; // set to true for additional logging +SC_debug = false; // set to true to turn on debug features (not for live servers) +SC_extendedLogging = true; // set to true for additional logging 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 = true; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false -SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn +SC_mapMarkers = true; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false +SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra 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) -SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits +SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits -SC_occupyVehicle = true; // true if you want to have roaming AI vehicles +SC_occupyVehicle = true; // true if you want to have roaming AI vehicles SC_occupyVehiclesLocked = true; // true if AI vehicles to stay locked until all the linked AI are dead -SC_SurvivorsFriendly = true; // true if you want survivors to be friendly to players (until they are attacked by players) +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 -SC_SurvivorsChance = 33; // 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 = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) +SC_SurvivorsChance = 33; // 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 = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) -SC_occupyMilitary = false; // true if you want military buildings patrolled (specify which types of building below) +SC_occupyMilitary = false; // true if you want military buildings patrolled (specify which types of building below) SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F", "Land_Airport_Tower_F","Land_Cargo_House_V1_F", @@ -70,31 +70,31 @@ SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F", ]; -SC_occupyStatic = false; // true if you want to garrison AI in specific locations +SC_occupyStatic = false; // true if you want to garrison AI in specific locations -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_occupySky = true; // true if you want to have roaming AI helis +SC_occupySea = false; // true if you want to have roaming AI boats SC_occupyPublicBus = true; // true if you want a roaming bus service SC_occupyPublicBusClass = "Exile_Car_Ikarus_Party"; // class name for the vehicle to use as the public bus SC_occupyLootCrates = true; // true if you want to have random loot crates with guards -SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk) -SC_LootCrateGuards = 4; // number of AI to spawn at each crate -SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards) -SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns +SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk) +SC_LootCrateGuards = 4; // number of AI to spawn at each crate +SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards) +SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns -SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes -SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk) +SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes +SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk) -SC_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings] +SC_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings] // Settings for roaming ground vehicle AI SC_maxNumberofVehicles = 4; -SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; +SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; // Settings for roaming airborne AI (non armed helis will just fly around) SC_maxNumberofHelis = 1; @@ -110,12 +110,12 @@ SC_BoatClassToUse = [ "B_Boat_Armed_01_minigun_F","I_Boat_Armed_01_minigun if (worldName == 'Namalsk') then { SC_maxAIcount = 80; - SC_occupySky = false; + SC_occupySky = false; SC_maxNumberofVehicles = 2; - SC_numberofLootCrates = 3; - SC_numberofHeliCrashes = 2; + SC_numberofLootCrates = 3; + SC_numberofHeliCrashes = 2; SC_maxNumberofBoats = 1; - SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk + SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk }; // Don't alter anything below this point, unless you want your server to explode :) @@ -127,16 +127,16 @@ if(!SC_SurvivorsFriendly) then EAST setFriend[CIVILIAN,0]; WEST setFriend[CIVILIAN,0]; }; -SC_SurvivorSide = CIVILIAN; -SC_BanditSide = EAST; -SC_liveVehicles = 0; -SC_liveVehiclesArray = []; -SC_liveHelis = 0; -SC_liveHelisArray = []; -SC_liveBoats = 0; -SC_liveBoatsArray = []; -SC_publicBusArray = []; -SC_StopTheBus = false; +SC_SurvivorSide = CIVILIAN; +SC_BanditSide = EAST; +SC_liveVehicles = 0; +SC_liveVehiclesArray = []; +SC_liveHelis = 0; +SC_liveHelisArray = []; +SC_liveBoats = 0; +SC_liveBoatsArray = []; +SC_publicBusArray = []; +SC_StopTheBus = false; publicVariable "SC_liveVehicles"; publicVariable "SC_liveVehiclesArray"; diff --git a/initServer.sqf b/initServer.sqf index e1a32bd..e4c0c50 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v21 (16-04-2016)"; +SC_occupationVersion = "v22 (16-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // @@ -31,21 +31,21 @@ SC_occupationVersion = "v21 (16-04-2016)"; call compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\config.sqf"; // Select the log style depending on config settings - SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf"; + SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf"; // EventHandlers for AI reactions & player interactions SC_fnc_repairVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\repairVehicle.sqf"; SC_fnc_vehicleDestroyed = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\vehicleDestroyed.sqf"; SC_fnc_reactUnit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\reactUnit.sqf"; SC_fnc_driverKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\driverKilled.sqf"; - SC_fnc_airHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\airHit.sqf"; - SC_fnc_boatHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\boatHit.sqf"; + SC_fnc_airHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\airHit.sqf"; + SC_fnc_boatHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\boatHit.sqf"; SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getIn.sqf"; SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.sqf"; SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf"; SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf"; - SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf"; - SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf"; + SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf"; + SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf"; SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf"; _logDetail = "============================================================================================================="; diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index 0137605..35900ee 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -324,18 +324,18 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _marker setMarkerBrush "Solid"; _marker setMarkerAlpha 0.5; _marker setMarkerText "Occupied Area"; + + if(_side == "survivor") then + { + _marker setMarkerColor "ColorGreen"; + _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; + } + else + { + _marker setMarkerColor "ColorOrange"; + _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; + }; }; - - if(_side == "survivor") then - { - _marker setMarkerColor "ColorGreen"; - _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; - } - else - { - _marker setMarkerColor "ColorOrange"; - _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; - }; [_logDetail] call SC_fnc_log; _okToSpawn = false; }; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index f38af2c..4872519 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -213,7 +213,7 @@ if(_vehiclesToSpawn >= 1) then _unit forceAddUniform "Exile_Uniform_BambiOverall"; }; _unit assignAsCargo _vehicle; - _unit moveInCargo [_vehicle, _vehicleSeat]; + _unit moveInCargo _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; From 560dba02ff949d9bafe2c3687b1f173a3ceb9866 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 18 Apr 2016 14:01:41 +0100 Subject: [PATCH 4/6] v23 fixes & changes --- config.sqf | 106 ++++++++++++++++++++++++------ initServer.sqf | 2 +- scripts/occupationHeliCrashes.sqf | 46 +++++++++---- scripts/occupationLootCrates.sqf | 48 +++++++++----- scripts/occupationPlaces.sqf | 54 ++++++++++----- scripts/occupationPublicBus.sqf | 9 --- scripts/occupationSea.sqf | 14 ++-- scripts/occupationSky.sqf | 22 ++++--- scripts/occupationVehicle.sqf | 26 ++++++-- 9 files changed, 232 insertions(+), 95 deletions(-) diff --git a/config.sqf b/config.sqf index 05db6b9..67e2903 100644 --- a/config.sqf +++ b/config.sqf @@ -12,33 +12,37 @@ // Shared Config for each occupation monitor -SC_debug = false; // set to true to turn on debug features (not for live servers) -SC_extendedLogging = true; // set to true for additional logging + +SC_debug = false; // set to true to turn on debug features (not for live servers) +SC_extendedLogging = false; // set to true for additional logging 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 = true; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false +SC_mapMarkers = false; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn - SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra 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) +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) SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits SC_occupyVehicle = true; // true if you want to have roaming AI vehicles SC_occupyVehiclesLocked = true; // true if AI vehicles to stay locked until all the linked AI are dead -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 + SC_SurvivorsChance = 33; // 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 = true; // 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 -SC_occupyMilitary = false; // true if you want military buildings patrolled (specify which types of building below) +// Array of uniforms for survivor AI to use +SC_SurvivorUniforms = ["Exile_Uniform_BambiOverall"]; + +SC_occupyMilitary = false; // true if you want military buildings patrolled + +// 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", "Land_Cargo_House_V3_F","Land_Cargo_HQ_V1_F", @@ -84,29 +88,79 @@ SC_LootCrateGuards = 4; // number of AI to spawn at SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards) SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns +// Array of possible common items to go in loot crates ["classname",fixed amount,random amount] +// ["Exile_Item_Matches",1,2] this example would add between 1 and 3 Exile_Item_Matches to the crate (1 + 0 to 2 more) +// to add a fixed amount make the second number 0 +SC_LootCrateItems = [ + ["Exile_Melee_Axe",1,0], + ["Exile_Item_GloriousKnakworst",1,2], + ["Exile_Item_PlasticBottleFreshWater",1,2], + ["Exile_Item_Beer",5,1], + ["Exile_Item_BaseCameraKit",0,2], + ["Exile_Item_InstaDoc",1,1], + ["Exile_Item_Matches",1,0], + ["Exile_Item_CookingPot",1,0], + ["Exile_Item_MetalPole",1,0], + ["Exile_Item_LightBulb",1,0], + ["Exile_Item_FuelCanisterEmpty",1,0], + ["Exile_Item_WoodPlank",1,8], + ["Exile_Item_woodFloorKit",1,2], + ["Exile_Item_WoodWindowKit",1,1], + ["Exile_Item_WoodDoorwayKit",1,1], + ["Exile_Item_WoodFloorPortKit",1,2], + ["Exile_Item_Laptop",0,1], + ["Exile_Item_CodeLock",0,1] + ]; + SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk) +// 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 = [ + ["HandGrenade",0,2], + ["APERSBoundingMine_Range_Mag",0,2], + ["B_Parachute",1,1], + ["H_CrewHelmetHeli_B",1,1], + ["ItemGPS",0,1], + ["Exile_Item_InstaDoc",0,1], + ["Exile_Item_PlasticBottleFreshWater",2,2], + ["Exile_Item_EMRE",2,2] + ]; +// Array of possible weapons to place in the crate +SC_HeliCrashWeapons = ["srifle_DMR_02_camo_F","srifle_DMR_03_woodland_F","srifle_DMR_04_F","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_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings] +SC_maximumCrewAmount = 2; // Maximum amount of AI allowed in a vehicle + // (essential crew like drivers and gunners will always spawn regardless of this setting) // Settings for roaming ground vehicle AI -SC_maxNumberofVehicles = 4; +SC_maxNumberofVehicles = 4; + +// Array of ground vehicles which can be used by AI patrols SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; // Settings for roaming airborne AI (non armed helis will just fly around) SC_maxNumberofHelis = 1; + +// Array of aircraft which can be used by AI patrols SC_HeliClassToUse = [ "Exile_Chopper_Huey_Armed_Green"]; // Settings for roaming seaborne AI (non armed boats will just sail around) SC_maxNumberofBoats = 1; + +// Array of boats which can be used by AI patrols SC_BoatClassToUse = [ "B_Boat_Armed_01_minigun_F","I_Boat_Armed_01_minigun_F","O_Boat_Transport_01_F","Exile_Boat_MotorBoat_Police" ]; -// AI Custom Loadouts - // namalsk specific settings + +// namalsk specific settings (if you want to override settings for specific maps if you run multiple servers) if (worldName == 'Namalsk') then { SC_maxAIcount = 80; @@ -118,15 +172,31 @@ if (worldName == 'Namalsk') then SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk }; +if (SC_debug) then +{ + SC_extendedLogging = true; + SC_mapMarkers = true; + SC_occupyPlaces = true; + SC_occupyVehicle = true; + SC_occupyMilitary = true; + SC_occupyStatic = true; + SC_occupySky = true; + SC_occupySea = true; + SC_occupyPublicBus = true; + SC_occupyLootCrates = true; + SC_occupyHeliCrashes = true; +}; + // Don't alter anything below this point, unless you want your server to explode :) if(!SC_SurvivorsFriendly) then { CIVILIAN setFriend[RESISTANCE,0]; - CIVILIAN setFriend[EAST,0]; - CIVILIAN setFriend[WEST,0]; - EAST setFriend[CIVILIAN,0]; - WEST setFriend[CIVILIAN,0]; }; +CIVILIAN setFriend[EAST,0]; +CIVILIAN setFriend[WEST,0]; +EAST setFriend[CIVILIAN,0]; +WEST setFriend[CIVILIAN,0]; + SC_SurvivorSide = CIVILIAN; SC_BanditSide = EAST; SC_liveVehicles = 0; @@ -136,7 +206,6 @@ SC_liveHelisArray = []; SC_liveBoats = 0; SC_liveBoatsArray = []; SC_publicBusArray = []; -SC_StopTheBus = false; publicVariable "SC_liveVehicles"; publicVariable "SC_liveVehiclesArray"; @@ -146,6 +215,5 @@ publicVariable "SC_liveBoats"; publicVariable "SC_liveBoatsArray"; publicVariable "SC_numberofLootCrates"; publicVariable "SC_publicBusArray"; -publicVariable "SC_StopTheBus"; publicVariable "SC_SurvivorSide"; publicVariable "SC_BanditSide"; \ No newline at end of file diff --git a/initServer.sqf b/initServer.sqf index e4c0c50..792f7f8 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v22 (16-04-2016)"; +SC_occupationVersion = "v23 (18-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // diff --git a/scripts/occupationHeliCrashes.sqf b/scripts/occupationHeliCrashes.sqf index 4881f9e..c1c71d8 100644 --- a/scripts/occupationHeliCrashes.sqf +++ b/scripts/occupationHeliCrashes.sqf @@ -47,26 +47,48 @@ for "_i" from 1 to SC_numberofHeliCrashes do _box enableRopeAttach false; _box setVariable ["permaLoot",true]; _box allowDamage false; - _box addMagazineCargoGlobal ["HandGrenade", (random 2)]; - _box addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag", (random 2)]; - _box addBackpackCargoGlobal ["B_Parachute", 1 + (random 1)]; - _box addItemCargoGlobal ["H_CrewHelmetHeli_B", 1 + (random 1)]; - _box addItemCargoGlobal ["U_B_HeliPilotCoveralls", 1 + (random 1)]; - _box addItemCargoGlobal ["ItemGPS", (random 1)]; - _box addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)]; - _box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)]; - _box addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)]; + + { + _item = _x select 0; + _amount = _x select 1; + _randomAmount = _x select 2; + _amount = _amount + (random _randomAmount); + _itemType = _x call BIS_fnc_itemType; + + + if((_itemType select 0) == "Weapon") then + { + _box addWeaponCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Magazine") then + { + _box addMagazineCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Item") then + { + _box addItemCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Equipment") then + { + _box addItemCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Backpack") then + { + _box addBackpackCargoGlobal [_item, _amount]; + }; + }forEach SC_HeliCrashItems; // Add weapons with ammo to the Box - _possibleWeapons = ["srifle_DMR_02_camo_F","srifle_DMR_03_woodland_F","srifle_DMR_04_F","srifle_DMR_05_hex_F"]; - _amountOfWeapons = 1 + (random 3); - + _possibleWeapons = SC_HeliCrashWeapons; + _amountOfWeapons = (SC_HeliCrashWeaponsAmount select 0) + round random (SC_HeliCrashWeaponsAmount select 1); + for "_i" from 1 to _amountOfWeapons do { _weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom; _box addWeaponCargoGlobal [_weaponToAdd,1]; _magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines"); + _magazineAmount = (SC_HeliCrashMagazinesAmount select 0) + round random (SC_HeliCrashMagazinesAmount select 1); _box addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 5]; }; diff --git a/scripts/occupationLootCrates.sqf b/scripts/occupationLootCrates.sqf index 4e53621..7c185bd 100644 --- a/scripts/occupationLootCrates.sqf +++ b/scripts/occupationLootCrates.sqf @@ -80,22 +80,34 @@ for "_i" from 1 to SC_numberofLootCrates do _box setVariable ["permaLoot",true]; // Crate stays until next server restart _box allowDamage false; // Stop crates taking damage - _box addItemCargoGlobal ["Exile_Melee_Axe", 1]; - _box addItemCargoGlobal ["Exile_Item_GloriousKnakworst", 1 + (random 2)]; - _box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 1 + (random 2)]; - _box addItemCargoGlobal ["Exile_Item_Beer", 5 + (random 1)]; - _box addItemCargoGlobal ["Exile_Item_Laptop", (random 1)]; - _box addItemCargoGlobal ["Exile_Item_BaseCameraKit", (random 2)]; - _box addItemCargoGlobal ["Exile_Item_InstaDoc", 1 + (random 1)]; - _box addItemCargoGlobal ["Exile_Item_Matches", 1]; - _box addItemCargoGlobal ["Exile_Item_CookingPot", 1]; - _box addItemCargoGlobal ["Exile_Item_CodeLock", (random 1)]; - _box addItemCargoGlobal ["Exile_Item_MetalPole", 1]; - _box addItemCargoGlobal ["Exile_Item_LightBulb", 1]; - _box addItemCargoGlobal ["Exile_Item_FuelCanisterEmpty", 1]; - _box addItemCargoGlobal ["Exile_Item_WoodPlank", 1 + (random 8)]; - _box addItemCargoGlobal ["Exile_Item_woodFloorKit", 1 + (random 2)]; - _box addItemCargoGlobal ["Exile_Item_WoodWindowKit", 1 + (random 1)]; - _box addItemCargoGlobal ["Exile_Item_WoodDoorwayKit", 1 + (random 1)]; - _box addItemCargoGlobal ["Exile_Item_WoodFloorPortKit", 1 + (random 2)]; + { + _item = _x select 0; + _amount = _x select 1; + _randomAmount = _x select 2; + _amount = _amount + (random _randomAmount); + _itemType = _x call BIS_fnc_itemType; + + + if((_itemType select 0) == "Weapon") then + { + _box addWeaponCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Magazine") then + { + _box addMagazineCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Item") then + { + _box addItemCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Equipment") then + { + _box addItemCargoGlobal [_item, _amount]; + }; + if((_itemType select 0) == "Backpack") then + { + _box addBackpackCargoGlobal [_item, _amount]; + }; + }forEach SC_LootCrateItems; + }; \ No newline at end of file diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index 35900ee..3b8a9f1 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -127,7 +127,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi } else { - if(_nearBanditAI == 0 AND _nearSurvivorAI == 0) then + if(_nearSurvivorAI == 0) then { _sideToSpawn = random 100; if(_sideToSpawn <= SC_SurvivorsChance) then @@ -141,14 +141,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi } else { - if(_nearSurvivorAI == 0) then - { - _side = "survivor"; - } - else - { - _side = "bandit"; - }; + _side = "bandit"; }; }; @@ -194,7 +187,8 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; - _unit forceAddUniform "Exile_Uniform_BambiOverall"; + _survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom; + _unit forceAddUniform _survivorUniform; if(SC_debug) then { _tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"]; @@ -292,7 +286,8 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; - _unit forceAddUniform "Exile_Uniform_BambiOverall"; + _survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom; + _unit forceAddUniform _survivorUniform; if(SC_debug) then { _tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"]; @@ -314,29 +309,54 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _group2 setCombatMode "RED"; }; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + _markerName = "Occupation Area"; + _markerColour = "ColorOrange"; if(SC_mapMarkers) then { - _marker = createMarker [format ["%1", _spawnPosition],_pos]; + deleteMarker format ["%1", _spawnPosition]; + _nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits; + _nearSurvivorAI = { side _x == SC_SurvivorSide AND _x distance _pos < 500 } count allUnits; + + if(_nearBanditAI > 0 && _nearSurvivorAI > 0) then + { + _markerName = "Survivors and Bandits"; + _markerColour = "ColorOrange"; + }; + if(_nearBanditAI == 0 && _nearSurvivorAI > 0) then + { + _markerName = "Survivors"; + _markerColour = "ColorGreen"; + }; + if(_nearBanditAI > 0 && _nearSurvivorAI == 0) then + { + _markerName = "Bandits"; + _markerColour = "ColorRed"; + }; + + _marker = createMarker [format ["%1", _spawnPosition],_pos]; _marker setMarkerShape "Icon"; _marker setMarkerSize [3,3]; _marker setMarkerType "mil_dot"; _marker setMarkerBrush "Solid"; + _marker setMarkerText _markerName; + _marker setMarkerColor _markerColour; _marker setMarkerAlpha 0.5; - _marker setMarkerText "Occupied Area"; + if(_side == "survivor") then { - _marker setMarkerColor "ColorGreen"; _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; } else { - _marker setMarkerColor "ColorOrange"; _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; }; - }; - [_logDetail] call SC_fnc_log; + [_logDetail] call SC_fnc_log; + _logDetail = format ["[OCCUPATION:Places]:: %1 Bandits:%2 Survivors:%3 Marker Colour:%4 Marker Name:%5",_locationName,_nearBanditAI,_nearSurvivorAI,_markerColour,_markerName]; + [_logDetail] call SC_fnc_log; + }; _okToSpawn = false; }; diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 17f0029..728fa34 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -116,15 +116,6 @@ while {true} do busDriver enableAI "MOVE"; if(!Alive busDriver) exitWith {}; }; - - if(SC_StopTheBus) then - { - uiSleep 0.5; - _publicBus setFuel 0; - busDriver disableAI "MOVE"; - uiSleep 5; - SC_StopTheBus = false; - }; uiSleep 5; }; diff --git a/scripts/occupationSea.sqf b/scripts/occupationSea.sqf index 7542507..7e2c90b 100644 --- a/scripts/occupationSea.sqf +++ b/scripts/occupationSea.sqf @@ -71,6 +71,8 @@ for "_i" from 1 to _vehiclesToSpawn do sleep 0.2; _group addVehicle _vehicle; + _amountOfCrew = 0; + _unitPlaced = false; // Calculate the crew requried _vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles; @@ -80,7 +82,8 @@ for "_i" from 1 to _vehiclesToSpawn do _vehicleSeat = _x select 1; if(_vehicleRole == "Driver") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit assignAsDriver _vehicle; _unit moveInDriver _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; @@ -88,19 +91,22 @@ for "_i" from 1 to _vehiclesToSpawn do }; if(_vehicleRole == "Turret") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit moveInTurret [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; - if(_vehicleRole == "CARGO") then + if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; + if(SC_extendedLogging && _unitPlaced) then { _logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle]; diff --git a/scripts/occupationSky.sqf b/scripts/occupationSky.sqf index b2038e6..5abf00f 100644 --- a/scripts/occupationSky.sqf +++ b/scripts/occupationSky.sqf @@ -90,39 +90,47 @@ for "_i" from 1 to _vehiclesToSpawn do _vehicle setVariable ["ExileIsLocked", 0, true]; _vehicle action ["LightOn", _vehicle]; - + _amountOfCrew = 0; + _unitPlaced = false; // Calculate the crew requried _vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles; { - _vehicleRole = _x select 0; + _unitPlaced = false; + _vehicleRole = _x select 0; _vehicleSeat = _x select 1; if(_vehicleRole == "Driver") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit assignAsDriver _vehicle; _unit moveInDriver _vehicle; //_vehicle lockDriver true; _unit setVariable ["DMS_AssignedVeh",_vehicle]; removeBackpackGlobal _unit; _unit addBackpackGlobal "B_Parachute"; + _unitPlaced = true; }; if(_vehicleRole == "Turret") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit moveInTurret [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; removeBackpackGlobal _unit; _unit addBackpackGlobal "B_Parachute"; + _unitPlaced = true; }; - if(_vehicleRole == "CARGO") then + if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then { _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; removeBackpackGlobal _unit; _unit addBackpackGlobal "B_Parachute"; + _unitPlaced = true; }; if(SC_extendedLogging) then { @@ -137,13 +145,11 @@ for "_i" from 1 to _vehiclesToSpawn do [_unit] joinSilent _group; }foreach units _group; - if(SC_infiSTAR_log) then + if(SC_extendedLogging && _unitPlaced) then { _logDetail = format['[OCCUPATION:Sky] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation]; [_logDetail] call SC_fnc_log; }; - - clearMagazineCargoGlobal _vehicle; clearWeaponCargoGlobal _vehicle; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index 4872519..7cce0ae 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -149,6 +149,9 @@ if(_vehiclesToSpawn >= 1) then _vehicle limitSpeed 60; _vehicle action ["LightOn", _vehicle]; + _amountOfCrew = 0; + _unitPlaced = false; + // Calculate the crew requried _vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles; { @@ -158,13 +161,16 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Driver") then { _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; _unit removeAllMPEventHandlers "mphit"; _unit removeAllMPEventHandlers "mpkilled"; _unit disableAI "FSM"; if(_side == "survivor") then { removeUniform _unit; - _unit forceAddUniform "Exile_Uniform_BambiOverall"; + sleep 0.1; + _survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom; + _unit forceAddUniform _survivorUniform; }; _unit disableAI "TARGET"; _unit disableAI "AUTOTARGET"; @@ -188,29 +194,35 @@ if(_vehiclesToSpawn >= 1) then _vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"]; _vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"]; }; - if(_vehicleRole == "Turret") then + if(_vehicleRole == "Turret" && _amountOfCrew <= SC_maximumCrewAmount) then { - _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; - _unit forceAddUniform "Exile_Uniform_BambiOverall"; + sleep 0.1; + _survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom; + _unit forceAddUniform _survivorUniform; }; _unit moveInTurret [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; - if(_vehicleRole == "CARGO") then + if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then { - _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier; + _amountOfCrew = _amountOfCrew + 1; if(_side == "survivor") then { _unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"]; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"]; removeUniform _unit; - _unit forceAddUniform "Exile_Uniform_BambiOverall"; + sleep 0.1; + _survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom; + _unit forceAddUniform _survivorUniform; }; _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; From 71cd1d9f0c46fa37cf039a1393c80f56a7e9d583 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 18 Apr 2016 15:12:54 +0100 Subject: [PATCH 5/6] v23 changes & fixes --- config.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.sqf b/config.sqf index 67e2903..cc3c6cd 100644 --- a/config.sqf +++ b/config.sqf @@ -144,7 +144,7 @@ SC_maximumCrewAmount = 2; // Maximum amount of AI allo SC_maxNumberofVehicles = 4; // Array of ground vehicles which can be used by AI patrols -SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"]; +SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_UAZ_Open_Green"]; // Settings for roaming airborne AI (non armed helis will just fly around) SC_maxNumberofHelis = 1; From b4e36888f207525f9f6d71693051ad13b494f89a Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 18 Apr 2016 20:34:50 +0100 Subject: [PATCH 6/6] v24 fixes & tweaks --- $PBOPREFIX$ | 1 + PboPrefix.txt | 1 + initServer.sqf | 2 +- scripts/occupationLog.sqf | 2 +- scripts/occupationPublicBus.sqf | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 $PBOPREFIX$ create mode 100644 PboPrefix.txt diff --git a/$PBOPREFIX$ b/$PBOPREFIX$ new file mode 100644 index 0000000..ae0dac7 --- /dev/null +++ b/$PBOPREFIX$ @@ -0,0 +1 @@ +x\addons\a3_exile_occupation \ No newline at end of file diff --git a/PboPrefix.txt b/PboPrefix.txt new file mode 100644 index 0000000..ae0dac7 --- /dev/null +++ b/PboPrefix.txt @@ -0,0 +1 @@ +x\addons\a3_exile_occupation \ No newline at end of file diff --git a/initServer.sqf b/initServer.sqf index 792f7f8..bd83bb3 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v23 (18-04-2016)"; +SC_occupationVersion = "v24 (18-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // diff --git a/scripts/occupationLog.sqf b/scripts/occupationLog.sqf index a0ceb28..40c5f7e 100644 --- a/scripts/occupationLog.sqf +++ b/scripts/occupationLog.sqf @@ -2,7 +2,7 @@ _logDetail = _this select 0; -if(SC_infiSTAR_log) then +if(SC_infiSTAR_log && !isNil "INFISTARVERSION") then { ['A3_EXILE_OCCUPATION',_logDetail] call FNC_A3_CUSTOMLOG; } diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 728fa34..e6784d4 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -36,6 +36,7 @@ busDriver setCaptive true; _publicBus = createVehicle [SC_occupyPublicBusClass, _spawnLocation, [], 0, "CAN_COLLIDE"]; SC_publicBusArray = SC_publicBusArray + [_publicBus]; _publicBus setVariable ["SC_assignedDriver", busDriver,true]; +_publicBus setVariable ["SC_publicBus", true,true]; _publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; _publicBus addEventHandler ["getin", "_this call SC_fnc_getOnBus;"]; _publicBus addEventHandler ["getout", "_this call SC_fnc_getOffBus;"];