From b25ca8a81c12c594b9c7b89ff74c850873065ed6 Mon Sep 17 00:00:00 2001 From: second_coming Date: Sat, 27 Aug 2016 14:15:35 +0100 Subject: [PATCH] V64 Bug-fix-tastic --- pre-packaged pbo/a3_exile_occupation.pbo | Bin 217344 -> 219135 bytes source/a3_exile_occupation/changeLog.txt | 5 ++ source/a3_exile_occupation/config.cpp | 2 +- source/a3_exile_occupation/config.sqf | 27 +++++----- .../scripts/eventHandlers/driverKilled.sqf | 2 + .../scripts/eventHandlers/hitLand.sqf | 51 ++++++++++++------ .../scripts/occupationRandomSpawn.sqf | 13 ++++- .../scripts/occupationTransport.sqf | 9 ++-- 8 files changed, 75 insertions(+), 34 deletions(-) diff --git a/pre-packaged pbo/a3_exile_occupation.pbo b/pre-packaged pbo/a3_exile_occupation.pbo index f9e8ccad5a53e77b197ed007bb0a9f1da74c4ae9..4545260d94a92ee6f104f75dc51e57a8af06d096 100644 GIT binary patch delta 1566 zcmbVMUu;ul6z86{uv^xav2Gn(8Q<-g8(Hnz0YPmDgDHt|W6?$Xpxd}~x9iRNkK5Y` zP7(?}u<$_fx*cYm%*}r*2G$k4kxfz(dC=^Ix5X%e81Y5I5))%I(eL&$+~Na?Uvj^E z_jk_uopaCkJNNjc|X-eoyjnsOYdb ztUF!_Uk@ziu5n1Q@nyvIXzXT{Po(w4V_Yu@7)*S zg9B};q#Tdtqumu<46AUtDhr`&Hwp2Pq~Iq?dZt^)OIPCgTQi+zWp>W4w9b_(FVB}N z2j{FtEk-#!*Fy~z%H26niB7_rF|!sb70-M_F(f>1(_Q!E9N^ojDDy7xd6m!Scbj~E znnmHh_$WXAVZp5^> zA-W-xhAlSjjs4dNy=i#TLLm)5=GS)hXdhEkk8e8+6^8v?9cpHnsf6{#IJP$x6J=Zi z#%`oBta{@#v)_OP0wwCkGtBrY1La1pfpMU>70T@`Ua!~vdR&V19pIxvcaa{ytpq2| zd;<=wonW>YHDct;p$2VLV8zUHj1kXg8LRq>16UJg2z8v{phC-1rJZazGYV$x*bE~$ z%0Z=uwLCJcA9XFec{o_BCThWHf}P!X_A*psD^loU9W1<9()&;zxOW)pF*ybe_-htQ z)uSnxuEU?2pd4qOVQknl0Zw&?*i@X`{T63$uxA}#5k?L{RFJX2UB2Chu(ul6W*Bw z5%ZJGCj2f7W%%wGl-j5UR<;XsO$MiJCF1g%@q;o(FB2DJD8Vz6z_v8jZ{M~&wS<>x zfiAZ!Mg@1TUiIp0pshAzjxYot?4p{vcZsp6uTH^5Qv;n6Zh1^(A)0892YFeH$6WeA zP{9q+hsC8PrV_VI!)83`HMrKYY!SUS4Q=bRVbFwG{Ry}+_W~7kZ5GzyiSHQ>JG0<) z(vN)DN+HG{iU@n3CoVcIE6_oCAk*w5%DK*G&4f+XXQ) zvK3+5cEQvwovD^x4@pc+d$*_4=_v5^cFKnFJ5l2&b=Wq(x^4ii!4g#*T-au?Py?h; z!tH1e^P}?S!VBABenduf52)!8*P~VO(cjVTicQ7SRmG{`j3S+AHRw+_(cVxp9bP+5X()w0TGMiU-hTRWtwq)|Lxr)7i{-ou=i(rZxjx8x?lFCneeG9>_>w8Zz z*+DX-iB9szgj*S$UV3|%{3ht)NG2{Hkz-h)=i>0akxP(%-6Odi+I(bjDKteUaM}zy zsXHCaN<43ZG<+;TDvk&&(`|&L2#tSmm9W-E$dMVo%3-z&0WM>O2~s8IxUYnwW}JKn z=~(Dy$$f#uN-a6C(IAZtLcoY`W?@V^HV4&!`$G_ifq6(k{}|L`xRg_1MT92IgBm^0 zKqK9J0=r7I1fa$w42WIMc9$r$_6gaRth_#_Tgbaioo6>HxNWmYnw}~tP`?ot@T;uD&Aj?pI5*w l?W{lsA%000gpZ3U*R3bMl>NML@L{iDvw7A$GV1 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;