diff --git a/addons/sup_artillery/fnc_artillery.sqf b/addons/sup_artillery/fnc_artillery.sqf index 65b97811d..f6c51757b 100644 --- a/addons/sup_artillery/fnc_artillery.sqf +++ b/addons/sup_artillery/fnc_artillery.sqf @@ -170,7 +170,9 @@ switch (_operation) do { private _waypoint = _group addWaypoint [_position, 0]; _waypoint setWaypointType "MOVE"; _waypoint setWaypointBehaviour "SAFE"; + _waypoint setWaypointForceBehaviour true; _waypoint setWaypointSpeed "NORMAL"; + _waypoint setWaypointFormation "COLUMN"; _waypoint setWaypointStatements [ "true", "(group this) setVariable ['sup_artillery_inPosition', true]" @@ -206,6 +208,8 @@ switch (_operation) do { }; ALIVE_sup_artillery_stateMachine_list pushBack _logic; + + _result = _group; }; /****************** @@ -218,7 +222,7 @@ switch (_operation) do { }; case "onActive": { if (!([_logic, "inRange"] call MAINCLASS)) then { - _logic setVariable ["moveToPos", [0,0,0]]; // TODO: Figure out best firing position + _logic setVariable ["moveToPos", [3451.45,5379.89,0]]; // TODO: Figure out best firing position }; }; case "onFire": { diff --git a/addons/sup_combatsupport/fnc_combatSupport.sqf b/addons/sup_combatsupport/fnc_combatSupport.sqf index 66a149079..8c9b29efe 100644 --- a/addons/sup_combatsupport/fnc_combatSupport.sqf +++ b/addons/sup_combatsupport/fnc_combatSupport.sqf @@ -675,10 +675,46 @@ switch(_operation) do { //} forEach SUP_ARTYARRAYS; } forEach []; + // TODO: Move most of the code below to ALIVE_fnc_artillery for "_i" from 0 to ((count synchronizedObjects _logic)-1) do { if (typeOf ((synchronizedObjects _logic) select _i) == "ALiVE_sup_artillery") then { private _artyLogic = (synchronizedObjects _logic) select _i; - [_artyLogic, "spawn"] call ALIVE_fnc_artillery; + private _group = [_artyLogic, "spawn"] call ALIVE_fnc_artillery; + private _vehicles = []; + + { + if (vehicle _x != _x && {!(vehicle _x in _vehicles)}) then { + _vehicles pushBack (vehicle _x); + }; + } forEach (units _group); + + private _callsign = _artyLogic getVariable ["artillery_callsign","FOX ONE"]; + + private _rounds = [ + ["HE", parseNumber (_artyLogic getVariable ["artillery_he", "30"])], + ["ILLUM", parseNumber (_artyLogic getVariable ["artillery_illum", "30"])], + ["SMOKE", parseNumber (_artyLogic getVariable ["artillery_smoke", "30"])], + ["SADARM", parseNumber (_artyLogic getVariable ["artillery_guided", "30"])], + ["CLUSTER", parseNumber (_artyLogic getVariable ["artillery_cluster", "30"])], + ["LASER", parseNumber (_artyLogic getVariable ["artillery_lg", "30"])], + ["MINE", parseNumber (_artyLogic getVariable ["artillery_mine", "30"])], + ["AT MINE", parseNumber (_artyLogic getVariable ["artillery_atmine", "30"])], + ["ROCKETS", parseNumber (_artyLogic getVariable ["artillery_rockets", "16"])] + ]; + + private _roundsAvailable = []; + private _roundsUnit = (typeOf (_vehicles select 0)) call ALIVE_fnc_getArtyRounds; + + { + if ((_x select 0) in _roundsUnit) then { + _roundsAvailable pushBack _x; + }; + } forEach _rounds; + + leader _group setVariable ["NEO_radioArtyBatteryRounds", _roundsAvailable, true]; + private _a = NEO_radioLogic getVariable format ["NEO_radioArtyArray_%1", side _group]; + _a set [count _a, [leader _group, _group, _callsign, _vehicles, _roundsAvailable]]; + NEO_radioLogic setVariable [format ["NEO_radioArtyArray_%1", side _group], _a, true]; }; }; diff --git a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButton.sqf b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButton.sqf index 52bf768c4..f7b3ad7c2 100644 --- a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButton.sqf +++ b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButton.sqf @@ -57,6 +57,9 @@ if (_audio) then { player kbTell [_battery, "ALIVE_SUPP_protocol", "Artillery_Request", "GROUP"]; }; +// TODO: Cleanup obsolete bits +private _logic = _unit getVariable ["logic", objNull]; +[_logic, "fireMission", [_pos, _ord, _count, _rate, _dispersion]] call ALIVE_fnc_artillery; //NEW TASK _battery setVariable ["NEO_radioArtyNewTask", [_type, _ordnanceType, _rate, _count, _dispersion, _pos, _unit, _ord, _callsignPlayer, player], true]; diff --git a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButtonEnable.sqf b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButtonEnable.sqf index a2e050863..1876634a0 100644 --- a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButtonEnable.sqf +++ b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyConfirmButtonEnable.sqf @@ -12,6 +12,7 @@ _artyRateOfFireLb = _display displayCtrl 655603; _artyRoundCountLb = _display displayCtrl 655605; _battery = _artyArray select (lbCurSel _artyUnitLb) select 0; if (!isNil { NEO_radioLogic getVariable "NEO_radioTalkWithArty" }) then { _battery = ((NEO_radioLogic getVariable "NEO_radioTalkWithArty") getVariable "NEO_radioArtyModule") select 0 }; _status = _battery getVariable "NEO_radioArtyUnitStatus"; +_status = "NONE"; // TODO: Handle status properly if ( diff --git a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyUnitLbSelChanged.sqf b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyUnitLbSelChanged.sqf index f4c533cfc..dfcf4e83a 100644 --- a/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyUnitLbSelChanged.sqf +++ b/addons/sup_combatsupport/scripts/NEO_radio/functions/ui/arty/fn_artyUnitLbSelChanged.sqf @@ -31,6 +31,7 @@ _supportMarker = NEO_radioLogic getVariable "NEO_supportMarker"; _artyMarkers = NEO_radioLogic getVariable "NEO_supportArtyMarkers"; _battery = _artyArray select (lbCurSel _artyUnitLb) select 0; if (!isNil { NEO_radioLogic getVariable "NEO_radioTalkWithArty" }) then { _battery = ((NEO_radioLogic getVariable "NEO_radioTalkWithArty") getVariable "NEO_radioArtyModule") select 0 }; _status = _battery getVariable "NEO_radioArtyUnitStatus"; +_status = "NONE"; // TODO: Handle status properly _class = typeOf (((_artyArray select (lbCurSel _artyUnitLb)) select 3) select 0); if (!isNil { NEO_radioLogic getVariable "NEO_radioTalkWithArty" }) then { _class = typeOf (NEO_radioLogic getVariable "NEO_radioTalkWithArty") }; _ord = _battery getVariable "NEO_radioArtyBatteryRounds";