AI_PATROL

- output fix
This commit is contained in:
Frank 2019-12-21 01:09:59 +01:00
parent b9fd6c0e31
commit 389931fbf0
2 changed files with 12 additions and 6 deletions

View File

@ -636,7 +636,7 @@ function AI_PATROL_ZONE:onafterStart( Controllable, From, Event, To )
self.Controllable:OnReSpawn(
function( PatrolGroup )
self:E( "ReSpawn" )
self:T( "ReSpawn" )
self:__Reset( 1 )
self:__Route( 5 )
end
@ -741,7 +741,7 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
-- This will make the plane fly immediately to the patrol zone.
if self.Controllable:InAir() == false then
self:E( "Not in the air, finding route path within PatrolZone" )
self:T( "Not in the air, finding route path within PatrolZone" )
local CurrentVec2 = self.Controllable:GetVec2()
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
@ -756,7 +756,7 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
)
PatrolRoute[#PatrolRoute+1] = CurrentRoutePoint
else
self:E( "In the air, finding route path within PatrolZone" )
self:T( "In the air, finding route path within PatrolZone" )
local CurrentVec2 = self.Controllable:GetVec2()
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()

View File

@ -868,13 +868,15 @@ end
-- @param #boolean message Send message to all players.
function SUPPRESSION:StatusReport(message)
local name=self.Controllable:GetName()
local nunits=#self.Controllable:GetUnits()
local group=self.Controllable --Wrapper.Group#GROUP
local nunits=group:CountAliveUnits()
local roe=self.CurrentROE
local state=self.CurrentAlarmState
local life_min, life_max, life_ave, life_ave0, groupstrength=self:_GetLife()
local at=self.Controllable:GetAmmunition()
local ammotot=self.Controllable:GetAmmunition()
--[[
local text=string.format("Status of group %s\n", name)
text=text..string.format("Number of units: %d of %d\n", nunits, self.IniGroupStrength)
text=text..string.format("Current state: %s\n", self:GetState())
@ -887,6 +889,10 @@ function SUPPRESSION:StatusReport(message)
text=text..string.format("Life ave0: %3.0f\n", life_ave0)
text=text..string.format("Ammo tot: %d\n", at)
text=text..string.format("Group strength: %3.0f", groupstrength)
]]
local text=string.format("State %s, Units=%d/%d, ROE=%s Alarm State=%s, Hits=%d, Life=%d/%d/%d/%d, Ammo=%d",
self:GetState(), nunits, self.IniGroupStrength, self.CurrentROE, self.CurrentAlarmState, self.Nhit, life_min, life_max, life_ave, life_ave0, ammotot)
MESSAGE:New(text, 10):ToAllIf(message or self.Debug)
self:I(self.lid.."\n"..text)