From d7fbd39a4be286a54944900ba473437962233e9b Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 13:59:33 +0100 Subject: [PATCH 1/7] public bus service added bug fix: attempt to sort the issue where AI groups kill each other on spawning --- config.sqf | 10 +-- scripts/occupationMilitary.sqf | 6 ++ scripts/occupationMonitor.sqf | 8 +++ scripts/occupationPlaces.sqf | 6 ++ scripts/occupationPublicBus.sqf | 113 ++++++++++++++++++++++++++++++++ scripts/occupationSea.sqf | 5 ++ scripts/occupationSky.sqf | 5 ++ scripts/occupationStatic.sqf | 9 ++- scripts/occupationVehicle.sqf | 10 ++- scripts/startOccupation.sqf | 7 ++ 10 files changed, 172 insertions(+), 7 deletions(-) create mode 100644 scripts/occupationPublicBus.sqf diff --git a/config.sqf b/config.sqf index 04e258e..61b816a 100644 --- a/config.sqf +++ b/config.sqf @@ -13,9 +13,9 @@ // Shared Config for each occupation monitor -SC_debug = false; // set to true to turn on debug features (not for live servers) +SC_debug = true; // set to true to turn on debug features (not for live servers) SC_extendedLogging = true; // set to true for additional logging -SC_infiSTAR_log = false; // true Use infiSTAR logging, false logs to server rpt +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 @@ -47,7 +47,7 @@ SC_occupyVehicle = true; // true if you want to have roaming AI 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 - +SC_occupyPublicBus = true; // true if you want a roaming bus service 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) @@ -97,6 +97,7 @@ SC_liveHelis = 0; SC_liveHelisArray = []; SC_liveBoats = 0; SC_liveBoatsArray = []; +SC_publicBusArray = []; publicVariable "SC_liveVehicles"; publicVariable "SC_liveVehiclesArray"; @@ -104,4 +105,5 @@ publicVariable "SC_liveHelis"; publicVariable "SC_liveHelisArray"; publicVariable "SC_liveBoats"; publicVariable "SC_liveBoatsArray"; -publicVariable "SC_numberofLootCrates"; \ No newline at end of file +publicVariable "SC_numberofLootCrates"; +publicVariable "SC_publicBusArray"; \ No newline at end of file diff --git a/scripts/occupationMilitary.sqf b/scripts/occupationMilitary.sqf index 3f94742..b4e17d4 100644 --- a/scripts/occupationMilitary.sqf +++ b/scripts/occupationMilitary.sqf @@ -156,6 +156,12 @@ for [{_i = 0},{_i < (count _buildings)},{_i =_i + 1}] do _group = [_spawnPosition, _aiCount, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = true; + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; + }foreach units _group; + [ _group,_pos,_difficulty,"COMBAT" ] call DMS_fnc_SetGroupBehavior; _buildings = _pos nearObjects ["house", _groupRadius]; diff --git a/scripts/occupationMonitor.sqf b/scripts/occupationMonitor.sqf index f49d1f2..189d532 100644 --- a/scripts/occupationMonitor.sqf +++ b/scripts/occupationMonitor.sqf @@ -24,5 +24,13 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time]; sleep 5; }forEach SC_liveBoatsArray; +{ + _logDetail = format ["[OCCUPATION:Unstick]:: publicBus: %1 is active",_x]; + [_logDetail] call SC_fnc_log; + _x setFuel 1; + [_x] call SC_fnc_comeUnstuck; + sleep 5; +}forEach SC_publicBusArray; + _logDetail = format ["[OCCUPATION:Unstick]:: Finished at %1",time]; [_logDetail] call SC_fnc_log; \ No newline at end of file diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index f89f322..fe73adf 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -151,6 +151,12 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi DMS_ai_use_launchers = false; _group = [_spawnPosition, _aiCount, "randomEasy", "assault", _side] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = _useLaunchers; + + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; + }foreach units _group; // Get the AI to shut the fuck up :) enableSentences false; diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf new file mode 100644 index 0000000..71069e9 --- /dev/null +++ b/scripts/occupationPublicBus.sqf @@ -0,0 +1,113 @@ +if (!isServer) exitWith {}; + +_logDetail = format ["[OCCUPATION:publicBus]:: Starting @ %1",time]; +[_logDetail] call SC_fnc_log; + +_position = [ 0, 50, 1, 500, 500, 200, 200, 200, true, false ] call DMS_fnc_findSafePos; + +// Get position of nearest roads +_nearRoads = _position nearRoads 2000; +_nearestRoad = _nearRoads select 0; +_nearestRoadPos = position (_nearRoads select 0); +_spawnLocation = [_nearestRoadPos select 0, _nearestRoadPos select 1, 0]; + +// Create the busDriver and ensure he doest react to gunfire or being shot at. + +_group = createGroup resistance; +_group setCombatMode "BLUE"; + +"Exile_Trader_CommunityCustoms" createUnit [_spawnLocation, _group, "busDriver = this; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this disableAI 'SUPPRESSION'; "]; + +busDriver allowDamage false; +removeGoggles busDriver; +busDriver forceAddUniform "U_IG_Guerilla3_1"; +busDriver addVest "V_TacVest_blk_POLICE"; +busDriver addBackpack "B_FieldPack_oli"; +busDriver addHeadgear "H_Cap_blk"; +busDriver setCaptive true; + +// Spawn busDrivers Vehicle +_publicBus = createVehicle ["Exile_Car_Ikarus_Party", _spawnLocation, [], 0, "CAN_COLLIDE"]; +SC_publicBusArray = SC_publicBusArray + [_publicBus]; +_publicBus setVariable ["SC_assignedDriver", busDriver,true]; +_group addVehicle _publicBus; +clearBackpackCargoGlobal _publicBus; +clearItemCargoGlobal _publicBus; +clearMagazineCargoGlobal _publicBus; +clearWeaponCargoGlobal _publicBus; +_publicBus setVariable ["ExileIsPersistent", false]; +_publicBus setVariable["vehPos",_spawnLocation,true]; +_publicBus setFuel 1; + +diag_log format['[OCCUPATION:publicBus] Vehicle spawned @ %1',_spawnLocation]; + +_publicBus addEventHandler ["HandleDamage", { _amountOfDamage = 0; _amountOfDamage }]; + +busDriver assignasdriver _publicBus; +[busDriver] orderGetin true; + +{ + _markerName = _x; + _markerPos = getMarkerPos _markerName; + if (markerType _markerName == "ExileTraderZone") then + { + _wp = _group addWaypoint [_markerPos, 100]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "CARELESS"; + _wp setWaypointspeed "LIMITED"; + }; + +} forEach allMapMarkers; + +// Add a final CYCLE +_wp = _group addWaypoint [_spawnLocation, 100]; +_wp setWaypointType "CYCLE"; +_wp setWaypointBehaviour "CARELESS"; +_wp setWaypointspeed "LIMITED"; + + +_busPos = position _publicBus; +_mk = createMarker ["busLocation",_busPos]; +"busLocation" setMarkerType "mil_warning"; +"busLocation" setMarkerText "Public Bus"; + +diag_log format['[OCCUPATION:publicBus] Running']; +busDriver = _publicBus getVariable "SC_assignedDriver"; + +// Make busDriver stop when players near him. +while {true} do +{ + + _pos = position _publicBus; + _mk setMarkerPos _pos; + _nearPlayers = (count (_pos nearEntities [['Exile_Unit_Player'],75])); + + if (_nearPlayers >= 1) then + { + uiSleep 0.5; + _publicBus setFuel 0; + busDriver action ["salute", busDriver]; + busDriver disableAI "MOVE"; + uiSleep 3; + } + else + { + _currentDriver = driver _publicBus; + if(isPlayer _currentDriver) then + { + [_currentDriver] orderGetin false; + }; + + if(isnull _currentDriver) then + { + sleep 0.1; + busDriver assignAsDriver _publicBus; + busDriver moveInDriver _publicBus; + [busDriver] orderGetin true; + }; + _publicBus setFuel 1; + uiSleep 3; + busDriver enableAI "MOVE"; + if(!Alive busDriver) exitWith {}; + }; +}; diff --git a/scripts/occupationSea.sqf b/scripts/occupationSea.sqf index 49b18e6..a79eec0 100644 --- a/scripts/occupationSea.sqf +++ b/scripts/occupationSea.sqf @@ -108,6 +108,11 @@ for "_i" from 1 to _vehiclesToSpawn do }; } forEach _vehicleRoles; + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; + }foreach units _group; if(SC_infiSTAR_log) then { diff --git a/scripts/occupationSky.sqf b/scripts/occupationSky.sqf index 1f51e1a..b967f82 100644 --- a/scripts/occupationSky.sqf +++ b/scripts/occupationSky.sqf @@ -131,6 +131,11 @@ for "_i" from 1 to _vehiclesToSpawn do }; } forEach _vehicleRoles; + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; + }foreach units _group; if(SC_infiSTAR_log) then { diff --git a/scripts/occupationStatic.sqf b/scripts/occupationStatic.sqf index dbbb19e..55bdbec 100644 --- a/scripts/occupationStatic.sqf +++ b/scripts/occupationStatic.sqf @@ -89,6 +89,13 @@ for [{_i = 0},{_i < (count _statics)},{_i =_i + 1}] do DMS_ai_use_launchers = false; _group = [_spawnPosition, _aiCount, _difficulty, "assault", _side] call DMS_fnc_SpawnAIGroup; + + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; + }foreach units _group; + [ _group,_spawnPosition,_difficulty,"AWARE" ] call DMS_fnc_SetGroupBehavior; DMS_ai_use_launchers = true; @@ -124,7 +131,7 @@ for [{_i = 0},{_i < (count _statics)},{_i =_i + 1}] do } foreach _buildingPositions; _wpPosition = _highest; - //diag_log format ["Static Patrol %3 waypoint added - building: %1 position: %2",_y,_highest,_group]; + diag_log format ["Static Patrol %3 waypoint added - building: %1 position: %2",_y,_highest,_group]; _i = _buildingPositions find _wpPosition; _wp = _group addWaypoint [_wpPosition, 0] ; _wp setWaypointBehaviour "AWARE"; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index a9a907c..da67583 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -122,6 +122,8 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Driver") then { _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; _unit disableAI "TARGET"; _unit disableAI "AUTOTARGET"; _unit disableAI "AUTOCOMBAT"; @@ -135,7 +137,7 @@ if(_vehiclesToSpawn >= 1) then }; sleep 0.1; _unit assignAsDriver _vehicle; - _unit moveInDriver _vehicle; + _unit moveInDriver _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unit setVariable ["SC_drivenVehicle", _vehicle,true]; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"]; @@ -147,13 +149,17 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Turret") then { _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; _unit moveInTurret [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; if(_vehicleRole == "CARGO") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group; _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; diff --git a/scripts/startOccupation.sqf b/scripts/startOccupation.sqf index 8758133..8861aa3 100644 --- a/scripts/startOccupation.sqf +++ b/scripts/startOccupation.sqf @@ -9,10 +9,16 @@ if(SC_debug) then { SC_refreshTime = 60; }else{ SC_refreshTime = 300; }; // Add selected occupation scripts to Exile Threading System +if(SC_occupyPublicBus) then +{ + [] execVM "\x\addons\a3_exile_occupation\scripts\occupationPublicBus.sqf"; +}; + if(SC_occupyLootCrates) then { if(SC_occupyLootCratesMarkers) then { + uiSleep 15; // delay the start fnc_occupationDeleteMapMarker = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\deleteMapMarkers.sqf"; [10, fnc_occupationDeleteMapMarker, [], true] call ExileServer_system_thread_addTask; }; @@ -67,6 +73,7 @@ if(SC_occupyMilitary) then [SC_refreshTime, fnc_occupationMilitary, [], true] call ExileServer_system_thread_addTask; }; + uiSleep 15; // delay the start fnc_occupationMonitor = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMonitor.sqf"; [SC_refreshTime, fnc_occupationMonitor, [], true] call ExileServer_system_thread_addTask; From a093bd2190e932ccf4b16d80011f2660c3ee99b2 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 14:56:31 +0100 Subject: [PATCH 2/7] fix --- scripts/occupationVehicle.sqf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index da67583..89a3688 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -122,8 +122,6 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Driver") then { _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; - [_unit] joinSilent grpNull; - [_unit] joinSilent _group; _unit disableAI "TARGET"; _unit disableAI "AUTOTARGET"; _unit disableAI "AUTOCOMBAT"; @@ -149,17 +147,13 @@ if(_vehiclesToSpawn >= 1) then if(_vehicleRole == "Turret") then { _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; - [_unit] joinSilent grpNull; - [_unit] joinSilent _group; _unit moveInTurret [_vehicle, _vehicleSeat]; _unit setVariable ["DMS_AssignedVeh",_vehicle]; _unitPlaced = true; }; if(_vehicleRole == "CARGO") then { - _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; - [_unit] joinSilent grpNull; - [_unit] joinSilent _group; + _unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier; _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; _unit setVariable ["DMS_AssignedVeh",_vehicle]; From a6e9f4377163a8691f4448297d3b8560d1383cd5 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 16:39:00 +0100 Subject: [PATCH 3/7] various fixes --- scripts/occupationPublicBus.sqf | 10 ++++++++-- scripts/occupationVehicle.sqf | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 71069e9..1f32ec8 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -30,6 +30,9 @@ busDriver setCaptive true; _publicBus = createVehicle ["Exile_Car_Ikarus_Party", _spawnLocation, [], 0, "CAN_COLLIDE"]; SC_publicBusArray = SC_publicBusArray + [_publicBus]; _publicBus setVariable ["SC_assignedDriver", busDriver,true]; +_publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; +_publicBus addEventHandler ["getin", "_this call SC_fnc_getInBus;"]; + _group addVehicle _publicBus; clearBackpackCargoGlobal _publicBus; clearItemCargoGlobal _publicBus; @@ -93,17 +96,20 @@ while {true} do else { _currentDriver = driver _publicBus; - if(isPlayer _currentDriver) then + if(_currentDriver != busDriver) then { + _publicBus setFuel 0; [_currentDriver] orderGetin false; + _currentDriver action ["eject", _publicBus]; }; if(isnull _currentDriver) then { sleep 0.1; busDriver assignAsDriver _publicBus; - busDriver moveInDriver _publicBus; + busDriver moveInDriver _publicBus; [busDriver] orderGetin true; + _publicBus lockDriver true; }; _publicBus setFuel 1; uiSleep 3; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index 89a3688..0d3f016 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -105,9 +105,9 @@ if(_vehiclesToSpawn >= 1) then _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; _vehicle setFuel 1; _vehicle engineOn true; - _vehicle lock 0; - _vehicle setVehicleLock "UNLOCKED"; - _vehicle setVariable ["ExileIsLocked", 0, true]; + _vehicle lock true; + _vehicle setVehicleLock "LOCKED"; + _vehicle setVariable ["ExileIsLocked", 1, true]; _vehicle setSpeedMode "LIMITED"; _vehicle limitSpeed 60; _vehicle action ["LightOn", _vehicle]; From 69a2c8bc17bdf705a6ededc94e05cab31b597ec5 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 21:17:34 +0100 Subject: [PATCH 4/7] bus changes and a few tweaks --- config.sqf | 4 ++++ initServer.sqf | 5 +++-- scripts/occupationPublicBus.sqf | 8 ++++---- scripts/occupationVehicle.sqf | 18 ++++++++++++++---- scripts/reactions/comeUnstuck.sqf | 12 ++---------- scripts/reactions/driverKilled.sqf | 3 +++ scripts/reactions/repairVehicle.sqf | 2 +- 7 files changed, 31 insertions(+), 21 deletions(-) diff --git a/config.sqf b/config.sqf index 61b816a..e4a82b2 100644 --- a/config.sqf +++ b/config.sqf @@ -44,10 +44,13 @@ SC_buildings = [ "Land_Cargo_Patrol_V1_F","Land_i_Barracks_V1_F", SC_occupyStatic = false; // true if you want to garrison AI in specific locations (not working yet) 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_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"; 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) @@ -86,6 +89,7 @@ if (worldName == 'Namalsk') then SC_numberofLootCrates = 3; SC_numberofHeliCrashes = 2; SC_maxNumberofBoats = 1; + SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; }; diff --git a/initServer.sqf b/initServer.sqf index 5669593..ce30c9a 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v8 (09-04-2016)"; +SC_occupationVersion = "v9 (11-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // @@ -23,7 +23,8 @@ SC_occupationVersion = "v8 (09-04-2016)"; [] spawn { waitUntil { !(isNil "DMS_MinMax_Y_Coords") }; - + sleep 30; + diag_log format ["[OCCUPATION MOD]:: Occupation %2 Loading Config at %1",time,SC_occupationVersion]; // Get the config for Occupation diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 1f32ec8..7b13dfc 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -27,7 +27,7 @@ busDriver addHeadgear "H_Cap_blk"; busDriver setCaptive true; // Spawn busDrivers Vehicle -_publicBus = createVehicle ["Exile_Car_Ikarus_Party", _spawnLocation, [], 0, "CAN_COLLIDE"]; +_publicBus = createVehicle [SC_occupyPublicBusClass, _spawnLocation, [], 0, "CAN_COLLIDE"]; SC_publicBusArray = SC_publicBusArray + [_publicBus]; _publicBus setVariable ["SC_assignedDriver", busDriver,true]; _publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; @@ -52,7 +52,7 @@ busDriver assignasdriver _publicBus; { _markerName = _x; _markerPos = getMarkerPos _markerName; - if (markerType _markerName == "ExileTraderZone") then + if (markerType _markerName == "ExileTraderZone" OR markerType _markerName == "o_unknown") then { _wp = _group addWaypoint [_markerPos, 100]; _wp setWaypointType "MOVE"; @@ -71,7 +71,7 @@ _wp setWaypointspeed "LIMITED"; _busPos = position _publicBus; _mk = createMarker ["busLocation",_busPos]; -"busLocation" setMarkerType "mil_warning"; +"busLocation" setMarkerType "Vehicle"; "busLocation" setMarkerText "Public Bus"; diag_log format['[OCCUPATION:publicBus] Running']; @@ -83,7 +83,7 @@ while {true} do _pos = position _publicBus; _mk setMarkerPos _pos; - _nearPlayers = (count (_pos nearEntities [['Exile_Unit_Player'],75])); + _nearPlayers = (count (_pos nearEntities [['Exile_Unit_Player'],25])); if (_nearPlayers >= 1) then { diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index 0d3f016..72e76eb 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -105,9 +105,19 @@ if(_vehiclesToSpawn >= 1) then _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; _vehicle setFuel 1; _vehicle engineOn true; - _vehicle lock true; - _vehicle setVehicleLock "LOCKED"; - _vehicle setVariable ["ExileIsLocked", 1, true]; + if(SC_occupyVehiclesLocked) then + { + _vehicle lock 2; + _vehicle setVehicleLock "LOCKED"; + _vehicle setVariable ["ExileIsLocked", 1, true]; + } + else + { + _vehicle lock 0; + _vehicle setVehicleLock "UNLOCKED"; + _vehicle setVariable ["ExileIsLocked", 0, true]; + }; + _vehicle setSpeedMode "LIMITED"; _vehicle limitSpeed 60; _vehicle action ["LightOn", _vehicle]; @@ -179,7 +189,7 @@ if(_vehiclesToSpawn >= 1) then [_group, _spawnLocation, 2000] call bis_fnc_taskPatrol; - _group setBehaviour "AWARE"; + _group setBehaviour "SAFE"; _group setCombatMode "RED"; sleep 0.2; diff --git a/scripts/reactions/comeUnstuck.sqf b/scripts/reactions/comeUnstuck.sqf index a2e6e5e..fcc402b 100644 --- a/scripts/reactions/comeUnstuck.sqf +++ b/scripts/reactions/comeUnstuck.sqf @@ -34,25 +34,17 @@ if(count(crew _vehicle) > 0)then _originalSpawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; _group = group _vehicle; - //_vehClass = _vehicle getVariable "vehClass"; _vehClass = typeOf _vehicle; if(_vehicle isKindOf "LandVehicle") then { - //_newPos = [ _curPos, 1, 50, [ 0, 0, 1, 0, 0, 0, 0, 0, true] ] call DMS_fnc_FindSafePos_InRange; - //_newPos = [_curPos, 5, 100, 3, 0, 20, 0] call BIS_fnc_findSafePos; - _tempPos = _curPos findEmptyPosition [0,100,_vehClass]; - _newPos = [_tempPos select 0, _tempPos select 1, 0]; - //_newPos = _curPos; - //_vehicle setDamage 0.2; + _tempPos = _curPos findEmptyPosition [0,150,_vehClass]; + _newPos = [_tempPos select 0, _tempPos select 1, 0]; }; if(_vehicle isKindOf "Ship") then { - //_newPos = [ _curPos, 1,50, [ 0, 0, 1, 0, 0, 0, 0, 0, true, true ] ] call DMS_fnc_FindSafePos_InRange; _newPos = [_curPos, 5, 100, 3, 2, 20, 0] call BIS_fnc_findSafePos; - //_tempPos = _curPos findEmptyPosition [0,100,_vehClass]; - //_newPos = [_tempPos select 0, _tempPos select 1, 0]; _newPos = _curPos; _vehicle setDamage 0.2; }; diff --git a/scripts/reactions/driverKilled.sqf b/scripts/reactions/driverKilled.sqf index 0368a5c..9b8ebb8 100644 --- a/scripts/reactions/driverKilled.sqf +++ b/scripts/reactions/driverKilled.sqf @@ -76,4 +76,7 @@ else { _logDetail = format ["[OCCUPATION:Vehicle]:: No replacement Driver found for vehicle %1",_vehicle]; [_logDetail] call SC_fnc_log; + _vehicle lock 0; + _vehicle setVehicleLock "UNLOCKED"; + _vehicle setVariable ["ExileIsLocked", 0, true]; }; diff --git a/scripts/reactions/repairVehicle.sqf b/scripts/reactions/repairVehicle.sqf index 34f043b..206a657 100644 --- a/scripts/reactions/repairVehicle.sqf +++ b/scripts/reactions/repairVehicle.sqf @@ -90,7 +90,7 @@ if(_damagedWheels > 0 OR _engineDamage OR _fueltankDamage) then _driver action ["movetodriver", _vehicle]; _vehicle forceSpeed -1; [_group, _spawnLocation, 2000] call bis_fnc_taskPatrol; - _group setBehaviour "AWARE"; + _group setBehaviour "SAFE"; _group setCombatMode "RED"; }; From ca9d73de2ac796fc43040fd8ea1dded4141cf24a Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 22:07:38 +0100 Subject: [PATCH 5/7] marker fix --- scripts/occupationPublicBus.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 7b13dfc..8eeb83f 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -71,7 +71,7 @@ _wp setWaypointspeed "LIMITED"; _busPos = position _publicBus; _mk = createMarker ["busLocation",_busPos]; -"busLocation" setMarkerType "Vehicle"; +"busLocation" setMarkerType "mil_warning"; "busLocation" setMarkerText "Public Bus"; diag_log format['[OCCUPATION:publicBus] Running']; From 22475d3e46f1ba0fcb4afb5814c2b3b03683fcb8 Mon Sep 17 00:00:00 2001 From: second_coming Date: Tue, 12 Apr 2016 01:25:35 +0100 Subject: [PATCH 6/7] Survivor AI option added to OccupationPlaces --- config.sqf | 11 +-- initServer.sqf | 8 +- scripts/occupationMilitary.sqf | 2 +- scripts/occupationPlaces.sqf | 146 +++++++++++++++++++++++++++++---- scripts/occupationSea.sqf | 2 +- scripts/occupationSky.sqf | 2 +- scripts/occupationStatic.sqf | 2 +- scripts/occupationVehicle.sqf | 2 +- scripts/startOccupation.sqf | 3 - 9 files changed, 144 insertions(+), 34 deletions(-) diff --git a/config.sqf b/config.sqf index e4a82b2..e65386b 100644 --- a/config.sqf +++ b/config.sqf @@ -13,8 +13,8 @@ // Shared Config for each occupation monitor -SC_debug = true; // 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 @@ -27,10 +27,11 @@ SC_useWaypoints = true; // When spawning AI create waypoints to make t // (can affect performance when the AI is spawned and the waypoints are calculated) // Occupation Places (towns, villages & cities roaming AI) -SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled +SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits +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) // Occupation Military (roaming AI near military buildings) -SC_occupyMilitary = false; // true if you want military buildings patrolled (specify which types of building below) +SC_occupyMilitary = true; // true if you want military buildings patrolled (specify which types of building below) SC_buildings = [ "Land_Cargo_Patrol_V1_F","Land_i_Barracks_V1_F","Land_i_Barracks_V1_dam_F", "Land_i_Barracks_V2_F", "Land_Cargo_House_V1_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F","Land_Cargo_Patrol_V2_F", @@ -41,7 +42,7 @@ SC_buildings = [ "Land_Cargo_Patrol_V1_F","Land_i_Barracks_V1_F", "Land_Army_hut_int","Land_Army_hut2_int" ]; -SC_occupyStatic = false; // true if you want to garrison AI in specific locations (not working yet) +SC_occupyStatic = true; // true if you want to garrison AI in specific locations (not working yet) 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 diff --git a/initServer.sqf b/initServer.sqf index ce30c9a..0f3d805 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v9 (11-04-2016)"; +SC_occupationVersion = "v10 (12-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // @@ -22,9 +22,9 @@ SC_occupationVersion = "v9 (11-04-2016)"; [] spawn { - waitUntil { !(isNil "DMS_MinMax_Y_Coords") }; - sleep 30; - + diag_log format ["[OCCUPATION]:: Occupation %2 Giving the server time to start before starting [OCCUPATION] (%1)",time,SC_occupationVersion]; + waitUntil { !(isNil "DMS_MinMax_Y_Coords") }; + sleep 1; diag_log format ["[OCCUPATION MOD]:: Occupation %2 Loading Config at %1",time,SC_occupationVersion]; // Get the config for Occupation diff --git a/scripts/occupationMilitary.sqf b/scripts/occupationMilitary.sqf index b4e17d4..7e2e33d 100644 --- a/scripts/occupationMilitary.sqf +++ b/scripts/occupationMilitary.sqf @@ -28,7 +28,7 @@ if(diag_fps < _minFPS) exitWith [_logDetail] call SC_fnc_log; }; -_aiActive = {alive _x && side _x == EAST} count allUnits; +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; //_aiActive = count(_spawnCenter nearEntities ["O_recon_F", _maxDistance+1000]); if(_aiActive > _maxAIcount) exitWith diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index fe73adf..5214c35 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -27,6 +27,17 @@ _maxAIcount = SC_maxAIcount; _minFPS = SC_minFPS; _useLaunchers = DMS_ai_use_launchers; _scaleAI = SC_scaleAI; +_side = "bandit"; + +if(SC_occupyPlacesSurvivors) then +{ + // Make survivors friendly to players and enemies to bandit AI + RESISTANCE setFriend[WEST,1]; + WEST setFriend[RESISTANCE,1]; + WEST setFriend[EAST,0]; + EAST setFriend[WEST,0]; +}; + // more than _scaleAI players on the server and the max AI count drops per additional player _currentPlayerCount = count playableUnits; @@ -45,7 +56,7 @@ if(diag_fps < _minFPS) exitWith }; }; -_aiActive = {alive _x && side _x == EAST} count allUnits; +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; if(_aiActive > _maxAIcount) exitWith { if(SC_extendedLogging) then @@ -109,7 +120,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi }; // Don't spawn additional AI if there are players in range - if([_pos, 200] call ExileClient_util_world_isAlivePlayerInRange) exitwith + if([_pos, 250] call ExileClient_util_world_isAlivePlayerInRange) exitwith { _okToSpawn = false; if(SC_extendedLogging) then @@ -119,21 +130,51 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi }; }; + + // Don't spawn additional AI if there are already AI in range _aiNear = count(_pos nearEntities ["O_recon_F", 500]); - if(_aiNear > 0) exitwith + if(_aiNear > 0) then { - _okToSpawn = false; - if(SC_extendedLogging) then + _nearEastAI = { side _x == EAST AND _x distance _pos < 500 } count allUnits; + _nearWestAI = { side _x == WEST AND _x distance _pos < 500 } count allUnits; + + if(_nearEastAI == 0 AND _nearWestAI == 0) then { - _logDetail = format ["[OCCUPATION:Places]:: %1 already has %2 active AI patrolling",_locationName,_aiNear]; - [_logDetail] call SC_fnc_log; - }; + _sideToSpawn = random 100; + if(_sideToSpawn < 50) then + { + _side = "bandit"; + } + else + { + _side = "survivor"; + }; + }; + if(_nearEastAI > 0 AND _nearWestAI == 0) then + { + _side = "survivor"; + }; + if(_nearEastAI == 0 AND _nearWestAI > 0) then + { + _side = "bandit"; + }; + if(_nearEastAI > 0 AND _nearWestAI > 0) then + { + _okToSpawn = false; + if(SC_extendedLogging) then + { + _logDetail = format ["[OCCUPATION:Places]:: %1 already has %2 active AI patrolling",_locationName,_aiNear]; + [_logDetail] call SC_fnc_log; + }; + }; + }; if(_okToSpawn) then { - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if(!SC_occupyPlacesSurvivors) then { _side = "bandit"; }; + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Get AI to patrol the town ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// _aiCount = 1; @@ -144,19 +185,48 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi if(_aiCount < 1) then { _aiCount = 1; }; _difficulty = "random"; - _side = "bandit"; + _spawnPos = [_pos,10,100,5,0,20,0] call BIS_fnc_findSafePos; _spawnPosition = [_spawnPos select 0, _spawnPos select 1,0]; DMS_ai_use_launchers = false; - _group = [_spawnPosition, _aiCount, "randomEasy", "assault", _side] call DMS_fnc_SpawnAIGroup; + _initialGroup = [_spawnPosition, _aiCount, "randomEasy", "assault", _side] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = _useLaunchers; - + + _group = createGroup EAST; + if(_side == "survivor") then + { + deleteGroup _group; + _group = createGroup WEST; + }; + + _group setVariable ["DMS_LockLocality",nil]; + _group setVariable ["DMS_SpawnedGroup",true]; + _group setVariable ["DMS_Group_Side", _side]; + { _unit = _x; [_unit] joinSilent grpNull; [_unit] joinSilent _group; - }foreach units _group; + if(_side == "survivor") then + { + removeUniform _unit; + _unit forceAddUniform "Exile_Uniform_BambiOverall"; + if(SC_debug) then + { + _tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"]; + _tag attachTo [_unit,[0,0,0.6],"Head"]; + }; + } + else + { + if(SC_debug) then + { + _tag = createVehicle ["Sign_Arrow_F", position _unit, [], 0, "CAN_COLLIDE"]; + _tag attachTo [_unit,[0,0,0.6],"Head"]; + }; + }; + }foreach units _initialGroup; // Get the AI to shut the fuck up :) enableSentences false; @@ -212,16 +282,51 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi if(_locationType isEqualTo "NameCityCapital") then { DMS_ai_use_launchers = false; - _group2 = [_spawnPosition, 5, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; + _initialGroup2 = [_spawnPosition, 5, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = _useLaunchers; - + + _group2 = createGroup EAST; + if(_side == "survivor") then + { + deleteGroup _group2; + _group2 = createGroup WEST; + }; + + _group2 setVariable ["DMS_LockLocality",nil]; + _group2 setVariable ["DMS_SpawnedGroup",true]; + _group2 setVariable ["DMS_Group_Side", _side]; + // Get the AI to shut the fuck up :) enableSentences false; enableRadio false; + + { + _unit = _x; + [_unit] joinSilent grpNull; + [_unit] joinSilent _group2; + if(side _unit == "survivor") then + { + removeUniform _unit; + _unit forceAddUniform "Exile_Uniform_BambiOverall"; + if(SC_debug) then + { + _tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"]; + _tag attachTo [_unit,[0,0,0.6],"Head"]; + } + else + { + if(SC_debug) then + { + _tag = createVehicle ["Sign_Arrow_F", position _unit, [], 0, "CAN_COLLIDE"]; + _tag attachTo [_unit,[0,0,0.6],"Head"]; + }; + }; + }; + }foreach units _initialGroup2; + [_group2, _pos, _groupRadius] call bis_fnc_taskPatrol; _group2 setBehaviour "AWARE"; _group2 setCombatMode "RED"; - }; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -237,7 +342,14 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi _marker setMarkerText "Occupied Area"; }; - _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; + if(_side == 'survivor') then + { + _logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition]; + } + else + { + _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/occupationSea.sqf b/scripts/occupationSea.sqf index a79eec0..f80426c 100644 --- a/scripts/occupationSea.sqf +++ b/scripts/occupationSea.sqf @@ -19,7 +19,7 @@ if(diag_fps < SC_minFPS) exitWith [_logDetail] call SC_fnc_log; }; -_aiActive = {alive _x && side _x == EAST} count allUnits; +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; if(_aiActive > _maxAIcount) exitWith { _logDetail = format ["[OCCUPATION:Sea]:: %1 active AI, so not spawning AI this time",_aiActive]; diff --git a/scripts/occupationSky.sqf b/scripts/occupationSky.sqf index b967f82..2f7bdd9 100644 --- a/scripts/occupationSky.sqf +++ b/scripts/occupationSky.sqf @@ -19,7 +19,7 @@ if(diag_fps < SC_minFPS) exitWith [_logDetail] call SC_fnc_log; }; -_aiActive = {alive _x && side _x == EAST} count allUnits; +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; if(_aiActive > _maxAIcount) exitWith { _logDetail = format ["[OCCUPATION:Sky]:: %1 active AI, so not spawning AI this time",_aiActive]; diff --git a/scripts/occupationStatic.sqf b/scripts/occupationStatic.sqf index 55bdbec..35f7459 100644 --- a/scripts/occupationStatic.sqf +++ b/scripts/occupationStatic.sqf @@ -31,7 +31,7 @@ if(diag_fps < _minFPS) exitWith [_logDetail] call SC_fnc_log; }; -_aiActive = count(_spawnCenter nearEntities ["O_recon_F", _maxDistance+1000]); +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; if(_aiActive > _maxAIcount) exitWith { _logDetail = format ["[OCCUPATION Static]:: %1 active AI, so not spawning AI this time",_aiActive]; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index 72e76eb..49014bf 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -20,7 +20,7 @@ if(diag_fps < SC_minFPS) exitWith [_logDetail] call SC_fnc_log; }; -_aiActive = {alive _x && side _x == EAST} count allUnits; +_aiActive = {alive _x && (side _x == EAST OR side _x == WEST)} count allUnits; if(_aiActive > _maxAIcount) exitWith { _logDetail = format ["[OCCUPATION:Vehicle]:: %1 active AI, so not spawning AI this time",_aiActive]; diff --git a/scripts/startOccupation.sqf b/scripts/startOccupation.sqf index 8861aa3..2fe8935 100644 --- a/scripts/startOccupation.sqf +++ b/scripts/startOccupation.sqf @@ -1,6 +1,3 @@ -_logDetail = format ["[OCCUPATION]:: Occupation %2 Giving the server time to start before starting [OCCUPATION] (%1)",time,SC_occupationVersion]; -[_logDetail] call SC_fnc_log; -uiSleep 60; _logDetail = format ["[OCCUPATION]:: Occupation %2 Initialised at %1",time,SC_occupationVersion]; [_logDetail] call SC_fnc_log; From 999892c9fd0f71524ea2c5b88aa29d575d297ae7 Mon Sep 17 00:00:00 2001 From: second_coming Date: Tue, 12 Apr 2016 11:14:07 +0100 Subject: [PATCH 7/7] minor tweaks --- config.sqf | 9 ++++----- initServer.sqf | 2 +- scripts/occupationMilitary.sqf | 4 ++-- scripts/occupationPlaces.sqf | 18 +++--------------- scripts/occupationSea.sqf | 4 ++-- scripts/occupationSky.sqf | 4 ++-- scripts/occupationStatic.sqf | 5 +++-- scripts/startOccupation.sqf | 3 +++ 8 files changed, 20 insertions(+), 29 deletions(-) diff --git a/config.sqf b/config.sqf index e65386b..17aab91 100644 --- a/config.sqf +++ b/config.sqf @@ -2,7 +2,6 @@ // // Server Occupation script by second_coming // -// // http://www.exilemod.com/profile/60-second_coming/ // // This script uses the fantastic DMS by Defent and eraser1 @@ -31,7 +30,7 @@ SC_occupyPlaces = true; // true if you want villages,towns,cities patr 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) // Occupation Military (roaming AI near military buildings) -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_Cargo_Patrol_V1_F","Land_i_Barracks_V1_F","Land_i_Barracks_V1_dam_F", "Land_i_Barracks_V2_F", "Land_Cargo_House_V1_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F","Land_Cargo_Patrol_V2_F", @@ -42,7 +41,7 @@ SC_buildings = [ "Land_Cargo_Patrol_V1_F","Land_i_Barracks_V1_F", "Land_Army_hut_int","Land_Army_hut2_int" ]; -SC_occupyStatic = true; // true if you want to garrison AI in specific locations (not working yet) +SC_occupyStatic = false; // true if you want to garrison AI in specific locations (not working yet) 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 @@ -51,7 +50,7 @@ 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"; +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) @@ -90,7 +89,7 @@ if (worldName == 'Namalsk') then SC_numberofLootCrates = 3; SC_numberofHeliCrashes = 2; SC_maxNumberofBoats = 1; - SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; + SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk }; diff --git a/initServer.sqf b/initServer.sqf index 0f3d805..27cdf9e 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v10 (12-04-2016)"; +SC_occupationVersion = "v11 (12-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // diff --git a/scripts/occupationMilitary.sqf b/scripts/occupationMilitary.sqf index 7e2e33d..c831f45 100644 --- a/scripts/occupationMilitary.sqf +++ b/scripts/occupationMilitary.sqf @@ -1,6 +1,6 @@ -private["_wp","_wp2","_wp3"]; - if (!isServer) exitWith {}; + +private["_wp","_wp2","_wp3"]; _logDetail = format ["[OCCUPATION Military]:: Starting Monitor"]; [_logDetail] call SC_fnc_log; diff --git a/scripts/occupationPlaces.sqf b/scripts/occupationPlaces.sqf index 5214c35..f267537 100644 --- a/scripts/occupationPlaces.sqf +++ b/scripts/occupationPlaces.sqf @@ -1,21 +1,7 @@ -//////////////////////////////////////////////////////////////////////// -// -// Server Occupation script by second_coming -// -// Version 2.0 -// -// http://www.exilemod.com/profile/60-second_coming/ -// -// This script uses the fantastic DMS by Defent and eraser1 -// -// http://www.exilemod.com/topic/61-dms-defents-mission-system/ -// -//////////////////////////////////////////////////////////////////////// +if (!isServer) exitWith {}; private["_wp","_wp2","_wp3"]; -if (!isServer) exitWith {}; - _logDetail = format ["[OCCUPATION]:: Starting Occupation Monitor @ %1",time]; [_logDetail] call SC_fnc_log; @@ -36,6 +22,8 @@ if(SC_occupyPlacesSurvivors) then WEST setFriend[RESISTANCE,1]; WEST setFriend[EAST,0]; EAST setFriend[WEST,0]; + + if(!isNil "DMS_Enable_RankChange") then { DMS_Enable_RankChange = true; }; }; diff --git a/scripts/occupationSea.sqf b/scripts/occupationSea.sqf index f80426c..c2e1471 100644 --- a/scripts/occupationSea.sqf +++ b/scripts/occupationSea.sqf @@ -1,8 +1,8 @@ +if (!isServer) exitWith {}; + _logDetail = format['[OCCUPATION:Sea] Started']; [_logDetail] call SC_fnc_log; -if (!isServer) exitWith {}; - // more than _scaleAI players on the server and the max AI count drops per additional player _currentPlayerCount = count playableUnits; _maxAIcount = SC_maxAIcount; diff --git a/scripts/occupationSky.sqf b/scripts/occupationSky.sqf index 2f7bdd9..ee360e3 100644 --- a/scripts/occupationSky.sqf +++ b/scripts/occupationSky.sqf @@ -1,8 +1,8 @@ +if (!isServer) exitWith {}; + _logDetail = format['[OCCUPATION:Sky] Started']; [_logDetail] call SC_fnc_log; -if (!isServer) exitWith {}; - // more than _scaleAI players on the server and the max AI count drops per additional player _currentPlayerCount = count playableUnits; _maxAIcount = SC_maxAIcount; diff --git a/scripts/occupationStatic.sqf b/scripts/occupationStatic.sqf index 35f7459..49bcc30 100644 --- a/scripts/occupationStatic.sqf +++ b/scripts/occupationStatic.sqf @@ -1,9 +1,10 @@ -private["_wp","_wp2","_wp3"]; - if (!isServer) exitWith {}; + _logDetail = format ["[OCCUPATION Static]:: Starting Monitor"]; [_logDetail] call SC_fnc_log; +private["_wp","_wp2","_wp3"]; + _middle = worldSize/2; _spawnCenter = [_middle,_middle,0]; // Centre point for the map _maxDistance = _middle; // Max radius for the map diff --git a/scripts/startOccupation.sqf b/scripts/startOccupation.sqf index 2fe8935..7ef25bc 100644 --- a/scripts/startOccupation.sqf +++ b/scripts/startOccupation.sqf @@ -1,3 +1,6 @@ +if (!isServer) exitWith {}; + + _logDetail = format ["[OCCUPATION]:: Occupation %2 Initialised at %1",time,SC_occupationVersion]; [_logDetail] call SC_fnc_log;