From 6008a6104e0bb9b36d9f911cd3c9a5911ee90c81 Mon Sep 17 00:00:00 2001 From: second_coming Date: Wed, 24 Aug 2016 14:48:33 +0100 Subject: [PATCH] V61 Fixes --- pre-packaged pbo/a3_exile_occupation.pbo | Bin 214008 -> 216274 bytes source/a3_exile_occupation/changeLog.txt | 6 +++ source/a3_exile_occupation/config.cpp | 2 +- source/a3_exile_occupation/config.sqf | 19 +++----- .../scripts/eventHandlers/getIn.sqf | 1 + .../scripts/eventHandlers/hitLand.sqf | 31 +++++++------ .../eventHandlers/vehicleDestroyed.sqf | 41 ++++++++++++------ .../scripts/functions/fnc_unstick.sqf | 7 +-- .../scripts/occupationLootCrates.sqf | 2 +- .../scripts/occupationMilitary.sqf | 19 ++++++-- .../scripts/occupationMonitor.sqf | 32 ++++++++++++++ .../scripts/occupationSea.sqf | 4 +- .../scripts/occupationSky.sqf | 8 +++- .../scripts/occupationVehicle.sqf | 18 +++++--- 14 files changed, 131 insertions(+), 59 deletions(-) diff --git a/pre-packaged pbo/a3_exile_occupation.pbo b/pre-packaged pbo/a3_exile_occupation.pbo index 3786e13a1cc7702f3662694c811a8e3e83ac72d3..9866242891844c263ae817762abca00d59a94da1 100644 GIT binary patch delta 2535 zcmeHIT}%{L6z1LqVFq_$S$=duxGW;SR?yWF2`CuqP0^UW{))+-0Bdm^@*<#EOu=|AJSS-yAY>_RWy9YAq$J}DFsf{#Ty0!Bdp zfEk!a-Tecjvzw-hYbQN6yPA&+Z7ZFo>7%PBJu98mlmV9lm~|M|iz%k_+rVkh z#T4pHhh;ow)i<$VQ;JNVzv{F{DbjuF0?SO>@TA$wo%ReHW=LtFM}n4v);o*LBSkNr z@!V1E@vqo25=~3}=O;ZGiLudmgly+c?6|LK)Om+G8b3>2f02#dNO&KmmRZdBUnwDd z4{tYOSL{L}i)}fRwQZ+`X>35|`RD1km6d27nQ(r; zpa@ck6N%Erb8Qh)?Bha33X%DCzP*J;@Y^__A|`i}EepZ%XFpOtT9gB+1tKyuy*fd0HCNN4 zbiqUe+N||BP%i%0KpfK`I>a;%P@E`ylZh@BPZmTO()B>~dPBogZlZmdg&Go}YYf|R znHthWYudQND+-7JaJL1djT$*f@Oq2alQ~)FNnl-e?C`<{yIY} zLxCBn8^a~Et{$^^2#?{6%y2Z)TF?2~$P_Q518`&vFGx1xdMR!5Y-VGfAiK!Cd1MM{ zn#2?i(_?g>VIH~;@@OPxe;z7HVwn42YB#nD;d{*goUvZw6!U@~kx}m(Tpq`zP9vk9 zwU>_QO3v4MZx*#Xxu_F8?iaYASCoSK2)ENgYH~G6K3_C!^r1nbFI$qEiC5vI9<0uQ08nEp{1-P08yBp`gh#O}i z(+7h?C{?T5hjwM_7omMJf zC{d?P$r>LP`cfZBB1wymqc%Sb)5dEP1$b`?^o`*;aCQ-12orQ zu%*y46Gj>^1Bdq`I|y!^A5X9U!J5J5#(57F3`ZKURhzLGFV27$c2J#Iwj3qH?s}>d z;T>ou1nW_TzKe$@z|0()mGMStM+hg1Qr8NZ?^+vL+ukm<2qF)c*Wh$*^%M9F1Qi=l zlJ?`1_@x;}9qNs*@?kll4A;!XTeZ7S;iNnu=g=$|c4H?S62x*{9Gk1P1R39Q!mUBv z2tqHeg6>^-3+xu~ayZt3GvRQaB^xZy;mlmZvUJpZRNR$fol%5%4P_`HH8rFHpbamD zE4ygtvfFU6Huf@pHX)vRDxqKqcN#nGogvIK_DN)h?PYl?ifj+Odl37Rrp(Z>6&Jvs zeK;*=y`&I6Bt?U*#Lu;JL7pfQ@e2`M3ZUtAyhZCcgfHhBl-uNNU-M5CWUl`us_Xmt+3+4a- delta 1404 zcmY+Ce@t6d6vw&uwT1WAzP1B83JG4yfLWkWaL&*`mN2tK=V0qxGY591Ji2GQ7WxBS z2m_47h;dnZ@Ysdu-}W-pe_k z?>Xn5d+z=5q~YP)hT#}LRi2@&kxNO>RQa(1YsoaVPNIwqen@xJIXG=*`wan$DCvC&J7Hmu1$mB4;ymp%LTS?Ed zNm^p1)ZDtoa&0x)Geo7)V|YqNFep~q>LI=4NAs~#nO>k-b!diww^p!?IIlOZuCa{ z{zT_tckr+@KbIpl_UEii%QY@e*|x9E!lnIM#h2c@o2MmdSz5SUsBcxR;s*sH27S>)jI_}&AjD%N7Ekzt zBoZcT&2qi2RO4(eN_AdbWu?1w*{Q^wdHd(ns9-(JThKeu=|*mt%tHy;oQpm}|3aC< zZ3ww!E+4&=DR0<_LP-9*1o`7|dIFi@z&PUJ${5OrH^-1oUL8Xd1@ae{(9asUdJMe) zpPoRxeD6zC$il*RC>ws5!8-W*D%zmNuUtj3c6r#2hm9LZJ)z?ZiQU3p;h^Xb2{BSm zoG#GR;UJu=!-be-q53R#fLzHKp?MEx)7zWj_c~kze^xU3C+t5h!D=OwqX@F>!kcs9 z`$?Py6{k>^+`kJ?A(+l(bWkuuiQUZ+ z!anK2)j)RReCUnRYG+6B0j;)yR6A;c8^_(ohI-;{r!Ora><|x$arv!rEU;Xwi{*Mb zfj(I94&qWcG=a^Aosl?+3Y|VNDux3fpQT;24dP-&Jh(Q>I#S{!YCUS!5Fs28!vZyH zNk>8m?eT?!)Op5M;q6vu|HRm)G*RJIGah^Cq&Q7d{Z-UMm&tKz#(f*oz*pr=Cfh?tq>Ks*uAx#>CE5SD zEt<)(VA_bD);vzMX_aue{QHdcn>3)k2mbPKD@{%wa7UwfyopVs*L{sD>cxaR-> diff --git a/source/a3_exile_occupation/changeLog.txt b/source/a3_exile_occupation/changeLog.txt index a5e69d9..1cc773c 100644 --- a/source/a3_exile_occupation/changeLog.txt +++ b/source/a3_exile_occupation/changeLog.txt @@ -1,3 +1,9 @@ +================================================================================= +V61 (24-08-2016) +================================================================================= +Fixes for the eventhandler on ground vehicles that were causing server freezing +other additional tweaks (can't remember exactly what :o ) + ================================================================================= V60 (15-08-2016) ================================================================================= diff --git a/source/a3_exile_occupation/config.cpp b/source/a3_exile_occupation/config.cpp index 1a075cb..86e8dd1 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 = "V60 (15-08-2016)"; + a3_exile_occupation_version = "V61 (24-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 1683c9f..d5c4b25 100644 --- a/source/a3_exile_occupation/config.sqf +++ b/source/a3_exile_occupation/config.sqf @@ -46,7 +46,7 @@ SC_occupyStatic = false; // true if you want to add AI in specifi SC_occupyTransport = true; // true if you want pubic transport (travels between traders) SC_occupyLootCrates = true; // true if you want to have random loot crates with guards SC_occupyRandomSpawn = true; // (WORK IN PROGRESS) true if you want random spawning AI that hunt for nearby players -SC_occupyMilitary = true; // true if you want military buildings patrolled +SC_occupyMilitary = false; // true if you want military buildings patrolled SC_occupyVehicle = true; // true if you want to have roaming AI land 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 @@ -243,11 +243,11 @@ SC_maximumCrewAmount = 3; // Maximum amount of AI allowed in a vehi ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SC_maxNumberofVehicles = 3; // How many roaming vehicles to spawn -SC_occupyVehicleIgnoreCount = false; // true if you want spawn vehicles regardless of overall AI count +SC_occupyVehicleIgnoreCount = true; // true if you want spawn vehicles regardless of overall AI count SC_occupyVehiclesLocked = false; // true if AI vehicles to stay locked until all the linked AI are dead SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) -SC_occupyVehicleUseFixedPos = false; // True if you want to specify the patrol positions and radius of the area to patrol / false for random +SC_occupyVehicleUseFixedPos = true; // True if you want to specify the patrol positions and radius of the area to patrol / false for random // if you set SC_maxNumberofVehicles higher than the number of static positions, the remainder will be random // they will also ignore any blacklisted areas @@ -397,16 +397,6 @@ SC_BanditBackpack = ["B_HuntingBackpack","B_Kitbag_cbr","B_Kitbag_mca // Map Specific Overrides ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -if (worldName == 'Namalsk' AND SC_useMapOverrides) then -{ - SC_maxAIcount = 80; - SC_occupySky = false; - SC_maxNumberofVehicles = 2; - SC_numberofLootCrates = 3; - SC_numberofHeliCrashes = 2; - SC_maxNumberofBoats = 1; - SC_occupyTransportClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk -}; if (worldName == 'Napf' AND SC_useMapOverrides) then { @@ -423,6 +413,7 @@ if (worldName == 'Chernarus' AND SC_useMapOverrides) then if (worldName == 'Tanoa' AND SC_useMapOverrides) then { SC_useApexClasses = true; + SC_maxAIcount = 80; }; @@ -460,7 +451,7 @@ if (SC_debug) then SC_processReporter = true; SC_mapMarkers = true; SC_occupyPlaces = true; - SC_occupyVehicle = true; + SC_occupyVehicle = false; SC_occupyMilitary = true; SC_occupyRandomSpawn = true; SC_occupyStatic = false; diff --git a/source/a3_exile_occupation/scripts/eventHandlers/getIn.sqf b/source/a3_exile_occupation/scripts/eventHandlers/getIn.sqf index e5776bf..2e00eef 100644 --- a/source/a3_exile_occupation/scripts/eventHandlers/getIn.sqf +++ b/source/a3_exile_occupation/scripts/eventHandlers/getIn.sqf @@ -11,6 +11,7 @@ if(isPlayer _unit) then if(!alive _x) then { _x action ["EJECT", _vehicle]; }; }forEach units _group; + _vehicle setVariable ["SC_vehicleSpawnLocation", nil,true]; [_vehicle] call SC_fnc_vehicleDestroyed; if(SC_extendedLogging) then diff --git a/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf b/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf index ad07965..7f24993 100644 --- a/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf +++ b/source/a3_exile_occupation/scripts/eventHandlers/hitLand.sqf @@ -7,25 +7,28 @@ _repairStatus = _vehicle getVariable "SC_repairStatus"; if(_repairStatus) exitWith {}; // Mark the vehicle as currently being repaired -_vehicle setVariable ["SC_repairStatus",true]; +_vehicle setVariable ["SC_repairStatus",true,true]; _vehicleDamage = damage _vehicle; _damagedWheels = 0; -_damageLimit = 1; +_damageLimit = 0.2; _engineDamage = false; _fueltankDamage = false; _wheelDamage = false; _assignedDriver = _vehicle getVariable "SC_assignedDriver"; +_group = group _vehicle; + +// Remove dead units from the group +{ + if(!alive _x) then { [_x] join grpNull; }; +}forEach units _group; + +if(count(units _group) == 0) exitWith { [_vehicle] call SC_fnc_vehicleDestroyed; }; if(isNil "_assignedDriver") then { - _group = group _vehicle; - - // Remove dead units from the group - { - if(!alive _x) then { [_x] join grpNull; }; - }forEach units _group; + _groupMembers = units _group; _assignedDriver = _groupMembers call BIS_fnc_selectRandom; @@ -59,12 +62,12 @@ _wheels = ["HitLFWheel","HitLF2Wheel","HitRFWheel","HitRF2Wheel","HitLBWheel","H _logDetail = format ["[OCCUPATION:repairVehicle]:: Vehicle %1 checking wheel %2 (damage: %4) @ %3",_vehicle, _x, time,_partDamage]; [_logDetail] call SC_fnc_log; }; - if(_partDamage > 0.3) then { _wheelDamage = true; }; + if(_partDamage == 1) then { _wheelDamage = true; }; }; } forEach _wheels; // Check Engine -if ((_vehicle getHitPointDamage "HitEngine") >= _damageLimit) then { _engineDamage = true; }; +if ((_vehicle getHitPointDamage "HitEngine") == 1) then { _engineDamage = true; }; // Check Fuel Tank if ((_vehicle getHitPointDamage "HitFuel") > 0) then { _fueltankDamage = true; }; @@ -131,12 +134,12 @@ if(_wheelDamage OR _engineDamage OR _fueltankDamage) then _driver enableAI "FSM"; }; // Mark the vehicle as not currently being repaired - _vehicle setVariable ["SC_repairStatus",false]; + _vehicle setVariable ["SC_repairStatus",false,true]; } else { - _logDetail = format ["[OCCUPATION:repairVehicle]:: Not repairing %2, driver is %3 at %1",time,_vehicle,_assignedDriver]; + // Mark the vehicle as not currently being repaired + _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; - _logDetail = format ["[OCCUPATION:repairVehicle]:: Vehicle: %1 damage: %2 engine: %3 fuelTank: %4",_vehicle,_vehicleDamage,_engineDamage,_fueltankDamage]; - [_logDetail] call SC_fnc_log; }; \ No newline at end of file diff --git a/source/a3_exile_occupation/scripts/eventHandlers/vehicleDestroyed.sqf b/source/a3_exile_occupation/scripts/eventHandlers/vehicleDestroyed.sqf index 5086c52..e1755e2 100644 --- a/source/a3_exile_occupation/scripts/eventHandlers/vehicleDestroyed.sqf +++ b/source/a3_exile_occupation/scripts/eventHandlers/vehicleDestroyed.sqf @@ -5,20 +5,33 @@ if((damage _vehicle) < 1) then _vehicle removeAllMPEventHandlers "mphit"; }; -if(_vehicle isKindOf "LandVehicle") then +SC_liveVehiclesArray = []; +SC_liveHelisArray = []; +SC_liveBoatsArray = []; + { - SC_liveVehiclesArray = SC_liveVehiclesArray - [_vehicle]; - SC_liveVehicles = count(SC_liveVehiclesArray); -}; + _vehicle = _x; + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _transport = _x getVariable "SC_transport"; -if(_vehicle isKindOf "Air") then -{ - SC_liveHelisArray = SC_liveHelisArray - [_vehicle]; - SC_liveHelis = count(SC_liveHelisArray); -}; + if(!isNil "_vehLocation") then + { + if(_vehicle isKindOf "LandVehicle") then + { + SC_liveVehiclesArray pushBack _vehicle; + SC_liveVehicles = count(SC_liveVehiclesArray); + }; -if(_vehicle isKindOf "Ship") then -{ - SC_liveBoatsArray = SC_liveBoatsArray - [_vehicle]; - SC_liveBoatss = count(SC_liveBoatsArray); -}; + if(_vehicle isKindOf "Air" && isNil "_transport") then + { + SC_liveHelisArray pushBack _vehicle; + SC_liveHelis = count(SC_liveHelisArray); + }; + + if(_vehicle isKindOf "Ship") then + { + SC_liveBoatsArray pushBack _vehicle; + SC_liveBoatss = count(SC_liveBoatsArray); + }; + }; +}forEach vehicles; \ No newline at end of file diff --git a/source/a3_exile_occupation/scripts/functions/fnc_unstick.sqf b/source/a3_exile_occupation/scripts/functions/fnc_unstick.sqf index bd68940..2bb003e 100644 --- a/source/a3_exile_occupation/scripts/functions/fnc_unstick.sqf +++ b/source/a3_exile_occupation/scripts/functions/fnc_unstick.sqf @@ -87,7 +87,7 @@ if(count(crew _vehicle) > 0)then _unit enableAI "MOVE"; reload _unit; }foreach units _group; - + deleteGroup _group; _GroupLeader = leader (group _vehicle); _GroupLeader doMove _originalSpawnLocation; @@ -103,10 +103,11 @@ if(count(crew _vehicle) > 0)then _vehicle setVariable["vehPos",_newPos]; }; -if(count units _group > 0) then +if(count units _group == 0) then { _vehicle lock 0; _vehicle setVehicleLock "UNLOCKED"; - _vehicle setVariable ["ExileIsLocked", 0, true]; + _vehicle setVariable ["ExileIsLocked", 0, true]; + [_vehicle] call SC_fnc_vehicleDestroyed; }; diff --git a/source/a3_exile_occupation/scripts/occupationLootCrates.sqf b/source/a3_exile_occupation/scripts/occupationLootCrates.sqf index 29493b9..1e74d89 100644 --- a/source/a3_exile_occupation/scripts/occupationLootCrates.sqf +++ b/source/a3_exile_occupation/scripts/occupationLootCrates.sqf @@ -90,7 +90,7 @@ for "_i" from 1 to SC_numberofLootCrates do [_unit] joinSilent _group; _unit setCaptive false; }foreach units _initialGroup; - + deleteGroup _initialGroup; [_group, _spawnPosition, 100] call bis_fnc_taskPatrol; _group setBehaviour "STEALTH"; diff --git a/source/a3_exile_occupation/scripts/occupationMilitary.sqf b/source/a3_exile_occupation/scripts/occupationMilitary.sqf index 13e714c..fc63e25 100644 --- a/source/a3_exile_occupation/scripts/occupationMilitary.sqf +++ b/source/a3_exile_occupation/scripts/occupationMilitary.sqf @@ -107,9 +107,15 @@ if(_aiActive > _maxAIcount) exitWith if(!SC_useWaypoints) then { DMS_ai_use_launchers = false; - _group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup; + _groupInitial = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = _useLaunchers; + _group = createGroup SC_BanditSide; + _group setVariable ["DMS_AllowFreezing",true]; + _group setVariable ["DMS_LockLocality",false]; + _group setVariable ["DMS_SpawnedGroup",true]; + _group setVariable ["DMS_Group_Side", "bandit"]; + { _unit = _x; [_unit] joinSilent grpNull; @@ -132,9 +138,15 @@ if(_aiActive > _maxAIcount) exitWith { DMS_ai_use_launchers = false; - _group = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup; + _groupInitial = [_spawnPosition, _aiCount, _difficulty, "random", "bandit"] call DMS_fnc_SpawnAIGroup; DMS_ai_use_launchers = _useLaunchers; + _group = createGroup SC_BanditSide; + _group setVariable ["DMS_AllowFreezing",true]; + _group setVariable ["DMS_LockLocality",false]; + _group setVariable ["DMS_SpawnedGroup",true]; + _group setVariable ["DMS_Group_Side", "bandit"]; + { _unit = _x; [_unit] joinSilent grpNull; @@ -146,7 +158,8 @@ if(_aiActive > _maxAIcount) exitWith _tag = createVehicle ["Sign_Arrow_Blue_F", position _unit, [], 0, "CAN_COLLIDE"]; _tag attachTo [_unit,[0,0,0.6],"Head"]; }; - }foreach units _group; + }foreach units _groupInitial; + deleteGroup _groupInitial; [ _group,_pos,_difficulty,"STEALTH" ] call DMS_fnc_SetGroupBehavior; diff --git a/source/a3_exile_occupation/scripts/occupationMonitor.sqf b/source/a3_exile_occupation/scripts/occupationMonitor.sqf index fa4c53d..7a24dca 100644 --- a/source/a3_exile_occupation/scripts/occupationMonitor.sqf +++ b/source/a3_exile_occupation/scripts/occupationMonitor.sqf @@ -1,6 +1,37 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time]; [_logDetail] call SC_fnc_log; +SC_liveVehiclesArray = []; +SC_liveHelisArray = []; +SC_liveBoatsArray = []; + +{ + _vehicle = _x; + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _transport = _x getVariable "SC_transport"; + + if(!isNil "_vehLocation") then + { + if(_vehicle isKindOf "LandVehicle") then + { + SC_liveVehiclesArray pushBack _vehicle; + SC_liveVehicles = count(SC_liveVehiclesArray); + }; + + if(_vehicle isKindOf "Air" && isNil "_transport") then + { + SC_liveHelisArray pushBack _vehicle; + SC_liveHelis = count(SC_liveHelisArray); + }; + + if(_vehicle isKindOf "Ship") then + { + SC_liveBoatsArray pushBack _vehicle; + SC_liveBoatss = count(SC_liveBoatsArray); + }; + }; +}forEach vehicles; + SC_liveHelis = count(SC_liveHelisArray); { if(isNull _x) exitWith { SC_liveHelisArray = SC_liveHelisArray - [_x]; }; @@ -10,6 +41,7 @@ SC_liveHelis = count(SC_liveHelisArray); sleep 2; _tempLocation = _x getVariable "SC_vehicleSpawnLocation"; _originalSpawnLocation = _tempLocation select 0; + diag_log format ["[occupationMonitor] _tempLocation: %1 _originalSpawnLocation: %2",_tempLocation,_originalSpawnLocation]; _radius = _tempLocation select 1; _pos = position _x; diff --git a/source/a3_exile_occupation/scripts/occupationSea.sqf b/source/a3_exile_occupation/scripts/occupationSea.sqf index d54ad1f..083ffb5 100644 --- a/source/a3_exile_occupation/scripts/occupationSea.sqf +++ b/source/a3_exile_occupation/scripts/occupationSea.sqf @@ -110,7 +110,9 @@ for "_i" from 1 to _vehiclesToSpawn do _vehicle setPosASL _spawnLocation; _vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; + + _SC_vehicleSpawnLocation = [_spawnLocation,_radius,worldName]; + _vehicle setVariable ["SC_vehicleSpawnLocation", _SC_vehicleSpawnLocation,true]; // Remove the overpowered weapons from boats _vehicle removeWeaponTurret ["HMG_01",[0]]; diff --git a/source/a3_exile_occupation/scripts/occupationSky.sqf b/source/a3_exile_occupation/scripts/occupationSky.sqf index 19211d0..97f09c6 100644 --- a/source/a3_exile_occupation/scripts/occupationSky.sqf +++ b/source/a3_exile_occupation/scripts/occupationSky.sqf @@ -27,6 +27,8 @@ if(_aiActive > _maxAIcount) exitWith [_logDetail] call SC_fnc_log; }; +SC_liveHelis = count(SC_liveHelisArray); + if(SC_liveHelis >= SC_maxNumberofHelis) exitWith { if(SC_extendedLogging) then @@ -73,7 +75,7 @@ for "_i" from 1 to _vehiclesToSpawn do if(SC_occupyHeliUseFixedPos) then { { - _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; + _vehLocation = _x getVariable "SC_vehicleSpawnLocation"; _locationArray = _locationArray - _vehLocation; }forEach SC_liveHelisArray; @@ -138,7 +140,9 @@ for "_i" from 1 to _vehiclesToSpawn do _group addVehicle _vehicle; _vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; + _SC_vehicleSpawnLocation = [_spawnLocation,_radius,worldName]; + diag_log format ["[occupationSky] _SC_vehicleSpawnLocation: %1",_SC_vehicleSpawnLocation]; + _vehicle setVariable ["SC_vehicleSpawnLocation", _SC_vehicleSpawnLocation,true]; SC_liveHelis = SC_liveHelis + 1; SC_liveHelisArray = SC_liveHelisArray + [_vehicle]; diff --git a/source/a3_exile_occupation/scripts/occupationVehicle.sqf b/source/a3_exile_occupation/scripts/occupationVehicle.sqf index 62d6d51..2fa20d1 100644 --- a/source/a3_exile_occupation/scripts/occupationVehicle.sqf +++ b/source/a3_exile_occupation/scripts/occupationVehicle.sqf @@ -28,6 +28,8 @@ if((_aiActive > _maxAIcount) && !SC_occupyVehicleIgnoreCount) exitWith [_logDetail] call SC_fnc_log; }; +SC_liveVehicles = count(SC_liveVehiclesArray); + if(SC_liveVehicles >= SC_maxNumberofVehicles) exitWith { _logDetail = format['[OCCUPATION:Vehicle] End check %1 currently active (max %2) @ %3',SC_liveVehicles,SC_maxNumberofVehicles,time]; @@ -143,13 +145,13 @@ if(_vehiclesToSpawn > 0) then { _group addVehicle _vehicle; - SC_liveVehicles = SC_liveVehicles + 1; SC_liveVehiclesArray = SC_liveVehiclesArray + [_vehicle]; - _vehicle setVariable ["vehPos",_spawnLocation,true]; - _vehicle setVariable ["SC_repairStatus",false]; + _vehicle setVariable ["SC_repairStatus",false,true]; + _vehicle setVariable ["vehPos",_spawnLocation,true]; _vehicle setVariable ["vehClass",_VehicleClassToUse,true]; - _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; + _SC_vehicleSpawnLocation = [_spawnLocation,_radius,worldName]; + _vehicle setVariable ["SC_vehicleSpawnLocation", _SC_vehicleSpawnLocation,true]; _vehicle setFuel 1; _vehicle engineOn true; @@ -257,6 +259,10 @@ if(_vehiclesToSpawn > 0) then _unit = _x; _unit enableAI "FSM"; _unit enableAI "MOVE"; + _unit enableAI "TARGET"; + _unit enableAI "AUTOTARGET"; + _unit enableAI "AUTOCOMBAT"; + _unit allowCrewInImmobile false; reload _unit; _unitName = [_side] call SC_fnc_selectName; if(!isNil "_unitName") then { _unit setName _unitName; }; @@ -267,7 +273,7 @@ if(_vehiclesToSpawn > 0) then sleep 10; [_group, _spawnLocation, 2000] call bis_fnc_taskPatrol; - _group setBehaviour "SAFE"; + _group setBehaviour "AWARE"; _group setCombatMode "RED"; sleep 0.2; @@ -309,6 +315,6 @@ if(_vehiclesToSpawn > 0) then }; }; }; - +SC_liveVehicles = count(SC_liveVehiclesArray); _logDetail = format['[OCCUPATION:Vehicle] End check %1 currently active (max %2) @ %3',SC_liveVehicles,SC_maxNumberofVehicles,time]; [_logDetail] call SC_fnc_log; \ No newline at end of file