diff --git a/Moose Development/Moose/Ops/ArmyGroup.lua b/Moose Development/Moose/Ops/ArmyGroup.lua index 19cebb545..28857197e 100644 --- a/Moose Development/Moose/Ops/ArmyGroup.lua +++ b/Moose Development/Moose/Ops/ArmyGroup.lua @@ -789,7 +789,7 @@ function ARMYGROUP:onbeforeEngageTarget(From, Event, To, Target) local ammo=self:GetAmmoTot() if ammo.Total==0 then - env.info("FF cannot engage because no ammo!") + self:E(self.lid.."WARNING: Cannot engage TARGET because no ammo left!") return false end @@ -809,11 +809,13 @@ function ARMYGROUP:onafterEngageTarget(From, Event, To, Target) else self.engage.Target=TARGET:New(Target) end - - env.info("FF Engage Target "..self.engage.Target:GetName()) + -- Target coordinate. self.engage.Coordinate=UTILS.DeepCopy(self.engage.Target:GetCoordinate()) + -- TODO: Backup current ROE and alarm state and reset after disengage. + + -- Switch ROE and alarm state. self:SwitchAlarmstate(ENUMS.AlarmState.Auto) self:SwitchROE(ENUMS.ROE.WeaponFree) @@ -834,7 +836,7 @@ function ARMYGROUP:_UpdateEngageTarget() if self.engage.Target and self.engage.Target:IsAlive() then - env.info("FF Update Engage Target "..self.engage.Target:GetName()) + --env.info("FF Update Engage Target "..self.engage.Target:GetName()) local vec3=self.engage.Target:GetCoordinate():GetVec3() @@ -842,7 +844,7 @@ function ARMYGROUP:_UpdateEngageTarget() if dist>100 then - env.info("FF Update Engage Target Moved "..self.engage.Target:GetName()) + --env.info("FF Update Engage Target Moved "..self.engage.Target:GetName()) self.engage.Coordinate:UpdateFromVec3(vec3) @@ -872,6 +874,7 @@ end -- @param #string Event Event. -- @param #string To To state. function ARMYGROUP:onafterDisengage(From, Event, To) + -- TODO: Reset ROE and alarm state. self:_CheckGroupDone(1) end diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index 2365c21c6..eb312d51e 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -1189,7 +1189,7 @@ function FLIGHTGROUP:OnEventCrash(EventData) local element=self:GetElementByName(unitname) if element and element.status~=OPSGROUP.ElementStatus.DEAD then - self:I(self.lid..string.format("EVENT: Element %s crashed ==> destroyed", element.name)) + self:T(self.lid..string.format("EVENT: Element %s crashed ==> destroyed", element.name)) self:ElementDestroyed(element) end @@ -1204,7 +1204,7 @@ function FLIGHTGROUP:OnEventUnitLost(EventData) -- Check that this is the right group. if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then - self:I(self.lid..string.format("EVENT: Unit %s lost at t=%.3f", EventData.IniUnitName, timer.getTime())) + self:T2(self.lid..string.format("EVENT: Unit %s lost at t=%.3f", EventData.IniUnitName, timer.getTime())) local unit=EventData.IniUnit local group=EventData.IniGroup @@ -1214,7 +1214,7 @@ function FLIGHTGROUP:OnEventUnitLost(EventData) local element=self:GetElementByName(unitname) if element and element.status~=OPSGROUP.ElementStatus.DEAD then - self:I(self.lid..string.format("EVENT: Element %s unit lost ==> destroyed t=%.3f", element.name, timer.getTime())) + self:T(self.lid..string.format("EVENT: Element %s unit lost ==> destroyed t=%.3f", element.name, timer.getTime())) self:ElementDestroyed(element) end @@ -1229,7 +1229,7 @@ function FLIGHTGROUP:OnEventKill(EventData) -- Check that this is the right group. if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then - self:I(self.lid..string.format("EVENT: Unit %s killed unit %s!", tostring(EventData.IniUnitName), tostring(EventData.TgtUnitName))) + self:T2(self.lid..string.format("EVENT: Unit %s killed unit %s!", tostring(EventData.IniUnitName), tostring(EventData.TgtUnitName))) local unit=EventData.IniUnit local group=EventData.IniGroup diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 4256fe735..e61a371b0 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -3345,7 +3345,7 @@ end function OPSGROUP:onafterLaserPause(From, Event, To) -- Debug message. - self:I(self.lid.."Switching LASER off temporarily") + self:T(self.lid.."Switching LASER off temporarily") -- "Destroy" the laser beam. self.spot.Laser:destroy() @@ -3380,7 +3380,7 @@ end function OPSGROUP:onafterLaserResume(From, Event, To) -- Debug info. - self:I(self.lid.."Resuming LASER") + self:T(self.lid.."Resuming LASER") -- Unset paused. self.spot.Paused=false @@ -3399,7 +3399,7 @@ function OPSGROUP:onafterLaserResume(From, Event, To) if target then -- Debug message. - self:I(self.lid.."Switching LASER on again at target ".. target:GetName()) + self:T(self.lid.."Switching LASER on again") self:LaserOn(target) end @@ -3601,13 +3601,13 @@ function OPSGROUP:_UpdateLaser() local unit=self.spot.TargetGroup:GetHighestThreat() if unit then - self:I(self.lid..string.format("Switching to target unit %s in the group", unit:GetName())) + self:T(self.lid..string.format("Switching to target unit %s in the group", unit:GetName())) self.spot.TargetUnit=unit -- We update the laser position in the next update cycle and then check the LOS. return else -- Switch laser off. - self:I(self.lid.."Target is not alive any more ==> switching LASER off") + self:T(self.lid.."Target is not alive any more ==> switching LASER off") self:LaserOff() return end @@ -3615,7 +3615,7 @@ function OPSGROUP:_UpdateLaser() else -- Switch laser off. - self:I(self.lid.."Target is not alive any more ==> switching LASER off") + self:T(self.lid.."Target is not alive any more ==> switching LASER off") self:LaserOff() return end