From 76c4f3d56c5fb328c0a5f1fe1590ba11cf2f632a Mon Sep 17 00:00:00 2001 From: nomisum Date: Wed, 9 Aug 2023 17:36:31 +0200 Subject: [PATCH 1/2] Update CfgDigVehicles.hpp --- addons/functions/CfgDigVehicles.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/functions/CfgDigVehicles.hpp b/addons/functions/CfgDigVehicles.hpp index cde9fa3..04dd540 100644 --- a/addons/functions/CfgDigVehicles.hpp +++ b/addons/functions/CfgDigVehicles.hpp @@ -55,4 +55,13 @@ class CfgDigVehicles { class gm_dk_army_bpz2a0_un : gm_dk_army_bpz2a0 {}; class gm_dk_army_bpz2a0_wdl : gm_dk_army_bpz2a0 {}; class gm_dk_army_bpz2a0_win : gm_dk_army_bpz2a0 {}; + + class PRACS_M88 { + type = "animate"; + animation = "blade_elev_source"; + selection = "Blade"; + plowRaised = 0; + plowLowered = 0.9; + distanceToTrench = 3; + }; }; From 9fc58eb5c855fe7953e0138edeb80fd1618eba8e Mon Sep 17 00:00:00 2001 From: Salbei Date: Sun, 3 Sep 2023 15:28:01 +0200 Subject: [PATCH 2/2] fixed plow --- addons/functions/CfgDigVehicles.hpp | 4 +- .../functions/functions/fnc_vehicleAction.sqf | 38 +------------------ 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/addons/functions/CfgDigVehicles.hpp b/addons/functions/CfgDigVehicles.hpp index 04dd540..4627b80 100644 --- a/addons/functions/CfgDigVehicles.hpp +++ b/addons/functions/CfgDigVehicles.hpp @@ -58,10 +58,10 @@ class CfgDigVehicles { class PRACS_M88 { type = "animate"; - animation = "blade_elev_source"; + animation = "Blade"; selection = "Blade"; plowRaised = 0; - plowLowered = 0.9; + plowLowered = 0.93; distanceToTrench = 3; }; }; diff --git a/addons/functions/functions/fnc_vehicleAction.sqf b/addons/functions/functions/fnc_vehicleAction.sqf index 6378322..035636f 100644 --- a/addons/functions/functions/fnc_vehicleAction.sqf +++ b/addons/functions/functions/fnc_vehicleAction.sqf @@ -17,43 +17,6 @@ if (isServer) then { [_vehicle] call FUNC(vehicleTrenchBuild); }; -// needs to be local to driver, thats why everyone get this -/* -_vehicle addEventHandler ["EpeContactStart", { - params ["_object1", "_object2", "_selection1", "_selection2", "_force"]; - - if (typeOf _object2 != "GRAD_envelope_vehicle") exitWith {}; - if (!(_object1 getVariable ["grad_trenches_functions_plowlowered", 0])) exitWith {}; - - private _dir1 = getDir _object1; - private _dir2 = getDir _object2; - private _config = configFile >> "CfgDigVehicles" >> typeOf _object1; - private _distanceToTrench = getNumber (_config >> "distanceToTrench"); - - if ((abs(_dir1 - _dir2)) > 15) exitWith { systemchat "angle not fitting"; }; - - // if vehicle is inside trench - if ((getPos _object1) inArea [(_object2 modelToWorld [-0.15,-_distanceToTrench,0]), 1, 1, getDir _object2, true, -1]) then { - - // check which trench is larger and attach the larger one, delete the other - private _trench = _object1 getVariable ["grad_trenches_functions_trenchDigged", objNull]; - private _actualProgress = _trench getVariable ["ace_trenches_progress", 0]; - - if (_object2 getVariable ["ace_trenches_progress", 0] > _actualProgress) then { - deleteVehicle _trench; - _object2 attachTo [_object1, [-0.15,_distanceToTrench,-5]]; - _object1 setVariable ["grad_trenches_functions_isDigging", true, true]; - _object1 setVariable ["grad_trenches_functions_trenchDigged", _object2, true]; - } else { - deleteVehicle _object2; - _trench attachTo [_object1, [-0.15,_distanceToTrench,-5]]; - _object1 setVariable ["grad_trenches_functions_isDigging", true, true]; - _object1 setVariable ["grad_trenches_functions_trenchDigged", _trench, true]; - }; - }; -}]; -*/ - if (hasInterface) then { _vehicle addAction [ "Lower Plow", @@ -69,6 +32,7 @@ if (hasInterface) then { } else { _target animatesource [_animation, _plowLowered]; }; + _target setCruiseControl [7, false]; _target setVariable ["grad_trenches_functions_plowlowered", -1, true]; // animating state to prevent multi execution