mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
AI_PATROL
- output fix
This commit is contained in:
parent
b9fd6c0e31
commit
389931fbf0
@ -636,7 +636,7 @@ function AI_PATROL_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
self.Controllable:OnReSpawn(
|
self.Controllable:OnReSpawn(
|
||||||
function( PatrolGroup )
|
function( PatrolGroup )
|
||||||
self:E( "ReSpawn" )
|
self:T( "ReSpawn" )
|
||||||
self:__Reset( 1 )
|
self:__Reset( 1 )
|
||||||
self:__Route( 5 )
|
self:__Route( 5 )
|
||||||
end
|
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.
|
-- This will make the plane fly immediately to the patrol zone.
|
||||||
|
|
||||||
if self.Controllable:InAir() == false then
|
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()
|
local CurrentVec2 = self.Controllable:GetVec2()
|
||||||
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||||
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
||||||
@ -756,7 +756,7 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
|
|||||||
)
|
)
|
||||||
PatrolRoute[#PatrolRoute+1] = CurrentRoutePoint
|
PatrolRoute[#PatrolRoute+1] = CurrentRoutePoint
|
||||||
else
|
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()
|
local CurrentVec2 = self.Controllable:GetVec2()
|
||||||
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||||
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
||||||
|
|||||||
@ -868,13 +868,15 @@ end
|
|||||||
-- @param #boolean message Send message to all players.
|
-- @param #boolean message Send message to all players.
|
||||||
function SUPPRESSION:StatusReport(message)
|
function SUPPRESSION:StatusReport(message)
|
||||||
|
|
||||||
local name=self.Controllable:GetName()
|
local group=self.Controllable --Wrapper.Group#GROUP
|
||||||
local nunits=#self.Controllable:GetUnits()
|
|
||||||
|
local nunits=group:CountAliveUnits()
|
||||||
local roe=self.CurrentROE
|
local roe=self.CurrentROE
|
||||||
local state=self.CurrentAlarmState
|
local state=self.CurrentAlarmState
|
||||||
local life_min, life_max, life_ave, life_ave0, groupstrength=self:_GetLife()
|
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)
|
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("Number of units: %d of %d\n", nunits, self.IniGroupStrength)
|
||||||
text=text..string.format("Current state: %s\n", self:GetState())
|
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("Life ave0: %3.0f\n", life_ave0)
|
||||||
text=text..string.format("Ammo tot: %d\n", at)
|
text=text..string.format("Ammo tot: %d\n", at)
|
||||||
text=text..string.format("Group strength: %3.0f", groupstrength)
|
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)
|
MESSAGE:New(text, 10):ToAllIf(message or self.Debug)
|
||||||
self:I(self.lid.."\n"..text)
|
self:I(self.lid.."\n"..text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user