From 603a841c39ae7213498a8b524a1cfa47ef5f630f Mon Sep 17 00:00:00 2001 From: NeutraleNull Date: Wed, 28 Sep 2022 02:07:09 +0200 Subject: [PATCH 1/5] added simple arty calculator --- description.ext | 1 + scripts/easyarty/funcs.hpp | 12 ++++ scripts/easyarty/functions/fn_calculate.sqf | 46 +++++++++++++ scripts/easyarty/functions/fn_postInit.sqf | 64 +++++++++++++++++++ scripts/easyarty/functions/fn_preInit.sqf | 0 .../easyarty/functions/fn_setTargetPos.sqf | 17 +++++ scripts/easyarty/functions/fn_start.sqf | 22 +++++++ scripts/easyarty/functions/fn_stop.sqf | 7 ++ 8 files changed, 169 insertions(+) create mode 100644 scripts/easyarty/funcs.hpp create mode 100644 scripts/easyarty/functions/fn_calculate.sqf create mode 100644 scripts/easyarty/functions/fn_postInit.sqf create mode 100644 scripts/easyarty/functions/fn_preInit.sqf create mode 100644 scripts/easyarty/functions/fn_setTargetPos.sqf create mode 100644 scripts/easyarty/functions/fn_start.sqf create mode 100644 scripts/easyarty/functions/fn_stop.sqf diff --git a/description.ext b/description.ext index ee3f7db..38a7eb9 100644 --- a/description.ext +++ b/description.ext @@ -3,6 +3,7 @@ class CfgFunctions { #include "scripts\arsr\funcs.hpp" // enable sound directionfinder #include "scripts\stomper\funcs.hpp" // enable sitting on Stomper UGV #include "scripts\craters\funcs.hpp" // terrain deformation on artillery impacts + #include "scripts\easyarty\funcs.hpp" // easy azimuth and elevation calculation }; diff --git a/scripts/easyarty/funcs.hpp b/scripts/easyarty/funcs.hpp new file mode 100644 index 0000000..636e65a --- /dev/null +++ b/scripts/easyarty/funcs.hpp @@ -0,0 +1,12 @@ +class easyarty { + tag = "easyarty"; + class functions { + file = "scripts\easyarty\functions"; + class preInit{preInit = 1;}; + class postInit{postInit = 1;}; + class setTargetPos{}; + class calculate{}; + class start{}; + class stop{}; + }; +}; diff --git a/scripts/easyarty/functions/fn_calculate.sqf b/scripts/easyarty/functions/fn_calculate.sqf new file mode 100644 index 0000000..4b87ae1 --- /dev/null +++ b/scripts/easyarty/functions/fn_calculate.sqf @@ -0,0 +1,46 @@ +params ["_targetPos", "_vehicle"]; + +#define DEGREE_TO_MIL_FACTOR 17.7777777778 + +private _az = (_vehicle getDir _targetPos) * DEGREE_TO_MIL_FACTOR; + +_distanceToTarget = _vehicle distance artyTarget; +_distanceRounded = _distanceToTarget - _distanceToTarget % 100; +_distanceFactor = _distanceToTarget % 100 * -0.01; //used to scale later + +(ace_artillerytables_magModeData select ace_artillerytables_lastCharge) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; +_elevMin = 10; +_elevMax = 75; +_lastElevMode = true; //always shoot high for now + +private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,_lastElevMode]]; +private _status = 0; +private _result = []; + +while { _status != 3 } do { + _ret = ("ace_artillerytables" callExtension ["getline", []]); + _status = _ret select 1; + if (_status == 1) then { + _result pushBack parseSimpleArray (_ret select 0); + }; +}; + +_resultLength = count _result; + +if (_resultLength < 3) exitWith {[]}; + +private _minResult = parseNumber (_result select 0 select 0); +private _maxResult = parseNumber (_result select _resultLength-1 select 0); + +if (_distanceToTarget > _maxResult || {_distanceToTarget < _minResult}) exitWith { [] }; + +private _idxLower = (_distanceRounded - _minResult) / 100; +private _idxUpper = (_distanceRounded + 100 - _minResult) / 100; + +private _lSolution = _result select _idxLower; +private _uSolution = _result select _idxUpper; + +private _diffElevation = parseNumber (_lSolution select 1) - parseNumber (_uSolution select 1); +private _finalElevation = parseNumber (_lSolution select 1) + _diffElevation * _distanceFactor; + +[_finalElevation, _az, _distanceToTarget]; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_postInit.sqf b/scripts/easyarty/functions/fn_postInit.sqf new file mode 100644 index 0000000..83015f2 --- /dev/null +++ b/scripts/easyarty/functions/fn_postInit.sqf @@ -0,0 +1,64 @@ +if (isDedicated) exitWith {}; +easyArtyRunning = false; +easyArtyPfh = -1; +easyArtyDisplayEh = -1; + +private _spacerAction = [ + "spacerEasyArty", + "Easy Arty", + "", + {}, + {true} +] call ace_interact_menu_fnc_createAction; + +private _startAction = [ + "startEasyArty", + "Start calculate", + "", + {[] spawn easyarty_fnc_start;}, + {!easyArtyRunning} +] call ace_interact_menu_fnc_createAction; + +private _stopAction = [ + "stopEasyArty", + "Stop calculation", + "", + {[] call easyarty_fnc_stop;}, + {easyArtyRunning} +] call ace_interact_menu_fnc_createAction; + +private _assignPosAction = [ + "assingPosEasyArty", + "Assign new target", + "", + {[] spawn easyarty_fnc_setTargetPos;}, + {easyArtyRunning} +] call ace_interact_menu_fnc_createAction; + +[ + player, + 1, + ["ACE_SelfActions"], + _spacerAction +] call ace_interact_menu_fnc_addActionToObject; + +[ + player, + 1, + ["ACE_SelfActions", "spacerEasyArty"], + _startAction +] call ace_interact_menu_fnc_addActionToObject; + +[ + player, + 1, + ["ACE_SelfActions", "spacerEasyArty"], + _stopAction +] call ace_interact_menu_fnc_addActionToObject; + +[ + player, + 1, + ["ACE_SelfActions", "spacerEasyArty"], + _assignPosAction +] call ace_interact_menu_fnc_addActionToObject; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_preInit.sqf b/scripts/easyarty/functions/fn_preInit.sqf new file mode 100644 index 0000000..e69de29 diff --git a/scripts/easyarty/functions/fn_setTargetPos.sqf b/scripts/easyarty/functions/fn_setTargetPos.sqf new file mode 100644 index 0000000..4f87a21 --- /dev/null +++ b/scripts/easyarty/functions/fn_setTargetPos.sqf @@ -0,0 +1,17 @@ +openMap [true, true]; + +hint "Click on the map to place a target"; + +private _mapClickEh = addMissionEventHandler ["MapSingleClick", { + params ["", "_pos"]; + deleteMarker "target_loc"; + _marker = createMarkerLocal ["target_loc", _pos]; + _marker setMarkerType "HD_DOT"; + _marker setMarkerText "Target"; + artyTarget = _pos; + openMap [false, false]; +}]; + +waitUntil {!visibleMap}; + +removeMissionEventHandler ["MapSingleClick", _mapClickEh] \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_start.sqf b/scripts/easyarty/functions/fn_start.sqf new file mode 100644 index 0000000..13e3525 --- /dev/null +++ b/scripts/easyarty/functions/fn_start.sqf @@ -0,0 +1,22 @@ +if (easyArtyRunning) exitWith {}; +if (isNil "ace_artillerytables_magModeData") exitWith { hint "You must have chosen an artillery sheet!" }; + +call easyarty_fnc_setTargetPos; + +easyArtyDisplayEh = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", { + (_this select 0) drawLine [ + getPos player, + artyTarget, + [0,0,1,1] + ]; +}]; + +easyArtyPfh = [{ + private _solution = [artyTarget, vehicle player] call easyarty_fnc_calculate; + if (_solution isEqualTo []) exitwith { + hintSilent "No solution found. Please try another range card setting!"; + }; + hintSilent format ["=== SOLUTION ===\nDISTANCE: %1\nELEVATION: %2\nAZIMUTH: %3\n", _solution select 2, _solution select 0, _solution select 1]; +}, 1] call CBA_fnc_addPerFrameHandler; + +easyArtyRunning = true; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_stop.sqf b/scripts/easyarty/functions/fn_stop.sqf new file mode 100644 index 0000000..81c257c --- /dev/null +++ b/scripts/easyarty/functions/fn_stop.sqf @@ -0,0 +1,7 @@ +if (!easyArtyRunning) exitWith {}; + +easyArtyPfh call CBA_fnc_removePerFrameHandler; +(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", easyArtyDisplayEh]; +deleteMarker "target_loc"; + +easyArtyRunning = false; \ No newline at end of file From 03bec2082cfb6bc02526fb912ce4a0e1dc1965f5 Mon Sep 17 00:00:00 2001 From: NeutraleNull Date: Wed, 28 Sep 2022 13:41:45 +0200 Subject: [PATCH 2/5] updated code as suggested in PR review --- scripts/easyarty/funcs.hpp | 1 - scripts/easyarty/functions/fn_calculate.sqf | 15 +++-- scripts/easyarty/functions/fn_postInit.sqf | 59 ++++++++++--------- scripts/easyarty/functions/fn_preInit.sqf | 0 .../easyarty/functions/fn_setTargetPos.sqf | 10 ++-- scripts/easyarty/functions/fn_start.sqf | 14 ++--- scripts/easyarty/functions/fn_stop.sqf | 8 +-- 7 files changed, 55 insertions(+), 52 deletions(-) delete mode 100644 scripts/easyarty/functions/fn_preInit.sqf diff --git a/scripts/easyarty/funcs.hpp b/scripts/easyarty/funcs.hpp index 636e65a..681eaff 100644 --- a/scripts/easyarty/funcs.hpp +++ b/scripts/easyarty/funcs.hpp @@ -2,7 +2,6 @@ class easyarty { tag = "easyarty"; class functions { file = "scripts\easyarty\functions"; - class preInit{preInit = 1;}; class postInit{postInit = 1;}; class setTargetPos{}; class calculate{}; diff --git a/scripts/easyarty/functions/fn_calculate.sqf b/scripts/easyarty/functions/fn_calculate.sqf index 4b87ae1..4fde854 100644 --- a/scripts/easyarty/functions/fn_calculate.sqf +++ b/scripts/easyarty/functions/fn_calculate.sqf @@ -4,15 +4,14 @@ params ["_targetPos", "_vehicle"]; private _az = (_vehicle getDir _targetPos) * DEGREE_TO_MIL_FACTOR; -_distanceToTarget = _vehicle distance artyTarget; -_distanceRounded = _distanceToTarget - _distanceToTarget % 100; -_distanceFactor = _distanceToTarget % 100 * -0.01; //used to scale later +private _distanceToTarget = _vehicle distance artyTarget; +private _distanceRounded = _distanceToTarget - _distanceToTarget % 100; +private _distanceFactor = _distanceToTarget % 100 * -0.01; //used to scale later (ace_artillerytables_magModeData select ace_artillerytables_lastCharge) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; -_elevMin = 10; -_elevMax = 75; -_lastElevMode = true; //always shoot high for now - +private _elevMin = 10; +private _elevMax = 75; +private _lastElevMode = param [0, ace_artillerytables_lastElevationMode]; private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,_lastElevMode]]; private _status = 0; private _result = []; @@ -25,7 +24,7 @@ while { _status != 3 } do { }; }; -_resultLength = count _result; +private _resultLength = count _result; if (_resultLength < 3) exitWith {[]}; diff --git a/scripts/easyarty/functions/fn_postInit.sqf b/scripts/easyarty/functions/fn_postInit.sqf index 83015f2..635a1a5 100644 --- a/scripts/easyarty/functions/fn_postInit.sqf +++ b/scripts/easyarty/functions/fn_postInit.sqf @@ -1,10 +1,11 @@ -if (isDedicated) exitWith {}; -easyArtyRunning = false; -easyArtyPfh = -1; -easyArtyDisplayEh = -1; +if !(hasinterface) exitWith {}; + +easyarty_running = false; +easyarty_pfh = -1; +easyarty_displayEh = -1; private _spacerAction = [ - "spacerEasyArty", + "easyarty_spacer", "Easy Arty", "", {}, @@ -12,53 +13,57 @@ private _spacerAction = [ ] call ace_interact_menu_fnc_createAction; private _startAction = [ - "startEasyArty", + "easyarty_start", "Start calculate", "", {[] spawn easyarty_fnc_start;}, - {!easyArtyRunning} + {!easyarty_running} ] call ace_interact_menu_fnc_createAction; private _stopAction = [ - "stopEasyArty", + "easyarty_stop", "Stop calculation", "", {[] call easyarty_fnc_stop;}, - {easyArtyRunning} + {easyarty_running} ] call ace_interact_menu_fnc_createAction; -private _assignPosAction = [ - "assingPosEasyArty", +private _newTargetAction = [ + "easyarty_newTarget", "Assign new target", "", {[] spawn easyarty_fnc_setTargetPos;}, - {easyArtyRunning} + {easyarty_running} ] call ace_interact_menu_fnc_createAction; [ - player, + "Man", 1, ["ACE_SelfActions"], - _spacerAction -] call ace_interact_menu_fnc_addActionToObject; + _spacerAction, + true +] call ace_interact_menu_fnc_addActionToClass; [ - player, + "Man", 1, - ["ACE_SelfActions", "spacerEasyArty"], - _startAction -] call ace_interact_menu_fnc_addActionToObject; + ["ACE_SelfActions", "easyarty_spacer"], + _startAction, + true +] call ace_interact_menu_fnc_addActionToClass; [ - player, + "Man", 1, - ["ACE_SelfActions", "spacerEasyArty"], - _stopAction -] call ace_interact_menu_fnc_addActionToObject; + ["ACE_SelfActions", "easyarty_spacer"], + _stopAction, + true +] call ace_interact_menu_fnc_addActionToClass; [ - player, + "Man", 1, - ["ACE_SelfActions", "spacerEasyArty"], - _assignPosAction -] call ace_interact_menu_fnc_addActionToObject; \ No newline at end of file + ["ACE_SelfActions", "easyarty_spacer"], + _newTargetAction, + true +] call ace_interact_menu_fnc_addActionToClass; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_preInit.sqf b/scripts/easyarty/functions/fn_preInit.sqf deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/easyarty/functions/fn_setTargetPos.sqf b/scripts/easyarty/functions/fn_setTargetPos.sqf index 4f87a21..8155397 100644 --- a/scripts/easyarty/functions/fn_setTargetPos.sqf +++ b/scripts/easyarty/functions/fn_setTargetPos.sqf @@ -4,11 +4,11 @@ hint "Click on the map to place a target"; private _mapClickEh = addMissionEventHandler ["MapSingleClick", { params ["", "_pos"]; - deleteMarker "target_loc"; - _marker = createMarkerLocal ["target_loc", _pos]; - _marker setMarkerType "HD_DOT"; - _marker setMarkerText "Target"; - artyTarget = _pos; + deleteMarkerLocal "target_loc"; + private _marker = createMarkerLocal ["target_loc", _pos]; + _marker setMarkerTypeLocal "HD_DOT"; + _marker setMarkerTextLocal "Target"; + easyarty_target = _pos; openMap [false, false]; }]; diff --git a/scripts/easyarty/functions/fn_start.sqf b/scripts/easyarty/functions/fn_start.sqf index 13e3525..f30af18 100644 --- a/scripts/easyarty/functions/fn_start.sqf +++ b/scripts/easyarty/functions/fn_start.sqf @@ -1,22 +1,22 @@ -if (easyArtyRunning) exitWith {}; -if (isNil "ace_artillerytables_magModeData") exitWith { hint "You must have chosen an artillery sheet!" }; +if (easyarty_running) exitWith {}; +if (isNil "ace_artillerytables_magModeData") exitWith { hint "You must have chosen an artillery solution!" }; call easyarty_fnc_setTargetPos; -easyArtyDisplayEh = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", { +easyarty_displayEh = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", { (_this select 0) drawLine [ getPos player, - artyTarget, + easyarty_target, [0,0,1,1] ]; }]; -easyArtyPfh = [{ - private _solution = [artyTarget, vehicle player] call easyarty_fnc_calculate; +easyarty_pfh = [{ + private _solution = [easyarty_target, vehicle player] call easyarty_fnc_calculate; if (_solution isEqualTo []) exitwith { hintSilent "No solution found. Please try another range card setting!"; }; hintSilent format ["=== SOLUTION ===\nDISTANCE: %1\nELEVATION: %2\nAZIMUTH: %3\n", _solution select 2, _solution select 0, _solution select 1]; }, 1] call CBA_fnc_addPerFrameHandler; -easyArtyRunning = true; \ No newline at end of file +easyarty_running = true; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_stop.sqf b/scripts/easyarty/functions/fn_stop.sqf index 81c257c..ba4405d 100644 --- a/scripts/easyarty/functions/fn_stop.sqf +++ b/scripts/easyarty/functions/fn_stop.sqf @@ -1,7 +1,7 @@ -if (!easyArtyRunning) exitWith {}; +if (!easyarty_running) exitWith {}; -easyArtyPfh call CBA_fnc_removePerFrameHandler; -(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", easyArtyDisplayEh]; +easyarty_pfh call CBA_fnc_removePerFrameHandler; +(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", easyarty_displayEh]; deleteMarker "target_loc"; -easyArtyRunning = false; \ No newline at end of file +easyarty_running = false; \ No newline at end of file From db993277e6ece9e25e6a8cb351d784f826a27c50 Mon Sep 17 00:00:00 2001 From: NeutraleNull Date: Wed, 28 Sep 2022 13:43:59 +0200 Subject: [PATCH 3/5] amend missing change --- scripts/easyarty/functions/fn_stop.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/easyarty/functions/fn_stop.sqf b/scripts/easyarty/functions/fn_stop.sqf index ba4405d..5883331 100644 --- a/scripts/easyarty/functions/fn_stop.sqf +++ b/scripts/easyarty/functions/fn_stop.sqf @@ -2,6 +2,6 @@ if (!easyarty_running) exitWith {}; easyarty_pfh call CBA_fnc_removePerFrameHandler; (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", easyarty_displayEh]; -deleteMarker "target_loc"; +deleteMarkerLocal "target_loc"; easyarty_running = false; \ No newline at end of file From d0fdb2343cf1c805a4880e9c31e29cd7967d00d2 Mon Sep 17 00:00:00 2001 From: NeutraleNull Date: Wed, 28 Sep 2022 22:15:54 +0200 Subject: [PATCH 4/5] fixed shells landing short and included tot to view --- scripts/easyarty/functions/fn_calculate.sqf | 23 ++++++++++++++------- scripts/easyarty/functions/fn_start.sqf | 8 ++++++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/scripts/easyarty/functions/fn_calculate.sqf b/scripts/easyarty/functions/fn_calculate.sqf index 4fde854..0e4b396 100644 --- a/scripts/easyarty/functions/fn_calculate.sqf +++ b/scripts/easyarty/functions/fn_calculate.sqf @@ -4,14 +4,15 @@ params ["_targetPos", "_vehicle"]; private _az = (_vehicle getDir _targetPos) * DEGREE_TO_MIL_FACTOR; -private _distanceToTarget = _vehicle distance artyTarget; -private _distanceRounded = _distanceToTarget - _distanceToTarget % 100; -private _distanceFactor = _distanceToTarget % 100 * -0.01; //used to scale later +private _deltaDistance = _vehicle distance2d _targetPos; +private _distanceRounded = _deltaDistance - _deltaDistance % 100; +private _distanceFactor = _deltaDistance % 100 * 0.01; +private _heightFactor = ((getPosASL _vehicle select 2) - getTerrainHeightASL _targetPos) / 100 * -1; (ace_artillerytables_magModeData select ace_artillerytables_lastCharge) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; private _elevMin = 10; private _elevMax = 75; -private _lastElevMode = param [0, ace_artillerytables_lastElevationMode]; +private _lastElevMode = ace_artillerytables_lastElevationMode; private _ret = "ace_artillerytables" callExtension ["start", [_muzzleVelocity,_airFriction,_elevMin,_elevMax,_lastElevMode]]; private _status = 0; private _result = []; @@ -31,7 +32,7 @@ if (_resultLength < 3) exitWith {[]}; private _minResult = parseNumber (_result select 0 select 0); private _maxResult = parseNumber (_result select _resultLength-1 select 0); -if (_distanceToTarget > _maxResult || {_distanceToTarget < _minResult}) exitWith { [] }; +if (_deltaDistance > _maxResult || {_deltaDistance < _minResult}) exitWith { [] }; private _idxLower = (_distanceRounded - _minResult) / 100; private _idxUpper = (_distanceRounded + 100 - _minResult) / 100; @@ -40,6 +41,14 @@ private _lSolution = _result select _idxLower; private _uSolution = _result select _idxUpper; private _diffElevation = parseNumber (_lSolution select 1) - parseNumber (_uSolution select 1); -private _finalElevation = parseNumber (_lSolution select 1) + _diffElevation * _distanceFactor; +private _hightOffset = _lSolution select 2; +_hightOffset = [1, parseNumber _hightOffset] select (_hightOffset isNotEqualTo "-"); -[_finalElevation, _az, _distanceToTarget]; \ No newline at end of file +private _tof = _lSolution select 4; + +// in high mode less elevation is father, in low it is the opposite. +// in high mode we subtract to gain range, in low mode we need to add +// because - * a negative number (see diff calc) is like adding, this works for both cases +private _finalElevation = parseNumber (_lSolution select 1) - _diffElevation * _distanceFactor - _hightOffset * _heightFactor; + +[_finalElevation, _az, _deltaDistance, _tof]; \ No newline at end of file diff --git a/scripts/easyarty/functions/fn_start.sqf b/scripts/easyarty/functions/fn_start.sqf index f30af18..9d1bc20 100644 --- a/scripts/easyarty/functions/fn_start.sqf +++ b/scripts/easyarty/functions/fn_start.sqf @@ -16,7 +16,13 @@ easyarty_pfh = [{ if (_solution isEqualTo []) exitwith { hintSilent "No solution found. Please try another range card setting!"; }; - hintSilent format ["=== SOLUTION ===\nDISTANCE: %1\nELEVATION: %2\nAZIMUTH: %3\n", _solution select 2, _solution select 0, _solution select 1]; + hintSilent format [ + "=== SOLUTION ===\nDISTANCE: %1\nTOF: %2sec\nELEVATION: %3\nAZIMUTH: %4\n", + _solution select 2, + _solution select 3, + _solution select 0, + _solution select 1 + ]; }, 1] call CBA_fnc_addPerFrameHandler; easyarty_running = true; \ No newline at end of file From f1562c905cb9ed7a27d7d4e0a186421d08b20a62 Mon Sep 17 00:00:00 2001 From: Dragon Date: Sat, 8 Oct 2022 16:54:03 +0200 Subject: [PATCH 5/5] check if player has an artillery table check if a player has an artillery table before adding the spacer action to his player --- scripts/easyarty/functions/fn_postInit.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/easyarty/functions/fn_postInit.sqf b/scripts/easyarty/functions/fn_postInit.sqf index 635a1a5..a5ae7d7 100644 --- a/scripts/easyarty/functions/fn_postInit.sqf +++ b/scripts/easyarty/functions/fn_postInit.sqf @@ -9,7 +9,7 @@ private _spacerAction = [ "Easy Arty", "", {}, - {true} + {[player, "ACE_artilleryTable"] call BIS_fnc_hasItem} ] call ace_interact_menu_fnc_createAction; private _startAction = [ @@ -66,4 +66,4 @@ private _newTargetAction = [ ["ACE_SelfActions", "easyarty_spacer"], _newTargetAction, true -] call ace_interact_menu_fnc_addActionToClass; \ No newline at end of file +] call ace_interact_menu_fnc_addActionToClass;