diff --git a/Moose Development/Moose/Ops/ArmyGroup.lua b/Moose Development/Moose/Ops/ArmyGroup.lua index 613e53b5a..dfc0e7abf 100644 --- a/Moose Development/Moose/Ops/ArmyGroup.lua +++ b/Moose Development/Moose/Ops/ArmyGroup.lua @@ -1169,7 +1169,7 @@ function ARMYGROUP:onafterRTZ(From, Event, To, Zone, Formation) -- Set if we want to resume route after reaching the detour waypoint. wp.detour=0 - + else self:E(self.lid.."ERROR: No RTZ zone given!") end diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index a4a85841e..c23511459 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -102,6 +102,7 @@ -- -- @field #number artyRadius Radius in meters. -- @field #number artyShots Number of shots fired. +-- @field #number artyAltitude Altitude in meters. Can be used for a Barrage. -- -- @field #string alert5MissionType Alert 5 mission type. This is the mission type, the alerted assets will be able to carry out. -- @@ -1549,8 +1550,9 @@ end -- @param Core.Point#COORDINATE Target Center of the firing solution. -- @param #number Nshots Number of shots to be fired. Default 3. -- @param #number Radius Radius of the shells in meters. Default 100 meters. +-- @param #number Altitude Altitude in meters. Can be used to setup a Barrage. Default `#nil`. -- @return #AUFTRAG self -function AUFTRAG:NewARTY(Target, Nshots, Radius) +function AUFTRAG:NewARTY(Target, Nshots, Radius, Altitude) local mission=AUFTRAG:New(AUFTRAG.Type.ARTY) @@ -1558,6 +1560,7 @@ function AUFTRAG:NewARTY(Target, Nshots, Radius) mission.artyShots=Nshots or 3 mission.artyRadius=Radius or 100 + mission.artyAltitude=Altitude mission.engageWeaponType=ENUMS.WeaponFlag.Auto @@ -4721,7 +4724,7 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable) -- ARTY Mission -- ------------------ - local DCStask=CONTROLLABLE.TaskFireAtPoint(nil, self:GetTargetVec2(), self.artyRadius, self.artyShots, self.engageWeaponType) + local DCStask=CONTROLLABLE.TaskFireAtPoint(nil, self:GetTargetVec2(), self.artyRadius, self.artyShots, self.engageWeaponType, self.artyAltitude) table.insert(DCStasks, DCStask) diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 414ddf409..48a360302 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -4414,7 +4414,7 @@ function OPSGROUP:onafterMissionDone(From, Event, To, Mission) -- We add a 10 sec delay for ARTY. Found that they need some time to readjust the barrel of their gun. Not sure if necessary for all. Needs some more testing! local delay=1 if Mission.type==AUFTRAG.Type.ARTY then - delay=10 + delay=60 end -- Check if group is done. @@ -8427,16 +8427,17 @@ function OPSGROUP:_CheckStuck() self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime)) -- Give cruise command again. - self:__Cruise(1) + if self:IsReturning() then + self:__RTZ(1) + else + self:__Cruise(1) + end - elseif holdtime>=10*60 then + elseif holdtime>=10*60 and holdtime<30*60 then -- Debug warning. self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime)) - -- Give cruise command again. - self:__Cruise(1) - --TODO: Stuck event! -- Look for a current mission and cancel it as we do not seem to be able to perform it. @@ -8444,7 +8445,19 @@ function OPSGROUP:_CheckStuck() if mission then self:E(self.lid..string.format("WARNING: Cancelling mission %s [%s] due to being stuck", mission:GetName(), mission:GetType())) self:MissionCancel(mission) + else + -- Give cruise command again. + if self:IsReturning() then + self:__RTZ(1) + else + self:__Cruise(1) + end end + + elseif holdtime>=30*60 then + + -- Debug warning. + self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime)) end