diff --git a/pre-packaged pbo/a3_exile_occupation.pbo b/pre-packaged pbo/a3_exile_occupation.pbo index f9e8cca..4545260 100644 Binary files a/pre-packaged pbo/a3_exile_occupation.pbo and b/pre-packaged pbo/a3_exile_occupation.pbo differ diff --git a/source/a3_exile_occupation/changeLog.txt b/source/a3_exile_occupation/changeLog.txt index eaa8b62..4a2b94f 100644 --- a/source/a3_exile_occupation/changeLog.txt +++ b/source/a3_exile_occupation/changeLog.txt @@ -1,3 +1,8 @@ +================================================================================= +V64 (27-08-2016) +================================================================================= +Another bug fixed in the repair vehicle eventhandler + ================================================================================= V63 (26-08-2016) ================================================================================= diff --git a/source/a3_exile_occupation/config.cpp b/source/a3_exile_occupation/config.cpp index fe474dd..981365f 100644 --- a/source/a3_exile_occupation/config.cpp +++ b/source/a3_exile_occupation/config.cpp @@ -4,7 +4,7 @@ class CfgPatches units[] = {}; weapons[] = {}; requiredVersion = 0.1; - a3_exile_occupation_version = "V63 (26-08-2016)"; + a3_exile_occupation_version = "V64 (27-08-2016)"; requiredAddons[] = {"a3_dms"}; author[]= {"second_coming"}; }; diff --git a/source/a3_exile_occupation/config.sqf b/source/a3_exile_occupation/config.sqf index 9ea57d5..c2bba56 100644 --- a/source/a3_exile_occupation/config.sqf +++ b/source/a3_exile_occupation/config.sqf @@ -109,8 +109,8 @@ SC_staticSurvivors = [ //[[pos],ai count,radius,search buildings] ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SC_colourTransport = true; // true if you want the public transport coloured -SC_secureTransport = true; // true if you want the public transport and pilot to be indestructible -SC_occupyTransportClass = ["Exile_Chopper_Hummingbird_Green"]; // to always use the same vehicle, specify one option only +SC_secureTransport = true; // true if you want the public transport and pilot to be indestructible +SC_occupyTransportClass = ["Exile_Chopper_Orca_BlackCustom"]; // to always use the same vehicle, specify one option only SC_occupyTransportStartPos = []; // if empty defaults to map centre @@ -401,13 +401,14 @@ SC_BanditBackpack = ["B_HuntingBackpack","B_Kitbag_cbr","B_Kitbag_mca if (worldName == 'Napf' AND SC_useMapOverrides) then { SC_maxAIcount = 120; + SC_useApexClasses = false; }; if (worldName == 'Chernarus' AND SC_useMapOverrides) then { SC_maxAIcount = 120; - + SC_useApexClasses = false; }; if (worldName == 'Tanoa' AND SC_useMapOverrides) then @@ -450,21 +451,21 @@ if (SC_debug) then SC_extendedLogging = true; SC_processReporter = true; SC_mapMarkers = true; - SC_occupyPlaces = true; - SC_occupyVehicle = false; - SC_occupyMilitary = true; + SC_occupyPlaces = false; + SC_occupyVehicle = true; + SC_occupyMilitary = false; SC_occupyRandomSpawn = true; SC_occupyStatic = false; - SC_occupySky = true; + SC_occupySky = false; SC_occupySea = false; - SC_occupyTraders = true; + SC_occupyTraders = false; SC_occupyTransport = true; - SC_occupyLootCrates = true; - SC_occupyHeliCrashes = true; - SC_maxAIcount = 100; - SC_maxNumberofVehicles = 5; + SC_occupyLootCrates = false; + SC_occupyHeliCrashes = false; + SC_maxAIcount = 150; + SC_maxNumberofVehicles = 10; SC_maxNumberofBoats = 5; - SC_maxNumberofHelis = 5; + SC_maxNumberofHelis = 1; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/a3_exile_occupation/scripts/eventHandlers/driverKilled.sqf b/source/a3_exile_occupation/scripts/eventHandlers/driverKilled.sqf index 44d0b41..bb9d88c 100644 --- a/source/a3_exile_occupation/scripts/eventHandlers/driverKilled.sqf +++ b/source/a3_exile_occupation/scripts/eventHandlers/driverKilled.sqf @@ -9,6 +9,8 @@ if(SC_extendedLogging) then _deadDriver = _this select 0; _vehicle = _deadDriver getVariable "SC_drivenVehicle"; +_vehicle removeAllMPEventHandlers "mphit"; +_vehicle setVariable ["SC_repairStatus",false,true]; if(SC_debug) then { diff --git a/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf b/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf index 7f24993..bf0da01 100644 --- a/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf +++ b/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf @@ -4,10 +4,17 @@ _vehicle = _this select 0; _repairStatus = _vehicle getVariable "SC_repairStatus"; +_logDetail = format ["[OCCUPATION:repairVehicle]:: Vehicle %1 _repairStatus %2",_vehicle, _repairStatus]; +[_logDetail] call SC_fnc_log; + if(_repairStatus) exitWith {}; // Mark the vehicle as currently being repaired _vehicle setVariable ["SC_repairStatus",true,true]; +_vehicle removeAllMPEventHandlers "mphit"; + +_logDetail = format ["[OCCUPATION:repairVehicle]:: Starting repair check Vehicle %1 _repairStatus %2",_vehicle, _repairStatus]; +[_logDetail] call SC_fnc_log; _vehicleDamage = damage _vehicle; _damagedWheels = 0; @@ -31,7 +38,10 @@ if(isNil "_assignedDriver") then _groupMembers = units _group; _assignedDriver = _groupMembers call BIS_fnc_selectRandom; - + + _logDetail = format ["[OCCUPATION:repairVehicle]:: Selected replacement driver for %1 _repairStatus %2",_vehicle, _assignedDriver]; + [_logDetail] call SC_fnc_log; + _assignedDriver removeAllMPEventHandlers "mphit"; _assignedDriver disableAI "TARGET"; _assignedDriver disableAI "AUTOTARGET"; @@ -75,13 +85,16 @@ if ((_vehicle getHitPointDamage "HitFuel") > 0) then { _fueltankDamage = true; } if(_wheelDamage OR _engineDamage OR _fueltankDamage) then { - _logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 repairing vehicle at %1",time,_assignedDriver]; - [_logDetail] call SC_fnc_log; + [_vehicle,_assignedDriver ] spawn { _vehicle = _this select 0; _driver = _this select 1; + _vehicle setVariable ["SC_repairStatus",true,true]; + _repairStatus = _vehicle getVariable "SC_repairStatus"; + _logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 repairing(%3) vehicle at %1",time,_driver,_repairStatus]; + [_logDetail] call SC_fnc_log; _vehicle forceSpeed 0; sleep 0.2; @@ -123,18 +136,22 @@ if(_wheelDamage OR _engineDamage OR _fueltankDamage) then _wp setWaypointType "GETIN"; sleep 5; _tempLocation = _vehicle getVariable "SC_vehicleSpawnLocation"; - _originalSpawnLocation = _tempLocation select 0; - _radius = _tempLocation select 1; - _driver action ["movetodriver", _vehicle]; - _vehicle forceSpeed -1; - [_group, _originalSpawnLocation, _radius] call bis_fnc_taskPatrol; - _group setBehaviour "SAFE"; - _group setCombatMode "RED"; - _driver enableAI "MOVE"; - _driver enableAI "FSM"; + if(!isNil "_tempLocation") then + { + _originalSpawnLocation = _tempLocation select 0; + _radius = _tempLocation select 1; + [_group, _originalSpawnLocation, _radius] call bis_fnc_taskPatrol; + }; + _driver action ["movetodriver", _vehicle]; + _group setBehaviour "SAFE"; + _group setCombatMode "RED"; + _driver enableAI "MOVE"; + _driver enableAI "FSM"; + // Mark the vehicle as not currently being repaired and reapply the mphit eventhandler + _vehicle setVariable ["SC_repairStatus",false,true]; + _vehicle addMPEventHandler ["mphit", "_this call SC_fnc_hitLand;"]; }; - // Mark the vehicle as not currently being repaired - _vehicle setVariable ["SC_repairStatus",false,true]; + } else { @@ -142,4 +159,8 @@ else _vehicle setVariable ["SC_repairStatus",false,true]; _logDetail = format ["[OCCUPATION:repairVehicle]:: Not enough damage to disable %2, driver is %3 at %1",time,_vehicle,_assignedDriver]; [_logDetail] call SC_fnc_log; -}; \ No newline at end of file + //_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_hitLand;"]; +}; +_repairStatus = _vehicle getVariable "SC_repairStatus"; +_logDetail = format ["[OCCUPATION:repairVehicle]:: Finished mphit eventhandler for Vehicle %1 _repairStatus %2",_vehicle, _repairStatus]; +[_logDetail] call SC_fnc_log; \ No newline at end of file diff --git a/source/a3_exile_occupation/scripts/occupationRandomSpawn.sqf b/source/a3_exile_occupation/scripts/occupationRandomSpawn.sqf index cb10f34..7f233ed 100644 --- a/source/a3_exile_occupation/scripts/occupationRandomSpawn.sqf +++ b/source/a3_exile_occupation/scripts/occupationRandomSpawn.sqf @@ -42,6 +42,13 @@ if(time < 300) exitWith else { _groupLeader = leader _group; + + if(isNil "_groupLeader" OR !alive _groupLeader) then + { + _groupMembers = units _group; + _groupLeader = _groupMembers call BIS_fnc_selectRandom; + }; + _distanceFromSelectedPlayer = 500; _selectedPlayer = _group getVariable "SC_huntedPlayer"; @@ -340,6 +347,7 @@ _livePlayers call BIS_fnc_arrayShuffle; _unit disableAI "AUTOTARGET"; _unit disableAI "TARGET"; _unit disableAI "MOVE"; + _unit disableAI "FSM"; _unitName = ["survivor"] call SC_fnc_selectName; if(!isNil "_unitName") then { _unit setName _unitName; }; _unit addMPEventHandler ["mpkilled", "_this call SC_fnc_randomUnitMPKilled;"]; @@ -352,7 +360,8 @@ _livePlayers call BIS_fnc_arrayShuffle; _unit enableAI "AUTOTARGET"; _unit enableAI "TARGET"; _unit enableAI "MOVE"; - _unit setCaptive false; + _unit setCaptive false; + _unit setCombatMode "RED" }foreach units _group; if(SC_randomSpawnAnnounce) then @@ -373,7 +382,7 @@ _livePlayers call BIS_fnc_arrayShuffle; _wp setWaypointBehaviour "AWARE"; _wp setWaypointCombatMode "RED"; _wp setWaypointCompletionRadius 25; - _wp setWaypointType "SAD"; + _wp setWaypointType "MOVE"; [_group, _destination, 350] call bis_fnc_taskPatrol; _group allowFleeing 0; diff --git a/source/a3_exile_occupation/scripts/occupationTransport.sqf b/source/a3_exile_occupation/scripts/occupationTransport.sqf index c3baa45..8fd0424 100644 --- a/source/a3_exile_occupation/scripts/occupationTransport.sqf +++ b/source/a3_exile_occupation/scripts/occupationTransport.sqf @@ -184,6 +184,9 @@ while {true} do _transport setVariable ["SC_assignedDriver", _transportDriver,true]; _transport setVariable ["SC_transport", true,true]; _transport setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; + _SC_vehicleSpawnLocation = [_spawnLocation,2000,worldName]; + _transport setVariable ["SC_vehicleSpawnLocation", _SC_vehicleSpawnLocation,true]; + _transportDriver setVariable ["DMS_AssignedVeh",_transport]; _transportDriver setVariable ["SC_lastSpoke", time, true]; _transport addEventHandler ["getin", "_this call SC_fnc_getOnBus;"]; @@ -214,12 +217,12 @@ while {true} do { { _markerPos = _x; - _wp = _group addWaypoint [_markerPos, 25]; + _wp = _group addWaypoint [_markerPos, 100]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour _transportBehaviour; _wp setWaypointspeed _transportSpeed; - _wp = _group addWaypoint [_markerPos, 5]; + _wp = _group addWaypoint [_markerPos, 25]; _wp setWaypointType "TR UNLOAD"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointspeed "LIMITED"; @@ -251,7 +254,7 @@ while {true} do }; // Add a final CYCLE - _wp = _group addWaypoint [_spawnLocation, 20]; + _wp = _group addWaypoint [_spawnLocation, 25]; _wp setWaypointType "CYCLE"; _wp setWaypointBehaviour _transportBehaviour; _wp setWaypointspeed _transportSpeed;