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"; };