From f6aac5155562f57c79b4f3a0458e1b3d4fb5fa29 Mon Sep 17 00:00:00 2001 From: second_coming Date: Sat, 16 Apr 2016 02:32:48 +0100 Subject: [PATCH] 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 {