mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- Remove unnecessary comments from trace.
- Reworked the messaging. The name of the sender is now better modelled. - When a name is given, the name is used, unmodified. - When no name is given, the callign is inspected and used if set. - When no name and callsign, the group name is used. - Reworked the Detection logic. - 2 collections, one for the internal grouping and one for the external indexes. - Reworked the methods. - Reworked the naming of Command Centers. - A name function - A text function, showing Command Center [X] - A short text function, showing CC [X] - Reworked the naming of Missions. - A name function - a text function, showing Mission "X (prio)" - a short text function, showing Mission "X" - Embedded the new namings within the code (where I found them). - There may be some leftovers. Please raise, and I'll fix it immediately. - I've tested where i could.
This commit is contained in:
commit
c2e575ef20
@ -1001,7 +1001,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
--- @param #AI_A2A_DISPATCHER self
|
--- @param #AI_A2A_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2A_DISPATCHER:OnEventLand( EventData )
|
function AI_A2A_DISPATCHER:OnEventLand( EventData )
|
||||||
self:E( "Landed" )
|
self:F( "Landed" )
|
||||||
local DefenderUnit = EventData.IniUnit
|
local DefenderUnit = EventData.IniUnit
|
||||||
local Defender = EventData.IniGroup
|
local Defender = EventData.IniGroup
|
||||||
local Squadron = self:GetSquadronFromDefender( Defender )
|
local Squadron = self:GetSquadronFromDefender( Defender )
|
||||||
@ -1488,7 +1488,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
DefenderSquadron.Resources = Resources
|
DefenderSquadron.Resources = Resources
|
||||||
DefenderSquadron.TemplatePrefixes = TemplatePrefixes
|
DefenderSquadron.TemplatePrefixes = TemplatePrefixes
|
||||||
|
|
||||||
self:E( { Squadron = {SquadronName, AirbaseName, TemplatePrefixes, Resources } } )
|
self:F( { Squadron = {SquadronName, AirbaseName, TemplatePrefixes, Resources } } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -1554,7 +1554,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
self:SetSquadronCapInterval( SquadronName, self.DefenderDefault.CapLimit, self.DefenderDefault.CapMinSeconds, self.DefenderDefault.CapMaxSeconds, 1 )
|
self:SetSquadronCapInterval( SquadronName, self.DefenderDefault.CapLimit, self.DefenderDefault.CapMinSeconds, self.DefenderDefault.CapMaxSeconds, 1 )
|
||||||
|
|
||||||
self:E( { CAP = { SquadronName, Zone, FloorAltitude, CeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageMinSpeed, EngageMaxSpeed, AltType } } )
|
self:F( { CAP = { SquadronName, Zone, FloorAltitude, CeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageMinSpeed, EngageMaxSpeed, AltType } } )
|
||||||
|
|
||||||
-- Add the CAP to the EWR network.
|
-- Add the CAP to the EWR network.
|
||||||
|
|
||||||
@ -1658,7 +1658,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
local Cap = DefenderSquadron.Cap
|
local Cap = DefenderSquadron.Cap
|
||||||
if Cap then
|
if Cap then
|
||||||
local CapCount = self:CountCapAirborne( SquadronName )
|
local CapCount = self:CountCapAirborne( SquadronName )
|
||||||
self:E( { CapCount = CapCount } )
|
self:F( { CapCount = CapCount } )
|
||||||
if CapCount < Cap.CapLimit then
|
if CapCount < Cap.CapLimit then
|
||||||
local Probability = math.random()
|
local Probability = math.random()
|
||||||
if Probability <= Cap.Probability then
|
if Probability <= Cap.Probability then
|
||||||
@ -1716,7 +1716,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
Intercept.EngageMinSpeed = EngageMinSpeed
|
Intercept.EngageMinSpeed = EngageMinSpeed
|
||||||
Intercept.EngageMaxSpeed = EngageMaxSpeed
|
Intercept.EngageMaxSpeed = EngageMaxSpeed
|
||||||
|
|
||||||
self:E( { GCI = { SquadronName, EngageMinSpeed, EngageMaxSpeed } } )
|
self:F( { GCI = { SquadronName, EngageMinSpeed, EngageMaxSpeed } } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Defines the default amount of extra planes that will take-off as part of the defense system.
|
--- Defines the default amount of extra planes that will take-off as part of the defense system.
|
||||||
@ -2443,7 +2443,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
if Squadron.Resources then
|
if Squadron.Resources then
|
||||||
Squadron.Resources = Squadron.Resources - Size
|
Squadron.Resources = Squadron.Resources - Size
|
||||||
end
|
end
|
||||||
self:E( { DefenderName = DefenderName, SquadronResources = Squadron.Resources } )
|
self:F( { DefenderName = DefenderName, SquadronResources = Squadron.Resources } )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_A2A_DISPATCHER self
|
--- @param #AI_A2A_DISPATCHER self
|
||||||
@ -2652,7 +2652,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
--- @param #AI_A2A_DISPATCHER self
|
--- @param #AI_A2A_DISPATCHER self
|
||||||
function Fsm:onafterHome( Defender, From, Event, To, Action )
|
function Fsm:onafterHome( Defender, From, Event, To, Action )
|
||||||
self:E({"CAP Home", Defender:GetName()})
|
self:F({"CAP Home", Defender:GetName()})
|
||||||
self:GetParent(self).onafterHome( self, Defender, From, Event, To )
|
self:GetParent(self).onafterHome( self, Defender, From, Event, To )
|
||||||
|
|
||||||
local Dispatcher = self:GetDispatcher() -- #AI_A2A_DISPATCHER
|
local Dispatcher = self:GetDispatcher() -- #AI_A2A_DISPATCHER
|
||||||
@ -2793,7 +2793,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
local TakeoffMethod = self:GetSquadronTakeoff( ClosestDefenderSquadronName )
|
local TakeoffMethod = self:GetSquadronTakeoff( ClosestDefenderSquadronName )
|
||||||
local DefenderGCI = Spawn:SpawnAtAirbase( DefenderSquadron.Airbase, TakeoffMethod, DefenderSquadron.TakeoffAltitude or self.DefenderDefault.TakeoffAltitude ) -- Wrapper.Group#GROUP
|
local DefenderGCI = Spawn:SpawnAtAirbase( DefenderSquadron.Airbase, TakeoffMethod, DefenderSquadron.TakeoffAltitude or self.DefenderDefault.TakeoffAltitude ) -- Wrapper.Group#GROUP
|
||||||
self:E( { GCIDefender = DefenderGCI:GetName() } )
|
self:F( { GCIDefender = DefenderGCI:GetName() } )
|
||||||
|
|
||||||
DefendersNeeded = DefendersNeeded - DefenderGrouping
|
DefendersNeeded = DefendersNeeded - DefenderGrouping
|
||||||
|
|
||||||
@ -2957,13 +2957,13 @@ do -- AI_A2A_DISPATCHER
|
|||||||
local AIGroup = AIGroup -- Wrapper.Group#GROUP
|
local AIGroup = AIGroup -- Wrapper.Group#GROUP
|
||||||
if not AIGroup:IsAlive() then
|
if not AIGroup:IsAlive() then
|
||||||
local DefenderTaskFsm = self:GetDefenderTaskFsm( AIGroup )
|
local DefenderTaskFsm = self:GetDefenderTaskFsm( AIGroup )
|
||||||
self:E( { Defender = AIGroup:GetName(), DefenderState = DefenderTaskFsm:GetState() } )
|
self:F( { Defender = AIGroup:GetName(), DefenderState = DefenderTaskFsm:GetState() } )
|
||||||
if not DefenderTaskFsm:Is( "Started" ) then
|
if not DefenderTaskFsm:Is( "Started" ) then
|
||||||
self:ClearDefenderTask( AIGroup )
|
self:ClearDefenderTask( AIGroup )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if DefenderTask.Target then
|
if DefenderTask.Target then
|
||||||
local AttackerItem = Detection:GetDetectedItem( DefenderTask.Target.Index )
|
local AttackerItem = Detection:GetDetectedItemByIndex( DefenderTask.Target.Index )
|
||||||
if not AttackerItem then
|
if not AttackerItem then
|
||||||
self:F( { "Removing obsolete Target:", DefenderTask.Target.Index } )
|
self:F( { "Removing obsolete Target:", DefenderTask.Target.Index } )
|
||||||
self:ClearDefenderTaskTarget( AIGroup )
|
self:ClearDefenderTaskTarget( AIGroup )
|
||||||
@ -3056,7 +3056,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
end
|
end
|
||||||
Report:Add( string.format( "\n - %d Tasks", TaskCount ) )
|
Report:Add( string.format( "\n - %d Tasks", TaskCount ) )
|
||||||
|
|
||||||
self:E( Report:Text( "\n" ) )
|
self:F( Report:Text( "\n" ) )
|
||||||
trigger.action.outText( Report:Text( "\n" ), 25 )
|
trigger.action.outText( Report:Text( "\n" ), 25 )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -3084,7 +3084,7 @@ do
|
|||||||
for PlayerUnitName, PlayerUnitData in pairs( PlayersNearBy ) do
|
for PlayerUnitName, PlayerUnitData in pairs( PlayersNearBy ) do
|
||||||
local PlayerUnit = PlayerUnitData -- Wrapper.Unit#UNIT
|
local PlayerUnit = PlayerUnitData -- Wrapper.Unit#UNIT
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
--self:E( { PlayerName = PlayerName, PlayerUnit = PlayerUnit } )
|
--self:F( { PlayerName = PlayerName, PlayerUnit = PlayerUnit } )
|
||||||
if PlayerUnit:IsAirPlane() and PlayerName ~= nil then
|
if PlayerUnit:IsAirPlane() and PlayerName ~= nil then
|
||||||
local FriendlyUnitThreatLevel = PlayerUnit:GetThreatLevel()
|
local FriendlyUnitThreatLevel = PlayerUnit:GetThreatLevel()
|
||||||
PlayersCount = PlayersCount + 1
|
PlayersCount = PlayersCount + 1
|
||||||
@ -3097,7 +3097,7 @@ do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:E( { PlayersCount = PlayersCount } )
|
--self:F( { PlayersCount = PlayersCount } )
|
||||||
|
|
||||||
local PlayerTypesReport = REPORT:New()
|
local PlayerTypesReport = REPORT:New()
|
||||||
|
|
||||||
@ -3141,7 +3141,7 @@ do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:E( { FriendliesCount = FriendliesCount } )
|
--self:F( { FriendliesCount = FriendliesCount } )
|
||||||
|
|
||||||
local FriendlyTypesReport = REPORT:New()
|
local FriendlyTypesReport = REPORT:New()
|
||||||
|
|
||||||
@ -3551,23 +3551,23 @@ do
|
|||||||
|
|
||||||
-- Setup squadrons
|
-- Setup squadrons
|
||||||
|
|
||||||
self:E( { Airbases = AirbaseNames } )
|
self:F( { Airbases = AirbaseNames } )
|
||||||
|
|
||||||
self:E( "Defining Templates for Airbases ..." )
|
self:F( "Defining Templates for Airbases ..." )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
local AirbaseCoord = Airbase:GetCoordinate()
|
local AirbaseCoord = Airbase:GetCoordinate()
|
||||||
local AirbaseZone = ZONE_RADIUS:New( "Airbase", AirbaseCoord:GetVec2(), 3000 )
|
local AirbaseZone = ZONE_RADIUS:New( "Airbase", AirbaseCoord:GetVec2(), 3000 )
|
||||||
local Templates = nil
|
local Templates = nil
|
||||||
self:E( { Airbase = AirbaseName } )
|
self:F( { Airbase = AirbaseName } )
|
||||||
for TemplateID, Template in pairs( self.Templates:GetSet() ) do
|
for TemplateID, Template in pairs( self.Templates:GetSet() ) do
|
||||||
local Template = Template -- Wrapper.Group#GROUP
|
local Template = Template -- Wrapper.Group#GROUP
|
||||||
local TemplateCoord = Template:GetCoordinate()
|
local TemplateCoord = Template:GetCoordinate()
|
||||||
if AirbaseZone:IsVec2InZone( TemplateCoord:GetVec2() ) then
|
if AirbaseZone:IsVec2InZone( TemplateCoord:GetVec2() ) then
|
||||||
Templates = Templates or {}
|
Templates = Templates or {}
|
||||||
table.insert( Templates, Template:GetName() )
|
table.insert( Templates, Template:GetName() )
|
||||||
self:E( { Template = Template:GetName() } )
|
self:F( { Template = Template:GetName() } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Templates then
|
if Templates then
|
||||||
@ -3583,13 +3583,13 @@ do
|
|||||||
self.CAPTemplates:FilterPrefixes( CapPrefixes )
|
self.CAPTemplates:FilterPrefixes( CapPrefixes )
|
||||||
self.CAPTemplates:FilterOnce()
|
self.CAPTemplates:FilterOnce()
|
||||||
|
|
||||||
self:E( "Setting up CAP ..." )
|
self:F( "Setting up CAP ..." )
|
||||||
for CAPID, CAPTemplate in pairs( self.CAPTemplates:GetSet() ) do
|
for CAPID, CAPTemplate in pairs( self.CAPTemplates:GetSet() ) do
|
||||||
local CAPZone = ZONE_POLYGON:New( CAPTemplate:GetName(), CAPTemplate )
|
local CAPZone = ZONE_POLYGON:New( CAPTemplate:GetName(), CAPTemplate )
|
||||||
-- Now find the closest airbase from the ZONE (start or center)
|
-- Now find the closest airbase from the ZONE (start or center)
|
||||||
local AirbaseDistance = 99999999
|
local AirbaseDistance = 99999999
|
||||||
local AirbaseClosest = nil -- Wrapper.Airbase#AIRBASE
|
local AirbaseClosest = nil -- Wrapper.Airbase#AIRBASE
|
||||||
self:E( { CAPZoneGroup = CAPID } )
|
self:F( { CAPZoneGroup = CAPID } )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
@ -3597,7 +3597,7 @@ do
|
|||||||
local Squadron = self.DefenderSquadrons[AirbaseName]
|
local Squadron = self.DefenderSquadrons[AirbaseName]
|
||||||
if Squadron then
|
if Squadron then
|
||||||
local Distance = AirbaseCoord:Get2DDistance( CAPZone:GetCoordinate() )
|
local Distance = AirbaseCoord:Get2DDistance( CAPZone:GetCoordinate() )
|
||||||
self:E( { AirbaseDistance = Distance } )
|
self:F( { AirbaseDistance = Distance } )
|
||||||
if Distance < AirbaseDistance then
|
if Distance < AirbaseDistance then
|
||||||
AirbaseDistance = Distance
|
AirbaseDistance = Distance
|
||||||
AirbaseClosest = Airbase
|
AirbaseClosest = Airbase
|
||||||
@ -3605,7 +3605,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if AirbaseClosest then
|
if AirbaseClosest then
|
||||||
self:E( { CAPAirbase = AirbaseClosest:GetName() } )
|
self:F( { CAPAirbase = AirbaseClosest:GetName() } )
|
||||||
self:SetSquadronCap( AirbaseClosest:GetName(), CAPZone, 6000, 10000, 500, 800, 800, 1200, "RADIO" )
|
self:SetSquadronCap( AirbaseClosest:GetName(), CAPZone, 6000, 10000, 500, 800, 800, 1200, "RADIO" )
|
||||||
self:SetSquadronCapInterval( AirbaseClosest:GetName(), CapLimit, 300, 600, 1 )
|
self:SetSquadronCapInterval( AirbaseClosest:GetName(), CapLimit, 300, 600, 1 )
|
||||||
end
|
end
|
||||||
@ -3613,14 +3613,14 @@ do
|
|||||||
|
|
||||||
-- Setup GCI.
|
-- Setup GCI.
|
||||||
-- GCI is setup for all Squadrons.
|
-- GCI is setup for all Squadrons.
|
||||||
self:E( "Setting up GCI ..." )
|
self:F( "Setting up GCI ..." )
|
||||||
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
for AirbaseID, AirbaseName in pairs( AirbaseNames ) do
|
||||||
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
local Airbase = _DATABASE:FindAirbase( AirbaseName ) -- Wrapper.Airbase#AIRBASE
|
||||||
local AirbaseName = Airbase:GetName()
|
local AirbaseName = Airbase:GetName()
|
||||||
local Squadron = self.DefenderSquadrons[AirbaseName]
|
local Squadron = self.DefenderSquadrons[AirbaseName]
|
||||||
self:E( { Airbase = AirbaseName } )
|
self:F( { Airbase = AirbaseName } )
|
||||||
if Squadron then
|
if Squadron then
|
||||||
self:E( { GCIAirbase = AirbaseName } )
|
self:F( { GCIAirbase = AirbaseName } )
|
||||||
self:SetSquadronGci( AirbaseName, 800, 1200 )
|
self:SetSquadronGci( AirbaseName, 800, 1200 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -305,7 +305,6 @@ function AI_A2A_PATROL:onafterPatrol( AIPatrol, From, Event, To )
|
|||||||
|
|
||||||
AIPatrol:OnReSpawn(
|
AIPatrol:OnReSpawn(
|
||||||
function( PatrolGroup )
|
function( PatrolGroup )
|
||||||
self:E( "ReSpawn" )
|
|
||||||
self:__Reset( 1 )
|
self:__Reset( 1 )
|
||||||
self:__Route( 5 )
|
self:__Route( 5 )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -403,7 +403,6 @@ end
|
|||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function AI_CAS_ZONE:onafterTarget( Controllable, From, Event, To )
|
function AI_CAS_ZONE:onafterTarget( Controllable, From, Event, To )
|
||||||
self:E("onafterTarget")
|
|
||||||
|
|
||||||
if Controllable:IsAlive() then
|
if Controllable:IsAlive() then
|
||||||
|
|
||||||
@ -414,7 +413,7 @@ function AI_CAS_ZONE:onafterTarget( Controllable, From, Event, To )
|
|||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
if DetectedUnit:IsInZone( self.EngageZone ) then
|
if DetectedUnit:IsInZone( self.EngageZone ) then
|
||||||
if Detected == true then
|
if Detected == true then
|
||||||
self:E( {"Target: ", DetectedUnit } )
|
self:F( {"Target: ", DetectedUnit } )
|
||||||
self.DetectedUnits[DetectedUnit] = false
|
self.DetectedUnits[DetectedUnit] = false
|
||||||
local AttackTask = Controllable:TaskAttackUnit( DetectedUnit, false, self.EngageWeaponExpend, self.EngageAttackQty, self.EngageDirection, self.EngageAltitude, nil )
|
local AttackTask = Controllable:TaskAttackUnit( DetectedUnit, false, self.EngageWeaponExpend, self.EngageAttackQty, self.EngageDirection, self.EngageAltitude, nil )
|
||||||
self.Controllable:PushTask( AttackTask, 1 )
|
self.Controllable:PushTask( AttackTask, 1 )
|
||||||
@ -496,7 +495,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To,
|
|||||||
self:T( DetectedUnit )
|
self:T( DetectedUnit )
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
if DetectedUnit:IsInZone( self.EngageZone ) then
|
if DetectedUnit:IsInZone( self.EngageZone ) then
|
||||||
self:E( {"Engaging ", DetectedUnit } )
|
self:F( {"Engaging ", DetectedUnit } )
|
||||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit,
|
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit,
|
||||||
true,
|
true,
|
||||||
EngageWeaponExpend,
|
EngageWeaponExpend,
|
||||||
|
|||||||
@ -190,7 +190,6 @@ do -- ACT_ACCOUNT_DEADS
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, Task, From, Event, To )
|
function ACT_ACCOUNT_DEADS:onenterReport( ProcessUnit, Task, From, Event, To )
|
||||||
self:E( { ProcessUnit, From, Event, To } )
|
|
||||||
|
|
||||||
local MessageText = "Your group with assigned " .. self.TaskName .. " task has " .. Task.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed."
|
local MessageText = "Your group with assigned " .. self.TaskName .. " task has " .. Task.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed."
|
||||||
self:GetCommandCenter():MessageTypeToGroup( MessageText, ProcessUnit:GetGroup(), MESSAGE.Type.Information )
|
self:GetCommandCenter():MessageTypeToGroup( MessageText, ProcessUnit:GetGroup(), MESSAGE.Type.Information )
|
||||||
|
|||||||
@ -156,7 +156,7 @@ do -- ACT_ASSIGN_ACCEPT
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ASSIGN_ACCEPT:onafterStart( ProcessUnit, From, Event, To )
|
function ACT_ASSIGN_ACCEPT:onafterStart( ProcessUnit, From, Event, To )
|
||||||
self:E( { ProcessUnit, From, Event, To } )
|
self:F( { ProcessUnit, From, Event, To } )
|
||||||
|
|
||||||
self:__Assign( 1 )
|
self:__Assign( 1 )
|
||||||
end
|
end
|
||||||
@ -168,8 +168,7 @@ do -- ACT_ASSIGN_ACCEPT
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ASSIGN_ACCEPT:onenterAssigned( ProcessUnit, From, Event, To )
|
function ACT_ASSIGN_ACCEPT:onenterAssigned( ProcessUnit, From, Event, To )
|
||||||
env.info( "in here" )
|
self:F( { ProcessUnit, From, Event, To } )
|
||||||
self:E( { ProcessUnit, From, Event, To } )
|
|
||||||
|
|
||||||
local ProcessGroup = ProcessUnit:GetGroup()
|
local ProcessGroup = ProcessUnit:GetGroup()
|
||||||
|
|
||||||
@ -234,7 +233,7 @@ do -- ACT_ASSIGN_MENU_ACCEPT
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ASSIGN_MENU_ACCEPT:onafterStart( ProcessUnit, From, Event, To )
|
function ACT_ASSIGN_MENU_ACCEPT:onafterStart( ProcessUnit, From, Event, To )
|
||||||
self:E( { ProcessUnit, From, Event, To } )
|
self:F( { ProcessUnit, From, Event, To } )
|
||||||
|
|
||||||
self:GetCommandCenter():MessageTypeToGroup( "Access the radio menu to accept the task. You have 30 seconds or the assignment will be cancelled.", ProcessUnit:GetGroup(), MESSAGE.Type.Information )
|
self:GetCommandCenter():MessageTypeToGroup( "Access the radio menu to accept the task. You have 30 seconds or the assignment will be cancelled.", ProcessUnit:GetGroup(), MESSAGE.Type.Information )
|
||||||
|
|
||||||
@ -248,7 +247,6 @@ do -- ACT_ASSIGN_MENU_ACCEPT
|
|||||||
--- Menu function.
|
--- Menu function.
|
||||||
-- @param #ACT_ASSIGN_MENU_ACCEPT self
|
-- @param #ACT_ASSIGN_MENU_ACCEPT self
|
||||||
function ACT_ASSIGN_MENU_ACCEPT:MenuAssign()
|
function ACT_ASSIGN_MENU_ACCEPT:MenuAssign()
|
||||||
self:E( )
|
|
||||||
|
|
||||||
self:__Assign( 1 )
|
self:__Assign( 1 )
|
||||||
end
|
end
|
||||||
@ -256,7 +254,6 @@ do -- ACT_ASSIGN_MENU_ACCEPT
|
|||||||
--- Menu function.
|
--- Menu function.
|
||||||
-- @param #ACT_ASSIGN_MENU_ACCEPT self
|
-- @param #ACT_ASSIGN_MENU_ACCEPT self
|
||||||
function ACT_ASSIGN_MENU_ACCEPT:MenuReject()
|
function ACT_ASSIGN_MENU_ACCEPT:MenuReject()
|
||||||
self:E( )
|
|
||||||
|
|
||||||
self:__Reject( 1 )
|
self:__Reject( 1 )
|
||||||
end
|
end
|
||||||
@ -268,7 +265,7 @@ do -- ACT_ASSIGN_MENU_ACCEPT
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ASSIGN_MENU_ACCEPT:onafterAssign( ProcessUnit, From, Event, To )
|
function ACT_ASSIGN_MENU_ACCEPT:onafterAssign( ProcessUnit, From, Event, To )
|
||||||
self:E( { ProcessUnit.UnitNameFrom, Event, To } )
|
self:F( { ProcessUnit.UnitNameFrom, Event, To } )
|
||||||
|
|
||||||
self.Menu:Remove()
|
self.Menu:Remove()
|
||||||
end
|
end
|
||||||
@ -280,7 +277,7 @@ do -- ACT_ASSIGN_MENU_ACCEPT
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ASSIGN_MENU_ACCEPT:onafterReject( ProcessUnit, From, Event, To )
|
function ACT_ASSIGN_MENU_ACCEPT:onafterReject( ProcessUnit, From, Event, To )
|
||||||
self:E( { ProcessUnit.UnitName, From, Event, To } )
|
self:F( { ProcessUnit.UnitName, From, Event, To } )
|
||||||
|
|
||||||
self.Menu:Remove()
|
self.Menu:Remove()
|
||||||
--TODO: need to resolve this problem ... it has to do with the events ...
|
--TODO: need to resolve this problem ... it has to do with the events ...
|
||||||
|
|||||||
@ -111,7 +111,6 @@ do -- ACT_ASSIST
|
|||||||
local MissionMenu = self:GetMission():GetMenu( ProcessGroup )
|
local MissionMenu = self:GetMission():GetMenu( ProcessGroup )
|
||||||
|
|
||||||
local function MenuSmoke( MenuParam )
|
local function MenuSmoke( MenuParam )
|
||||||
self:E( MenuParam )
|
|
||||||
local self = MenuParam.self
|
local self = MenuParam.self
|
||||||
local SmokeColor = MenuParam.SmokeColor
|
local SmokeColor = MenuParam.SmokeColor
|
||||||
self.SmokeColor = SmokeColor
|
self.SmokeColor = SmokeColor
|
||||||
|
|||||||
@ -83,7 +83,7 @@ end
|
|||||||
function PROCESS_JTAC:OnJTACMenuUpdate( Fsm, From, Event, To )
|
function PROCESS_JTAC:OnJTACMenuUpdate( Fsm, From, Event, To )
|
||||||
|
|
||||||
local function JTACMenuSpot( MenuParam )
|
local function JTACMenuSpot( MenuParam )
|
||||||
self:E( MenuParam.TargetUnit.UnitName )
|
self:F( MenuParam.TargetUnit.UnitName )
|
||||||
local self = MenuParam.self
|
local self = MenuParam.self
|
||||||
local TargetUnit = MenuParam.TargetUnit
|
local TargetUnit = MenuParam.TargetUnit
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ function PROCESS_JTAC:OnJTACMenuUpdate( Fsm, From, Event, To )
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function JTACMenuCancel( MenuParam )
|
local function JTACMenuCancel( MenuParam )
|
||||||
self:E( MenuParam )
|
self:F( MenuParam )
|
||||||
local self = MenuParam.self
|
local self = MenuParam.self
|
||||||
local TargetUnit = MenuParam.TargetUnit
|
local TargetUnit = MenuParam.TargetUnit
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ function PROCESS_JTAC:OnJTACMenuUpdate( Fsm, From, Event, To )
|
|||||||
-- Loop each unit in the target set, and determine the threat levels map table.
|
-- Loop each unit in the target set, and determine the threat levels map table.
|
||||||
local UnitThreatLevels = self.TargetSetUnit:GetUnitThreatLevels()
|
local UnitThreatLevels = self.TargetSetUnit:GetUnitThreatLevels()
|
||||||
|
|
||||||
self:E( {"UnitThreadLevels", UnitThreatLevels } )
|
self:F( {"UnitThreadLevels", UnitThreatLevels } )
|
||||||
|
|
||||||
local JTACMenu = self.ProcessGroup:GetState( self.ProcessGroup, "JTACMenu" )
|
local JTACMenu = self.ProcessGroup:GetState( self.ProcessGroup, "JTACMenu" )
|
||||||
|
|
||||||
|
|||||||
@ -158,8 +158,6 @@ do -- ACT_ROUTE
|
|||||||
-- @return #string
|
-- @return #string
|
||||||
function ACT_ROUTE:GetRouteText( Controllable )
|
function ACT_ROUTE:GetRouteText( Controllable )
|
||||||
|
|
||||||
self:E()
|
|
||||||
|
|
||||||
local RouteText = ""
|
local RouteText = ""
|
||||||
|
|
||||||
local Coordinate = nil -- Core.Point#COORDINATE
|
local Coordinate = nil -- Core.Point#COORDINATE
|
||||||
@ -182,13 +180,13 @@ do -- ACT_ROUTE
|
|||||||
local ShortestDistance = 0
|
local ShortestDistance = 0
|
||||||
local ShortestReferencePoint = nil
|
local ShortestReferencePoint = nil
|
||||||
local ShortestReferenceName = ""
|
local ShortestReferenceName = ""
|
||||||
self:E( { CC.ReferencePoints } )
|
self:F( { CC.ReferencePoints } )
|
||||||
for ZoneName, Zone in pairs( CC.ReferencePoints ) do
|
for ZoneName, Zone in pairs( CC.ReferencePoints ) do
|
||||||
self:E( { ZoneName = ZoneName } )
|
self:F( { ZoneName = ZoneName } )
|
||||||
local Zone = Zone -- Core.Zone#ZONE
|
local Zone = Zone -- Core.Zone#ZONE
|
||||||
local ZoneCoord = Zone:GetCoordinate()
|
local ZoneCoord = Zone:GetCoordinate()
|
||||||
local ZoneDistance = ZoneCoord:Get2DDistance( self.Coordinate )
|
local ZoneDistance = ZoneCoord:Get2DDistance( self.Coordinate )
|
||||||
self:E( { ShortestDistance, ShortestReferenceName } )
|
self:F( { ShortestDistance, ShortestReferenceName } )
|
||||||
if ShortestDistance == 0 or ZoneDistance < ShortestDistance then
|
if ShortestDistance == 0 or ZoneDistance < ShortestDistance then
|
||||||
ShortestDistance = ZoneDistance
|
ShortestDistance = ZoneDistance
|
||||||
ShortestReferencePoint = ZoneCoord
|
ShortestReferencePoint = ZoneCoord
|
||||||
@ -467,7 +465,7 @@ do -- ACT_ROUTE_ZONE
|
|||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
function ACT_ROUTE_ZONE:onafterReport( ProcessUnit, From, Event, To )
|
function ACT_ROUTE_ZONE:onafterReport( ProcessUnit, From, Event, To )
|
||||||
self:E( { ProcessUnit = ProcessUnit } )
|
self:F( { ProcessUnit = ProcessUnit } )
|
||||||
|
|
||||||
local RouteText = self:GetRouteText( ProcessUnit )
|
local RouteText = self:GetRouteText( ProcessUnit )
|
||||||
self:GetCommandCenter():MessageTypeToGroup( RouteText, ProcessUnit:GetGroup(), MESSAGE.Type.Update )
|
self:GetCommandCenter():MessageTypeToGroup( RouteText, ProcessUnit:GetGroup(), MESSAGE.Type.Update )
|
||||||
|
|||||||
@ -472,7 +472,7 @@ end
|
|||||||
-- @return #EVENT.Events
|
-- @return #EVENT.Events
|
||||||
function EVENT:Reset( EventObject ) --R2.1
|
function EVENT:Reset( EventObject ) --R2.1
|
||||||
|
|
||||||
self:E( { "Resetting subscriptions for class: ", EventObject:GetClassNameAndID() } )
|
self:F( { "Resetting subscriptions for class: ", EventObject:GetClassNameAndID() } )
|
||||||
|
|
||||||
local EventPriority = EventObject:GetEventPriority()
|
local EventPriority = EventObject:GetEventPriority()
|
||||||
for EventID, EventData in pairs( self.Events ) do
|
for EventID, EventData in pairs( self.Events ) do
|
||||||
@ -562,7 +562,6 @@ end
|
|||||||
-- @param EventID
|
-- @param EventID
|
||||||
-- @return #EVENT
|
-- @return #EVENT
|
||||||
function EVENT:OnEventForGroup( GroupName, EventFunction, EventClass, EventID, ... )
|
function EVENT:OnEventForGroup( GroupName, EventFunction, EventClass, EventID, ... )
|
||||||
self:E( GroupName )
|
|
||||||
|
|
||||||
local Event = self:Init( EventID, EventClass )
|
local Event = self:Init( EventID, EventClass )
|
||||||
Event.EventGroup = true
|
Event.EventGroup = true
|
||||||
@ -899,7 +898,7 @@ function EVENT:onEvent( Event )
|
|||||||
if EventData.EventFunction then
|
if EventData.EventFunction then
|
||||||
|
|
||||||
if Event.IniObjectCategory ~= 3 then
|
if Event.IniObjectCategory ~= 3 then
|
||||||
self:E( { "Calling EventFunction for UNIT ", EventClass:GetClassNameAndID(), ", Unit ", Event.IniUnitName, EventPriority } )
|
self:F( { "Calling EventFunction for UNIT ", EventClass:GetClassNameAndID(), ", Unit ", Event.IniUnitName, EventPriority } )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Result, Value = xpcall(
|
local Result, Value = xpcall(
|
||||||
@ -915,7 +914,7 @@ function EVENT:onEvent( Event )
|
|||||||
|
|
||||||
-- Now call the default event function.
|
-- Now call the default event function.
|
||||||
if Event.IniObjectCategory ~= 3 then
|
if Event.IniObjectCategory ~= 3 then
|
||||||
self:E( { "Calling " .. EventMeta.Event .. " for Class ", EventClass:GetClassNameAndID(), EventPriority } )
|
self:F( { "Calling " .. EventMeta.Event .. " for Class ", EventClass:GetClassNameAndID(), EventPriority } )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Result, Value = xpcall(
|
local Result, Value = xpcall(
|
||||||
@ -950,7 +949,7 @@ function EVENT:onEvent( Event )
|
|||||||
if EventData.EventFunction then
|
if EventData.EventFunction then
|
||||||
|
|
||||||
if Event.IniObjectCategory ~= 3 then
|
if Event.IniObjectCategory ~= 3 then
|
||||||
self:E( { "Calling EventFunction for GROUP ", EventClass:GetClassNameAndID(), ", Unit ", Event.IniUnitName, EventPriority } )
|
self:F( { "Calling EventFunction for GROUP ", EventClass:GetClassNameAndID(), ", Unit ", Event.IniUnitName, EventPriority } )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Result, Value = xpcall(
|
local Result, Value = xpcall(
|
||||||
@ -966,7 +965,7 @@ function EVENT:onEvent( Event )
|
|||||||
|
|
||||||
-- Now call the default event function.
|
-- Now call the default event function.
|
||||||
if Event.IniObjectCategory ~= 3 then
|
if Event.IniObjectCategory ~= 3 then
|
||||||
self:E( { "Calling " .. EventMeta.Event .. " for GROUP ", EventClass:GetClassNameAndID(), EventPriority } )
|
self:F( { "Calling " .. EventMeta.Event .. " for GROUP ", EventClass:GetClassNameAndID(), EventPriority } )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Result, Value = xpcall(
|
local Result, Value = xpcall(
|
||||||
|
|||||||
@ -1244,7 +1244,7 @@ do -- COORDINATE
|
|||||||
-- @return #string The coordinate Text in the configured coordinate system.
|
-- @return #string The coordinate Text in the configured coordinate system.
|
||||||
function COORDINATE:ToStringFromRP( ReferenceCoord, ReferenceName, Controllable, Settings ) -- R2.2
|
function COORDINATE:ToStringFromRP( ReferenceCoord, ReferenceName, Controllable, Settings ) -- R2.2
|
||||||
|
|
||||||
self:E( { ReferenceCoord = ReferenceCoord, ReferenceName = ReferenceName } )
|
self:F( { ReferenceCoord = ReferenceCoord, ReferenceName = ReferenceName } )
|
||||||
|
|
||||||
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
|
||||||
|
|
||||||
|
|||||||
@ -1694,10 +1694,10 @@ do -- SET_UNIT
|
|||||||
local function EvaluateZone( ZoneUnit )
|
local function EvaluateZone( ZoneUnit )
|
||||||
|
|
||||||
local ZoneUnitName = ZoneUnit:GetName()
|
local ZoneUnitName = ZoneUnit:GetName()
|
||||||
self:E( { ZoneUnitName = ZoneUnitName } )
|
self:F( { ZoneUnitName = ZoneUnitName } )
|
||||||
if self:FindUnit( ZoneUnitName ) then
|
if self:FindUnit( ZoneUnitName ) then
|
||||||
IsPartiallyInZone = true
|
IsPartiallyInZone = true
|
||||||
self:E( { Found = true } )
|
self:F( { Found = true } )
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2179,7 +2179,7 @@ do -- SET_UNIT
|
|||||||
if self.Filter.Coalitions then
|
if self.Filter.Coalitions then
|
||||||
local MUnitCoalition = false
|
local MUnitCoalition = false
|
||||||
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
||||||
self:E( { "Coalition:", MUnit:GetCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
|
self:F( { "Coalition:", MUnit:GetCoalition(), self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
|
||||||
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == MUnit:GetCoalition() then
|
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == MUnit:GetCoalition() then
|
||||||
MUnitCoalition = true
|
MUnitCoalition = true
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1133,7 +1133,7 @@ end
|
|||||||
-- Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "Carrier" ), SPAWN.Takeoff.Cold )
|
-- Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "Carrier" ), SPAWN.Takeoff.Cold )
|
||||||
--
|
--
|
||||||
function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude ) -- R2.2
|
function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude ) -- R2.2
|
||||||
self:E( { self.SpawnTemplatePrefix, SpawnAirbase, Takeoff, TakeoffAltitude } )
|
self:F( { self.SpawnTemplatePrefix, SpawnAirbase, Takeoff, TakeoffAltitude } )
|
||||||
|
|
||||||
local PointVec3 = SpawnAirbase:GetPointVec3()
|
local PointVec3 = SpawnAirbase:GetPointVec3()
|
||||||
self:T2(PointVec3)
|
self:T2(PointVec3)
|
||||||
|
|||||||
@ -200,7 +200,7 @@ do
|
|||||||
-- @param #number LaserCode
|
-- @param #number LaserCode
|
||||||
-- @param #number Duration
|
-- @param #number Duration
|
||||||
function SPOT:onafterLaseOn( From, Event, To, Target, LaserCode, Duration )
|
function SPOT:onafterLaseOn( From, Event, To, Target, LaserCode, Duration )
|
||||||
self:E( { "LaseOn", Target, LaserCode, Duration } )
|
self:F( { "LaseOn", Target, LaserCode, Duration } )
|
||||||
|
|
||||||
local function StopLase( self )
|
local function StopLase( self )
|
||||||
self:LaseOff()
|
self:LaseOff()
|
||||||
@ -228,10 +228,10 @@ do
|
|||||||
--- @param #SPOT self
|
--- @param #SPOT self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function SPOT:OnEventDead(EventData)
|
function SPOT:OnEventDead(EventData)
|
||||||
self:E( { Dead = EventData.IniDCSUnitName, Target = self.Target } )
|
self:F( { Dead = EventData.IniDCSUnitName, Target = self.Target } )
|
||||||
if self.Target then
|
if self.Target then
|
||||||
if EventData.IniDCSUnitName == self.Target:GetName() then
|
if EventData.IniDCSUnitName == self.Target:GetName() then
|
||||||
self:E( {"Target dead ", self.Target:GetName() } )
|
self:F( {"Target dead ", self.Target:GetName() } )
|
||||||
self:Destroyed()
|
self:Destroyed()
|
||||||
self:LaseOff()
|
self:LaseOff()
|
||||||
end
|
end
|
||||||
@ -249,7 +249,7 @@ do
|
|||||||
self.SpotLaser:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
|
self.SpotLaser:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
|
||||||
self:__Lasing( -0.2 )
|
self:__Lasing( -0.2 )
|
||||||
else
|
else
|
||||||
self:E( { "Target is not alive", self.Target:IsAlive() } )
|
self:F( { "Target is not alive", self.Target:IsAlive() } )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -261,7 +261,7 @@ do
|
|||||||
-- @return #SPOT
|
-- @return #SPOT
|
||||||
function SPOT:onafterLaseOff( From, Event, To )
|
function SPOT:onafterLaseOff( From, Event, To )
|
||||||
|
|
||||||
self:E( {"Stopped lasing for ", self.Target:GetName() , SpotIR = self.SportIR, SpotLaser = self.SpotLaser } )
|
self:F( {"Stopped lasing for ", self.Target:GetName() , SpotIR = self.SportIR, SpotLaser = self.SpotLaser } )
|
||||||
|
|
||||||
self.Lasing = false
|
self.Lasing = false
|
||||||
|
|
||||||
|
|||||||
@ -607,7 +607,7 @@ function ZONE_RADIUS:Scan( ObjectCategories )
|
|||||||
local ZoneCoord = self:GetCoordinate()
|
local ZoneCoord = self:GetCoordinate()
|
||||||
local ZoneRadius = self:GetRadius()
|
local ZoneRadius = self:GetRadius()
|
||||||
|
|
||||||
self:E({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
||||||
|
|
||||||
local SphereSearch = {
|
local SphereSearch = {
|
||||||
id = world.VolumeType.SPHERE,
|
id = world.VolumeType.SPHERE,
|
||||||
@ -625,14 +625,14 @@ function ZONE_RADIUS:Scan( ObjectCategories )
|
|||||||
(ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
|
(ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
|
||||||
local CoalitionDCSUnit = ZoneObject:getCoalition()
|
local CoalitionDCSUnit = ZoneObject:getCoalition()
|
||||||
self.ScanData.Coalitions[CoalitionDCSUnit] = true
|
self.ScanData.Coalitions[CoalitionDCSUnit] = true
|
||||||
self:E( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
self:F( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
|
||||||
end
|
end
|
||||||
if ObjectCategory == Object.Category.SCENERY then
|
if ObjectCategory == Object.Category.SCENERY then
|
||||||
local SceneryType = ZoneObject:getTypeName()
|
local SceneryType = ZoneObject:getTypeName()
|
||||||
local SceneryName = ZoneObject:getName()
|
local SceneryName = ZoneObject:getName()
|
||||||
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
||||||
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
|
||||||
self:E( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
self:F( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@ -779,7 +779,7 @@ function ZONE_RADIUS:SearchZone( EvaluateFunction, ObjectCategories )
|
|||||||
local ZoneCoord = self:GetCoordinate()
|
local ZoneCoord = self:GetCoordinate()
|
||||||
local ZoneRadius = self:GetRadius()
|
local ZoneRadius = self:GetRadius()
|
||||||
|
|
||||||
self:E({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()})
|
||||||
|
|
||||||
local SphereSearch = {
|
local SphereSearch = {
|
||||||
id = world.VolumeType.SPHERE,
|
id = world.VolumeType.SPHERE,
|
||||||
|
|||||||
@ -573,7 +573,7 @@ do -- DESIGNATE
|
|||||||
function DESIGNATE:SetLaserCodes( LaserCodes ) --R2.1
|
function DESIGNATE:SetLaserCodes( LaserCodes ) --R2.1
|
||||||
|
|
||||||
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
|
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
|
||||||
self:E( { LaserCodes = self.LaserCodes } )
|
self:F( { LaserCodes = self.LaserCodes } )
|
||||||
|
|
||||||
self.LaserCodesUsed = {}
|
self.LaserCodesUsed = {}
|
||||||
|
|
||||||
@ -938,7 +938,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
for DesignateIndex, Designating in pairs( self.Designating ) do
|
for DesignateIndex, Designating in pairs( self.Designating ) do
|
||||||
|
|
||||||
local DetectedItem = self.Detection:GetDetectedItem( DesignateIndex )
|
local DetectedItem = self.Detection:GetDetectedItemByIndex( DesignateIndex )
|
||||||
|
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
|
|
||||||
@ -987,7 +987,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuStatus( AttackGroup )
|
function DESIGNATE:MenuStatus( AttackGroup )
|
||||||
|
|
||||||
self:E("Status")
|
self:F("Status")
|
||||||
|
|
||||||
self:SendStatus( AttackGroup )
|
self:SendStatus( AttackGroup )
|
||||||
end
|
end
|
||||||
@ -996,7 +996,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuFlashStatus( AttackGroup, Flash )
|
function DESIGNATE:MenuFlashStatus( AttackGroup, Flash )
|
||||||
|
|
||||||
self:E("Flash Status")
|
self:F("Flash Status")
|
||||||
|
|
||||||
self.FlashStatusMenu[AttackGroup] = Flash
|
self.FlashStatusMenu[AttackGroup] = Flash
|
||||||
self:SetDesignateMenu()
|
self:SetDesignateMenu()
|
||||||
@ -1007,7 +1007,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuForget( Index )
|
function DESIGNATE:MenuForget( Index )
|
||||||
|
|
||||||
self:E("Forget")
|
self:F("Forget")
|
||||||
|
|
||||||
self.Designating[Index] = ""
|
self.Designating[Index] = ""
|
||||||
self:SetDesignateMenu()
|
self:SetDesignateMenu()
|
||||||
@ -1017,7 +1017,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuAutoLase( AutoLase )
|
function DESIGNATE:MenuAutoLase( AutoLase )
|
||||||
|
|
||||||
self:E("AutoLase")
|
self:F("AutoLase")
|
||||||
|
|
||||||
self:SetAutoLase( AutoLase, true )
|
self:SetAutoLase( AutoLase, true )
|
||||||
end
|
end
|
||||||
@ -1026,7 +1026,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuSmoke( Index, Color )
|
function DESIGNATE:MenuSmoke( Index, Color )
|
||||||
|
|
||||||
self:E("Designate through Smoke")
|
self:F("Designate through Smoke")
|
||||||
|
|
||||||
if string.find( self.Designating[Index], "S" ) == nil then
|
if string.find( self.Designating[Index], "S" ) == nil then
|
||||||
self.Designating[Index] = self.Designating[Index] .. "S"
|
self.Designating[Index] = self.Designating[Index] .. "S"
|
||||||
@ -1039,7 +1039,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuIlluminate( Index )
|
function DESIGNATE:MenuIlluminate( Index )
|
||||||
|
|
||||||
self:E("Designate through Illumination")
|
self:F("Designate through Illumination")
|
||||||
|
|
||||||
if string.find( self.Designating[Index], "I", 1, true ) == nil then
|
if string.find( self.Designating[Index], "I", 1, true ) == nil then
|
||||||
self.Designating[Index] = self.Designating[Index] .. "I"
|
self.Designating[Index] = self.Designating[Index] .. "I"
|
||||||
@ -1053,7 +1053,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuLaseOn( Index, Duration )
|
function DESIGNATE:MenuLaseOn( Index, Duration )
|
||||||
|
|
||||||
self:E("Designate through Lase")
|
self:F("Designate through Lase")
|
||||||
|
|
||||||
self:__LaseOn( 1, Index, Duration )
|
self:__LaseOn( 1, Index, Duration )
|
||||||
self:SetDesignateMenu()
|
self:SetDesignateMenu()
|
||||||
@ -1064,7 +1064,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuLaseCode( Index, Duration, LaserCode )
|
function DESIGNATE:MenuLaseCode( Index, Duration, LaserCode )
|
||||||
|
|
||||||
self:E( "Designate through Lase using " .. LaserCode )
|
self:F( "Designate through Lase using " .. LaserCode )
|
||||||
|
|
||||||
self:__LaseOn( 1, Index, Duration, LaserCode )
|
self:__LaseOn( 1, Index, Duration, LaserCode )
|
||||||
self:SetDesignateMenu()
|
self:SetDesignateMenu()
|
||||||
@ -1075,7 +1075,7 @@ do -- DESIGNATE
|
|||||||
-- @param #DESIGNATE self
|
-- @param #DESIGNATE self
|
||||||
function DESIGNATE:MenuLaseOff( Index, Duration )
|
function DESIGNATE:MenuLaseOff( Index, Duration )
|
||||||
|
|
||||||
self:E("Lasing off")
|
self:F("Lasing off")
|
||||||
|
|
||||||
self.Designating[Index] = string.gsub( self.Designating[Index], "L", "" )
|
self.Designating[Index] = string.gsub( self.Designating[Index], "L", "" )
|
||||||
self:__LaseOff( 1, Index )
|
self:__LaseOff( 1, Index )
|
||||||
@ -1155,7 +1155,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
if not Recce then
|
if not Recce then
|
||||||
|
|
||||||
self:E( "Lasing..." )
|
self:F( "Lasing..." )
|
||||||
self.RecceSet:Flush()
|
self.RecceSet:Flush()
|
||||||
|
|
||||||
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
|
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
|
||||||
@ -1307,7 +1307,7 @@ do -- DESIGNATE
|
|||||||
|
|
||||||
MarkedCount = MarkedCount + 1
|
MarkedCount = MarkedCount + 1
|
||||||
|
|
||||||
self:E( "Smoking ..." )
|
self:F( "Smoking ..." )
|
||||||
|
|
||||||
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
|
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
|
||||||
local RecceUnit = RecceGroup:GetUnit( 1 )
|
local RecceUnit = RecceGroup:GetUnit( 1 )
|
||||||
|
|||||||
@ -275,6 +275,7 @@ do -- DETECTION_BASE
|
|||||||
DetectionRun = 0,
|
DetectionRun = 0,
|
||||||
DetectedObjectsIdentified = {},
|
DetectedObjectsIdentified = {},
|
||||||
DetectedItems = {},
|
DetectedItems = {},
|
||||||
|
DetectedItemsByIndex = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @type DETECTION_BASE.DetectedObjects
|
--- @type DETECTION_BASE.DetectedObjects
|
||||||
@ -515,7 +516,7 @@ do -- DETECTION_BASE
|
|||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function DETECTION_BASE:onafterDetect(From,Event,To)
|
function DETECTION_BASE:onafterDetect(From,Event,To)
|
||||||
self:E( { From, Event, To } )
|
self:F( { From, Event, To } )
|
||||||
|
|
||||||
local DetectDelay = 0.1
|
local DetectDelay = 0.1
|
||||||
self.DetectionCount = 0
|
self.DetectionCount = 0
|
||||||
@ -525,7 +526,7 @@ do -- DETECTION_BASE
|
|||||||
local DetectionTimeStamp = timer.getTime()
|
local DetectionTimeStamp = timer.getTime()
|
||||||
|
|
||||||
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||||
--self:E( { DetectionGroupData } )
|
--self:F( { DetectionGroupData } )
|
||||||
self:__DetectionGroup( DetectDelay, DetectionGroupData, DetectionTimeStamp ) -- Process each detection asynchronously.
|
self:__DetectionGroup( DetectDelay, DetectionGroupData, DetectionTimeStamp ) -- Process each detection asynchronously.
|
||||||
self.DetectionCount = self.DetectionCount + 1
|
self.DetectionCount = self.DetectionCount + 1
|
||||||
DetectDelay = DetectDelay + 1
|
DetectDelay = DetectDelay + 1
|
||||||
@ -538,7 +539,7 @@ do -- DETECTION_BASE
|
|||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
-- @param Wrapper.Group#GROUP DetectionGroup The Group detecting.
|
-- @param Wrapper.Group#GROUP DetectionGroup The Group detecting.
|
||||||
function DETECTION_BASE:onafterDetectionGroup( From, Event, To, DetectionGroup, DetectionTimeStamp )
|
function DETECTION_BASE:onafterDetectionGroup( From, Event, To, DetectionGroup, DetectionTimeStamp )
|
||||||
self:E( { From, Event, To } )
|
self:F( { From, Event, To } )
|
||||||
|
|
||||||
self.DetectionRun = self.DetectionRun + 1
|
self.DetectionRun = self.DetectionRun + 1
|
||||||
|
|
||||||
@ -672,7 +673,7 @@ do -- DETECTION_BASE
|
|||||||
if not self.DetectedObjects[DetectedObjectName] and Detection.visible and self.ZoneProbability then
|
if not self.DetectedObjects[DetectedObjectName] and Detection.visible and self.ZoneProbability then
|
||||||
|
|
||||||
for ZoneDataID, ZoneData in pairs( self.ZoneProbability ) do
|
for ZoneDataID, ZoneData in pairs( self.ZoneProbability ) do
|
||||||
self:E({ZoneData})
|
self:F({ZoneData})
|
||||||
local ZoneObject = ZoneData[1] -- Core.Zone#ZONE_BASE
|
local ZoneObject = ZoneData[1] -- Core.Zone#ZONE_BASE
|
||||||
local ZoneProbability = ZoneData[2] -- #number
|
local ZoneProbability = ZoneData[2] -- #number
|
||||||
ZoneProbability = ZoneProbability * 30 / 300
|
ZoneProbability = ZoneProbability * 30 / 300
|
||||||
@ -784,7 +785,7 @@ do -- DETECTION_BASE
|
|||||||
local DetectedItems = self:GetDetectedItems()
|
local DetectedItems = self:GetDetectedItems()
|
||||||
|
|
||||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||||
local DetectedSet = self:GetDetectedSet( DetectedItemIndex )
|
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||||
if DetectedSet then
|
if DetectedSet then
|
||||||
DetectedSet:RemoveUnitsByName( UnitName )
|
DetectedSet:RemoveUnitsByName( UnitName )
|
||||||
end
|
end
|
||||||
@ -799,7 +800,7 @@ do -- DETECTION_BASE
|
|||||||
function DETECTION_BASE:CreateDetectionItems()
|
function DETECTION_BASE:CreateDetectionItems()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
self:E( "Error, in DETECTION_BASE class..." )
|
self:F( "Error, in DETECTION_BASE class..." )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1000,7 +1001,7 @@ do -- DETECTION_BASE
|
|||||||
self.AcceptZones = AcceptZones
|
self.AcceptZones = AcceptZones
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E( { "AcceptZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", AcceptZones } )
|
self:F( { "AcceptZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", AcceptZones } )
|
||||||
error()
|
error()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1021,7 +1022,7 @@ do -- DETECTION_BASE
|
|||||||
self.RejectZones = RejectZones
|
self.RejectZones = RejectZones
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E( { "RejectZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", RejectZones } )
|
self:F( { "RejectZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", RejectZones } )
|
||||||
error()
|
error()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1113,7 +1114,7 @@ do -- DETECTION_BASE
|
|||||||
DetectedItem.Changes[ChangeCode].ID = ID
|
DetectedItem.Changes[ChangeCode].ID = ID
|
||||||
DetectedItem.Changes[ChangeCode].ItemUnitType = ItemUnitType
|
DetectedItem.Changes[ChangeCode].ItemUnitType = ItemUnitType
|
||||||
|
|
||||||
self:E( { "Change on Detected Item:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ItemUnitType = ItemUnitType } )
|
self:F( { "Change on Detected Item:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ItemUnitType = ItemUnitType } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -1136,7 +1137,7 @@ do -- DETECTION_BASE
|
|||||||
DetectedItem.Changes[ChangeCode][ChangeUnitType] = DetectedItem.Changes[ChangeCode][ChangeUnitType] + 1
|
DetectedItem.Changes[ChangeCode][ChangeUnitType] = DetectedItem.Changes[ChangeCode][ChangeUnitType] + 1
|
||||||
DetectedItem.Changes[ChangeCode].ID = ID
|
DetectedItem.Changes[ChangeCode].ID = ID
|
||||||
|
|
||||||
self:E( { "Change on Detected Unit:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ChangeUnitType = ChangeUnitType } )
|
self:F( { "Change on Detected Unit:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ChangeUnitType = ChangeUnitType } )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -1458,23 +1459,26 @@ do -- DETECTION_BASE
|
|||||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param ItemPrefix
|
-- @param ItemPrefix
|
||||||
-- @param #string DetectedItemIndex The index of the DetectedItem.
|
-- @param DetectedItemKey The key of the DetectedItem.
|
||||||
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
||||||
-- @return #DETECTION_BASE.DetectedItem
|
-- @return #DETECTION_BASE.DetectedItem
|
||||||
function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemIndex, Set )
|
function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemKey, Set )
|
||||||
|
|
||||||
local DetectedItem = {}
|
local DetectedItem = {}
|
||||||
self.DetectedItemCount = self.DetectedItemCount + 1
|
self.DetectedItemCount = self.DetectedItemCount + 1
|
||||||
self.DetectedItemMax = self.DetectedItemMax + 1
|
self.DetectedItemMax = self.DetectedItemMax + 1
|
||||||
|
|
||||||
if DetectedItemIndex then
|
if DetectedItemKey then
|
||||||
self.DetectedItems[DetectedItemIndex] = DetectedItem
|
self.DetectedItems[DetectedItemKey] = DetectedItem
|
||||||
else
|
else
|
||||||
self.DetectedItems[self.DetectedItemMax] = DetectedItem
|
self.DetectedItems[self.DetectedItemMax] = DetectedItem
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.DetectedItemsByIndex[self.DetectedItemMax] = DetectedItem
|
||||||
|
|
||||||
|
|
||||||
DetectedItem.Set = Set or SET_UNIT:New():FilterDeads():FilterCrashes()
|
DetectedItem.Set = Set or SET_UNIT:New():FilterDeads():FilterCrashes()
|
||||||
DetectedItem.Index = DetectedItemIndex or self.DetectedItemMax
|
DetectedItem.Index = DetectedItemKey or self.DetectedItemMax
|
||||||
DetectedItem.ItemID = ItemPrefix .. "." .. self.DetectedItemMax
|
DetectedItem.ItemID = ItemPrefix .. "." .. self.DetectedItemMax
|
||||||
DetectedItem.ID = self.DetectedItemMax
|
DetectedItem.ID = self.DetectedItemMax
|
||||||
DetectedItem.Removed = false
|
DetectedItem.Removed = false
|
||||||
@ -1485,13 +1489,13 @@ do -- DETECTION_BASE
|
|||||||
--- Adds a new DetectedItem to the DetectedItems list.
|
--- Adds a new DetectedItem to the DetectedItems list.
|
||||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #string DetectedItemIndex The index of the DetectedItem.
|
-- @param DetectedItemKey The key of the DetectedItem.
|
||||||
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
||||||
-- @param Core.Zone#ZONE_UNIT Zone (optional) The Zone to be added where the Units are located.
|
-- @param Core.Zone#ZONE_UNIT Zone (optional) The Zone to be added where the Units are located.
|
||||||
-- @return #DETECTION_BASE.DetectedItem
|
-- @return #DETECTION_BASE.DetectedItem
|
||||||
function DETECTION_BASE:AddDetectedItemZone( DetectedItemIndex, Set, Zone )
|
function DETECTION_BASE:AddDetectedItemZone( DetectedItemKey, Set, Zone )
|
||||||
|
|
||||||
local DetectedItem = self:AddDetectedItem( "AREA", DetectedItemIndex, Set )
|
local DetectedItem = self:AddDetectedItem( "AREA", DetectedItemKey, Set )
|
||||||
|
|
||||||
DetectedItem.Zone = Zone
|
DetectedItem.Zone = Zone
|
||||||
|
|
||||||
@ -1501,12 +1505,16 @@ do -- DETECTION_BASE
|
|||||||
--- Removes an existing DetectedItem from the DetectedItems list.
|
--- Removes an existing DetectedItem from the DetectedItems list.
|
||||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number DetectedItemIndex The index or position in the DetectedItems list where the item needs to be removed.
|
-- @param DetectedItemKey The key in the DetectedItems list where the item needs to be removed.
|
||||||
function DETECTION_BASE:RemoveDetectedItem( DetectedItemIndex )
|
function DETECTION_BASE:RemoveDetectedItem( DetectedItemKey )
|
||||||
|
|
||||||
if self.DetectedItems[DetectedItemIndex] then
|
local DetectedItem = self.DetectedItems[DetectedItemKey]
|
||||||
|
|
||||||
|
if DetectedItem then
|
||||||
self.DetectedItemCount = self.DetectedItemCount - 1
|
self.DetectedItemCount = self.DetectedItemCount - 1
|
||||||
self.DetectedItems[DetectedItemIndex] = nil
|
local DetectedItemIndex = DetectedItem.Index
|
||||||
|
self.DetectedItemsByIndex[DetectedItemIndex] = nil
|
||||||
|
self.DetectedItems[DetectedItemKey] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1528,13 +1536,31 @@ do -- DETECTION_BASE
|
|||||||
return DetectedCount
|
return DetectedCount
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get a detected item using a given Key.
|
||||||
|
-- @param #DETECTION_BASE self
|
||||||
|
-- @param Key
|
||||||
|
-- @return #DETECTION_BASE.DetectedItem
|
||||||
|
function DETECTION_BASE:GetDetectedItemByKey( Key )
|
||||||
|
|
||||||
|
self:F( { DetectedItems = self.DetectedItems } )
|
||||||
|
|
||||||
|
local DetectedItem = self.DetectedItems[Key]
|
||||||
|
if DetectedItem then
|
||||||
|
return DetectedItem
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
--- Get a detected item using a given numeric index.
|
--- Get a detected item using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #number Index
|
||||||
-- @return #DETECTION_BASE.DetectedItem
|
-- @return #DETECTION_BASE.DetectedItem
|
||||||
function DETECTION_BASE:GetDetectedItem( Index )
|
function DETECTION_BASE:GetDetectedItemByIndex( Index )
|
||||||
|
|
||||||
local DetectedItem = self.DetectedItems[Index]
|
self:F( { DetectedItemsByIndex = self.DetectedItemsByIndex } )
|
||||||
|
|
||||||
|
local DetectedItem = self.DetectedItemsByIndex[Index]
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
return DetectedItem
|
return DetectedItem
|
||||||
end
|
end
|
||||||
@ -1544,16 +1570,11 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get a detected ItemID using a given numeric index.
|
--- Get a detected ItemID using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @return #string DetectedItemID
|
-- @return #string DetectedItemID
|
||||||
function DETECTION_BASE:GetDetectedItemID( Index ) --R2.1
|
function DETECTION_BASE:GetDetectedItemID( DetectedItem ) --R2.1
|
||||||
|
|
||||||
local DetectedItem = self.DetectedItems[Index]
|
return DetectedItem and DetectedItem.ItemID or ""
|
||||||
if DetectedItem then
|
|
||||||
return DetectedItem.ItemID
|
|
||||||
end
|
|
||||||
|
|
||||||
return ""
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get a detected ID using a given numeric index.
|
--- Get a detected ID using a given numeric index.
|
||||||
@ -1562,7 +1583,7 @@ do -- DETECTION_BASE
|
|||||||
-- @return #string DetectedItemID
|
-- @return #string DetectedItemID
|
||||||
function DETECTION_BASE:GetDetectedID( Index ) --R2.1
|
function DETECTION_BASE:GetDetectedID( Index ) --R2.1
|
||||||
|
|
||||||
local DetectedItem = self.DetectedItems[Index]
|
local DetectedItem = self.DetectedItemsByIndex[Index]
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
return DetectedItem.ID
|
return DetectedItem.ID
|
||||||
end
|
end
|
||||||
@ -1572,12 +1593,11 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get the @{Set#SET_UNIT} of a detecttion area using a given numeric index.
|
--- Get the @{Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem
|
||||||
-- @return Core.Set#SET_UNIT DetectedSet
|
-- @return Core.Set#SET_UNIT DetectedSet
|
||||||
function DETECTION_BASE:GetDetectedSet( Index )
|
function DETECTION_BASE:GetDetectedSet( DetectedItem )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
local DetectedSetUnit = DetectedItem and DetectedItem.Set
|
||||||
local DetectedSetUnit = DetectedItem.Set
|
|
||||||
if DetectedSetUnit then
|
if DetectedSetUnit then
|
||||||
return DetectedSetUnit
|
return DetectedSetUnit
|
||||||
end
|
end
|
||||||
@ -1622,11 +1642,11 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get the @{Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
--- Get the @{Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
||||||
function DETECTION_BASE:GetDetectedItemZone( Index )
|
function DETECTION_BASE:GetDetectedItemZone( DetectedItem )
|
||||||
|
|
||||||
local DetectedZone = self.DetectedItems[Index].Zone
|
local DetectedZone = DetectedItem and DetectedItem.Zone
|
||||||
if DetectedZone then
|
if DetectedZone then
|
||||||
return DetectedZone
|
return DetectedZone
|
||||||
end
|
end
|
||||||
@ -1641,7 +1661,7 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Set the detected item coordinate.
|
--- Set the detected item coordinate.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #DETECTION_BASE.DetectedItem The DetectedItem to set the coordinate at.
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem to set the coordinate at.
|
||||||
-- @param Core.Point#COORDINATE Coordinate The coordinate to set the last know detected position at.
|
-- @param Core.Point#COORDINATE Coordinate The coordinate to set the last know detected position at.
|
||||||
-- @param Wrapper.Unit#UNIT DetectedItemUnit The unit to set the heading and altitude from.
|
-- @param Wrapper.Unit#UNIT DetectedItemUnit The unit to set the heading and altitude from.
|
||||||
-- @return #DETECTION_BASE
|
-- @return #DETECTION_BASE
|
||||||
@ -1661,13 +1681,11 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get the detected item coordinate.
|
--- Get the detected item coordinate.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem to set the coordinate at.
|
||||||
-- @return Core.Point#COORDINATE
|
-- @return Core.Point#COORDINATE
|
||||||
function DETECTION_BASE:GetDetectedItemCoordinate( Index )
|
function DETECTION_BASE:GetDetectedItemCoordinate( DetectedItem )
|
||||||
self:F( { Index = Index } )
|
self:F( { DetectedItem = DetectedItem } )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
|
||||||
|
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
return DetectedItem.Coordinate
|
return DetectedItem.Coordinate
|
||||||
end
|
end
|
||||||
@ -1692,42 +1710,27 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get the detected item coordinate.
|
--- Get the detected item coordinate.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param #number Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @return #number ThreatLevel
|
-- @return #number ThreatLevel
|
||||||
function DETECTION_BASE:GetDetectedItemThreatLevel( Index )
|
function DETECTION_BASE:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
self:F( { Index = Index } )
|
self:F( { DetectedItem = DetectedItem } )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
|
||||||
|
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
|
self:F( { ThreatLevel = DetectedItem.ThreatLevel, ThreatText = DetectedItem.ThreatText } )
|
||||||
return DetectedItem.ThreatLevel or 0, DetectedItem.ThreatText or ""
|
return DetectedItem.ThreatLevel or 0, DetectedItem.ThreatText or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil, ""
|
return nil, ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Menu of a detected item using a given numeric index.
|
|
||||||
-- @param #DETECTION_BASE self
|
|
||||||
-- @param Index
|
|
||||||
-- @return #string
|
|
||||||
function DETECTION_BASE:DetectedItemMenu( Index, AttackGroup )
|
|
||||||
self:F( Index )
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--- Report summary of a detected item using a given numeric index.
|
--- Report summary of a detected item using a given numeric index.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @param Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||||
-- @return Core.Report#REPORT
|
-- @return Core.Report#REPORT
|
||||||
function DETECTION_BASE:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
function DETECTION_BASE:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||||
self:F( Index )
|
self:F( Index )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@ -1764,7 +1767,7 @@ do -- DETECTION_BASE
|
|||||||
for RecceUnit, RecceUnit in pairs( RecceGroup:GetUnits() ) do
|
for RecceUnit, RecceUnit in pairs( RecceGroup:GetUnits() ) do
|
||||||
if RecceUnit:IsActive() then
|
if RecceUnit:IsActive() then
|
||||||
local RecceUnitCoord = RecceUnit:GetCoordinate()
|
local RecceUnitCoord = RecceUnit:GetCoordinate()
|
||||||
local Distance = RecceUnitCoord:Get2DDistance( self:GetDetectedItemCoordinate( DetectedItem.Index ) )
|
local Distance = RecceUnitCoord:Get2DDistance( self:GetDetectedItemCoordinate( DetectedItem ) )
|
||||||
if Distance < DistanceRecce then
|
if Distance < DistanceRecce then
|
||||||
DistanceRecce = Distance
|
DistanceRecce = Distance
|
||||||
NearestRecce = RecceUnit
|
NearestRecce = RecceUnit
|
||||||
@ -1887,9 +1890,9 @@ do -- DETECTION_UNITS
|
|||||||
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||||
|
|
||||||
local DetectedObject = nil
|
local DetectedObject = nil
|
||||||
--self:E( DetectedUnit )
|
--self:F( DetectedUnit )
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
--self:E(DetectedUnit:GetName())
|
--self:F(DetectedUnit:GetName())
|
||||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||||
end
|
end
|
||||||
if DetectedObject then
|
if DetectedObject then
|
||||||
@ -1928,7 +1931,7 @@ do -- DETECTION_UNITS
|
|||||||
|
|
||||||
if DetectedUnit then
|
if DetectedUnit then
|
||||||
local DetectedTypeName = DetectedUnit:GetTypeName()
|
local DetectedTypeName = DetectedUnit:GetTypeName()
|
||||||
local DetectedItem = self:GetDetectedItem( DetectedUnitName )
|
local DetectedItem = self:GetDetectedItemByKey( DetectedUnitName )
|
||||||
if not DetectedItem then
|
if not DetectedItem then
|
||||||
self:T( "Added new DetectedItem" )
|
self:T( "Added new DetectedItem" )
|
||||||
DetectedItem = self:AddDetectedItem( "UNIT", DetectedUnitName )
|
DetectedItem = self:AddDetectedItem( "UNIT", DetectedUnitName )
|
||||||
@ -1960,54 +1963,24 @@ do -- DETECTION_UNITS
|
|||||||
self:SetDetectedItemCoordinate( DetectedItem, DetectedFirstUnitCoord, DetectedFirstUnit )
|
self:SetDetectedItemCoordinate( DetectedItem, DetectedFirstUnitCoord, DetectedFirstUnit )
|
||||||
|
|
||||||
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
||||||
|
self:SetDetectedItemThreatLevel( DetectedItem )
|
||||||
self:NearestRecce( DetectedItem )
|
self:NearestRecce( DetectedItem )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Menu of a DetectedItem using a given numeric index.
|
|
||||||
-- @param #DETECTION_UNITS self
|
|
||||||
-- @param Index
|
|
||||||
-- @return #string
|
|
||||||
function DETECTION_UNITS:DetectedItemMenu( Index, AttackGroup )
|
|
||||||
self:F( Index )
|
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
|
||||||
local DetectedSet = self:GetDetectedSet( Index )
|
|
||||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
|
||||||
|
|
||||||
self:T( DetectedSet )
|
|
||||||
if DetectedSet then
|
|
||||||
local ReportSummary = ""
|
|
||||||
local UnitDistanceText = ""
|
|
||||||
local UnitCategoryText = ""
|
|
||||||
|
|
||||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( Index )
|
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
|
||||||
|
|
||||||
ReportSummary = string.format(
|
|
||||||
"%s - %s",
|
|
||||||
DetectedItemID,
|
|
||||||
DetectedItemCoordText
|
|
||||||
)
|
|
||||||
self:T( ReportSummary )
|
|
||||||
|
|
||||||
return ReportSummary
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Report summary of a DetectedItem using a given numeric index.
|
--- Report summary of a DetectedItem using a given numeric index.
|
||||||
-- @param #DETECTION_UNITS self
|
-- @param #DETECTION_UNITS self
|
||||||
-- @param Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||||
-- @return Core.Report#REPORT The report of the detection items.
|
-- @return Core.Report#REPORT The report of the detection items.
|
||||||
function DETECTION_UNITS:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
function DETECTION_UNITS:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||||
self:F( { Index, self.DetectedItems } )
|
self:F( { DetectedItem = DetectedItem } )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
|
||||||
|
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
local ReportSummary = ""
|
local ReportSummary = ""
|
||||||
@ -2037,10 +2010,10 @@ do -- DETECTION_UNITS
|
|||||||
end
|
end
|
||||||
|
|
||||||
--TODO: solve Index reference
|
--TODO: solve Index reference
|
||||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( Index )
|
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedItem )
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||||
|
|
||||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( Index )
|
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
Report:Add(DetectedItemID .. ", " .. DetectedItemCoordText)
|
Report:Add(DetectedItemID .. ", " .. DetectedItemCoordText)
|
||||||
@ -2060,9 +2033,9 @@ do -- DETECTION_UNITS
|
|||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemID, AttackGroup )
|
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||||
Report:SetTitle( "Detected units:" )
|
Report:SetTitle( "Detected units:" )
|
||||||
Report:Add( ReportSummary:Text() )
|
Report:Add( ReportSummary:Text() )
|
||||||
end
|
end
|
||||||
@ -2165,7 +2138,7 @@ do -- DETECTION_TYPES
|
|||||||
|
|
||||||
local DetectedObject = nil
|
local DetectedObject = nil
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
--self:E(DetectedUnit:GetName())
|
--self:F(DetectedUnit:GetName())
|
||||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||||
end
|
end
|
||||||
if DetectedObject then
|
if DetectedObject then
|
||||||
@ -2192,10 +2165,10 @@ do -- DETECTION_TYPES
|
|||||||
|
|
||||||
if DetectedUnit then
|
if DetectedUnit then
|
||||||
local DetectedTypeName = DetectedUnit:GetTypeName()
|
local DetectedTypeName = DetectedUnit:GetTypeName()
|
||||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
local DetectedItem = self:GetDetectedItemByKey( DetectedTypeName )
|
||||||
if not DetectedItem then
|
if not DetectedItem then
|
||||||
DetectedItem = self:AddDetectedItem( "TYPE", DetectedTypeName )
|
DetectedItem = self:AddDetectedItem( "TYPE", DetectedTypeName )
|
||||||
DetectedItem.TypeName = DetectedUnit:GetTypeName()
|
DetectedItem.TypeName = DetectedTypeName
|
||||||
end
|
end
|
||||||
|
|
||||||
DetectedItem.Set:AddUnit( DetectedUnit )
|
DetectedItem.Set:AddUnit( DetectedUnit )
|
||||||
@ -2218,6 +2191,7 @@ do -- DETECTION_TYPES
|
|||||||
self:SetDetectedItemCoordinate( DetectedItem, DetectedUnitCoord, DetectedFirstUnit )
|
self:SetDetectedItemCoordinate( DetectedItem, DetectedUnitCoord, DetectedFirstUnit )
|
||||||
|
|
||||||
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
||||||
|
self:SetDetectedItemThreatLevel( DetectedItem )
|
||||||
self:NearestRecce( DetectedItem )
|
self:NearestRecce( DetectedItem )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2225,53 +2199,26 @@ do -- DETECTION_TYPES
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Menu of a DetectedItem using a given numeric index.
|
|
||||||
-- @param #DETECTION_TYPES self
|
|
||||||
-- @param Index
|
|
||||||
-- @return #string
|
|
||||||
function DETECTION_TYPES:DetectedItemMenu( DetectedTypeName, AttackGroup )
|
|
||||||
self:F( DetectedTypeName )
|
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
|
||||||
local DetectedItemID = self:GetDetectedItemID( DetectedTypeName )
|
|
||||||
|
|
||||||
if DetectedItem then
|
|
||||||
|
|
||||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedTypeName )
|
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
|
||||||
|
|
||||||
local ReportSummary = string.format(
|
|
||||||
"%s - %s",
|
|
||||||
DetectedItemID,
|
|
||||||
DetectedItemCoordText
|
|
||||||
)
|
|
||||||
self:T( ReportSummary )
|
|
||||||
|
|
||||||
return ReportSummary
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Report summary of a DetectedItem using a given numeric index.
|
--- Report summary of a DetectedItem using a given numeric index.
|
||||||
-- @param #DETECTION_TYPES self
|
-- @param #DETECTION_TYPES self
|
||||||
-- @param Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||||
-- @return Core.Report#REPORT The report of the detection items.
|
-- @return Core.Report#REPORT The report of the detection items.
|
||||||
function DETECTION_TYPES:DetectedItemReportSummary( DetectedTypeName, AttackGroup, Settings )
|
function DETECTION_TYPES:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||||
self:F( DetectedTypeName )
|
self:F( { DetectedItem = DetectedItem } )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||||
local DetectedSet = self:GetDetectedSet( DetectedTypeName )
|
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||||
local DetectedItemID = self:GetDetectedItemID( DetectedTypeName )
|
|
||||||
|
|
||||||
self:T( DetectedItem )
|
self:T( DetectedItem )
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
|
|
||||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedTypeName )
|
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
local DetectedItemsCount = DetectedSet:Count()
|
local DetectedItemsCount = DetectedSet:Count()
|
||||||
local DetectedItemType = DetectedItem.TypeName
|
local DetectedItemType = DetectedItem.TypeName
|
||||||
|
|
||||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedTypeName )
|
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedItem )
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
@ -2290,9 +2237,9 @@ do -- DETECTION_TYPES
|
|||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
for DetectedItemTypeName, DetectedItem in pairs( self.DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemTypeName, AttackGroup )
|
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||||
Report:SetTitle( "Detected types:" )
|
Report:SetTitle( "Detected types:" )
|
||||||
Report:Add( ReportSummary:Text() )
|
Report:Add( ReportSummary:Text() )
|
||||||
end
|
end
|
||||||
@ -2371,57 +2318,26 @@ do -- DETECTION_AREAS
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Menu of a detected item using a given numeric index.
|
|
||||||
-- @param #DETECTION_AREAS self
|
|
||||||
-- @param Index
|
|
||||||
-- @return #string
|
|
||||||
function DETECTION_AREAS:DetectedItemMenu( Index, AttackGroup )
|
|
||||||
self:F( Index )
|
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
|
||||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
|
||||||
|
|
||||||
if DetectedItem then
|
|
||||||
local DetectedSet = self:GetDetectedSet( Index )
|
|
||||||
local ReportSummaryItem
|
|
||||||
|
|
||||||
local DetectedZone = self:GetDetectedItemZone( Index )
|
|
||||||
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
|
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
|
||||||
|
|
||||||
local ReportSummary = string.format(
|
|
||||||
"%s - %s",
|
|
||||||
DetectedItemID,
|
|
||||||
DetectedItemCoordText
|
|
||||||
)
|
|
||||||
|
|
||||||
return ReportSummary
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Report summary of a detected item using a given numeric index.
|
--- Report summary of a detected item using a given numeric index.
|
||||||
-- @param #DETECTION_AREAS self
|
-- @param #DETECTION_AREAS self
|
||||||
-- @param Index
|
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||||
-- @param Wrapper.Group#GROUP AttackGroup The group to get the settings for.
|
-- @param Wrapper.Group#GROUP AttackGroup The group to get the settings for.
|
||||||
-- @param Core.Settings#SETTINGS Settings (Optional) Message formatting settings to use.
|
-- @param Core.Settings#SETTINGS Settings (Optional) Message formatting settings to use.
|
||||||
-- @return Core.Report#REPORT The report of the detection items.
|
-- @return Core.Report#REPORT The report of the detection items.
|
||||||
function DETECTION_AREAS:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
function DETECTION_AREAS:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||||
self:F( Index )
|
self:F( { DetectedItem = DetectedItem } )
|
||||||
|
|
||||||
local DetectedItem = self:GetDetectedItem( Index )
|
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
|
||||||
|
|
||||||
if DetectedItem then
|
if DetectedItem then
|
||||||
local DetectedSet = self:GetDetectedSet( Index )
|
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||||
local ReportSummaryItem
|
local ReportSummaryItem
|
||||||
|
|
||||||
local DetectedZone = self:GetDetectedItemZone( Index )
|
local DetectedZone = self:GetDetectedItemZone( DetectedItem )
|
||||||
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
|
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
|
||||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||||
|
|
||||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( Index )
|
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
local DetectedItemsCount = DetectedSet:Count()
|
local DetectedItemsCount = DetectedSet:Count()
|
||||||
local DetectedItemsTypes = DetectedSet:GetTypeNames()
|
local DetectedItemsTypes = DetectedSet:GetTypeNames()
|
||||||
|
|
||||||
@ -2446,7 +2362,7 @@ do -- DETECTION_AREAS
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemIndex, AttackGroup )
|
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||||
Report:SetTitle( "Detected areas:" )
|
Report:SetTitle( "Detected areas:" )
|
||||||
Report:Add( ReportSummary:Text() )
|
Report:Add( ReportSummary:Text() )
|
||||||
end
|
end
|
||||||
@ -2673,7 +2589,7 @@ do -- DETECTION_AREAS
|
|||||||
|
|
||||||
local DetectedObject = nil
|
local DetectedObject = nil
|
||||||
if DetectedUnit:IsAlive() then
|
if DetectedUnit:IsAlive() then
|
||||||
--self:E(DetectedUnit:GetName())
|
--self:F(DetectedUnit:GetName())
|
||||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||||
end
|
end
|
||||||
if DetectedObject then
|
if DetectedObject then
|
||||||
@ -2751,7 +2667,7 @@ do -- DETECTION_AREAS
|
|||||||
SET_UNIT:New():FilterDeads():FilterCrashes(),
|
SET_UNIT:New():FilterDeads():FilterCrashes(),
|
||||||
ZONE_UNIT:New( DetectedUnitName, DetectedUnit, self.DetectionZoneRange )
|
ZONE_UNIT:New( DetectedUnitName, DetectedUnit, self.DetectionZoneRange )
|
||||||
)
|
)
|
||||||
--self:E( DetectedItem.Zone.ZoneUNIT.UnitName )
|
--self:F( DetectedItem.Zone.ZoneUNIT.UnitName )
|
||||||
DetectedItem.Set:AddUnit( DetectedUnit )
|
DetectedItem.Set:AddUnit( DetectedUnit )
|
||||||
self:AddChangeItem( DetectedItem, "AA", DetectedUnitTypeName )
|
self:AddChangeItem( DetectedItem, "AA", DetectedUnitTypeName )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -846,11 +846,11 @@ function _Resume( EscortGroup )
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #ESCORT self
|
--- @param #ESCORT self
|
||||||
-- @param #number DetectedItemID
|
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||||
function ESCORT:_AttackTarget( DetectedItemID )
|
function ESCORT:_AttackTarget( DetectedItem )
|
||||||
|
|
||||||
local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP
|
local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP
|
||||||
self:E( EscortGroup )
|
self:F( EscortGroup )
|
||||||
|
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
|
|
||||||
@ -861,7 +861,7 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
|||||||
EscortGroup:OptionROTPassiveDefense()
|
EscortGroup:OptionROTPassiveDefense()
|
||||||
EscortGroup:SetState( EscortGroup, "Escort", self )
|
EscortGroup:SetState( EscortGroup, "Escort", self )
|
||||||
|
|
||||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
|
|
||||||
@ -884,7 +884,7 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
|
|
||||||
@ -910,8 +910,9 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
|||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @param #number DetectedItemID
|
--- @param #ESCORT self
|
||||||
function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||||
|
function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItem )
|
||||||
|
|
||||||
local EscortGroup = self.EscortGroup
|
local EscortGroup = self.EscortGroup
|
||||||
local EscortClient = self.EscortClient
|
local EscortClient = self.EscortClient
|
||||||
@ -922,7 +923,7 @@ function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
|||||||
EscortGroupAttack:OptionROEOpenFire()
|
EscortGroupAttack:OptionROEOpenFire()
|
||||||
EscortGroupAttack:OptionROTVertical()
|
EscortGroupAttack:OptionROTVertical()
|
||||||
|
|
||||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
|
|
||||||
@ -944,7 +945,7 @@ function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
|||||||
)
|
)
|
||||||
|
|
||||||
else
|
else
|
||||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||||
|
|
||||||
local Tasks = {}
|
local Tasks = {}
|
||||||
|
|
||||||
@ -1151,7 +1152,7 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local DetectedItems = self.Detection:GetDetectedItems()
|
local DetectedItems = self.Detection:GetDetectedItems()
|
||||||
self:E( DetectedItems )
|
self:F( DetectedItems )
|
||||||
|
|
||||||
local DetectedTargets = false
|
local DetectedTargets = false
|
||||||
|
|
||||||
@ -1162,11 +1163,11 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
local ClientEscortTargets = EscortGroupData.Detection
|
local ClientEscortTargets = EscortGroupData.Detection
|
||||||
--local EscortUnit = EscortGroupData:GetUnit( 1 )
|
--local EscortUnit = EscortGroupData:GetUnit( 1 )
|
||||||
|
|
||||||
for DetectedItemID, DetectedItem in pairs( DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||||
self:E( { DetectedItemID, DetectedItem } )
|
self:F( { DetectedItemIndex, DetectedItem } )
|
||||||
-- Remove the sub menus of the Attack menu of the Escort for the EscortGroup.
|
-- Remove the sub menus of the Attack menu of the Escort for the EscortGroup.
|
||||||
|
|
||||||
local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItemID, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItem, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
||||||
|
|
||||||
if ClientEscortGroupName == EscortGroupName then
|
if ClientEscortGroupName == EscortGroupName then
|
||||||
|
|
||||||
@ -1180,7 +1181,7 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
self.EscortMenuAttackNearbyTargets,
|
self.EscortMenuAttackNearbyTargets,
|
||||||
ESCORT._AttackTarget,
|
ESCORT._AttackTarget,
|
||||||
self,
|
self,
|
||||||
DetectedItemID
|
DetectedItem
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
if self.EscortMenuTargetAssistance then
|
if self.EscortMenuTargetAssistance then
|
||||||
@ -1195,7 +1196,7 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
ESCORT._AssistTarget,
|
ESCORT._AssistTarget,
|
||||||
self,
|
self,
|
||||||
EscortGroupData.EscortGroup,
|
EscortGroupData.EscortGroup,
|
||||||
DetectedItemID
|
DetectedItem
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1204,7 +1205,7 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:E( DetectedMsgs )
|
self:F( DetectedMsgs )
|
||||||
if DetectedTargets then
|
if DetectedTargets then
|
||||||
self.EscortGroup:MessageToClient( "Reporting detected targets:\n" .. table.concat( DetectedMsgs, "\n" ), 20, self.EscortClient )
|
self.EscortGroup:MessageToClient( "Reporting detected targets:\n" .. table.concat( DetectedMsgs, "\n" ), 20, self.EscortClient )
|
||||||
else
|
else
|
||||||
|
|||||||
@ -177,13 +177,13 @@ function MISSILETRAINER:New( Distance, Briefing )
|
|||||||
|
|
||||||
|
|
||||||
-- for ClientID, Client in pairs( self.DBClients.Database ) do
|
-- for ClientID, Client in pairs( self.DBClients.Database ) do
|
||||||
-- self:E( "ForEach:" .. Client.UnitName )
|
-- self:F( "ForEach:" .. Client.UnitName )
|
||||||
-- Client:Alive( self._Alive, self )
|
-- Client:Alive( self._Alive, self )
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
self.DBClients:ForEachClient(
|
self.DBClients:ForEachClient(
|
||||||
function( Client )
|
function( Client )
|
||||||
self:E( "ForEach:" .. Client.UnitName )
|
self:F( "ForEach:" .. Client.UnitName )
|
||||||
Client:Alive( self._Alive, self )
|
Client:Alive( self._Alive, self )
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|||||||
@ -78,14 +78,14 @@ end
|
|||||||
function PROTECT:IsGuarded()
|
function PROTECT:IsGuarded()
|
||||||
|
|
||||||
local IsGuarded = self.ProtectZone:IsAllInZoneOfCoalition( self.Coalition )
|
local IsGuarded = self.ProtectZone:IsAllInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsGuarded = IsGuarded } )
|
self:F( { IsGuarded = IsGuarded } )
|
||||||
return IsGuarded
|
return IsGuarded
|
||||||
end
|
end
|
||||||
|
|
||||||
function PROTECT:IsCaptured()
|
function PROTECT:IsCaptured()
|
||||||
|
|
||||||
local IsCaptured = self.ProtectZone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
local IsCaptured = self.ProtectZone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||||
self:E( { IsCaptured = IsCaptured } )
|
self:F( { IsCaptured = IsCaptured } )
|
||||||
return IsCaptured
|
return IsCaptured
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ end
|
|||||||
function PROTECT:IsAttacked()
|
function PROTECT:IsAttacked()
|
||||||
|
|
||||||
local IsAttacked = self.ProtectZone:IsSomeInZoneOfCoalition( self.Coalition )
|
local IsAttacked = self.ProtectZone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsAttacked = IsAttacked } )
|
self:F( { IsAttacked = IsAttacked } )
|
||||||
return IsAttacked
|
return IsAttacked
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ end
|
|||||||
function PROTECT:IsEmpty()
|
function PROTECT:IsEmpty()
|
||||||
|
|
||||||
local IsEmpty = self.ProtectZone:IsNoneInZone()
|
local IsEmpty = self.ProtectZone:IsNoneInZone()
|
||||||
self:E( { IsEmpty = IsEmpty } )
|
self:F( { IsEmpty = IsEmpty } )
|
||||||
return IsEmpty
|
return IsEmpty
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ function PROTECT:IsCaptureUnitInZone()
|
|||||||
|
|
||||||
local IsInZone = self.CaptureUnitSet:IsPartiallyInZone( self.ProtectZone )
|
local IsInZone = self.CaptureUnitSet:IsPartiallyInZone( self.ProtectZone )
|
||||||
|
|
||||||
self:E({IsInZone = IsInZone})
|
self:F({IsInZone = IsInZone})
|
||||||
|
|
||||||
return IsInZone
|
return IsInZone
|
||||||
end
|
end
|
||||||
@ -189,7 +189,7 @@ function PROTECT:Mark()
|
|||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
|
|
||||||
if self.MarkRed and self.MarkBlue then
|
if self.MarkRed and self.MarkBlue then
|
||||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||||
Coord:RemoveMark( self.MarkRed )
|
Coord:RemoveMark( self.MarkRed )
|
||||||
Coord:RemoveMark( self.MarkBlue )
|
Coord:RemoveMark( self.MarkBlue )
|
||||||
end
|
end
|
||||||
@ -231,7 +231,7 @@ end
|
|||||||
function PROTECT:onenterCaptured()
|
function PROTECT:onenterCaptured()
|
||||||
|
|
||||||
local NewCoalition = self.ProtectZone:GetCoalition()
|
local NewCoalition = self.ProtectZone:GetCoalition()
|
||||||
self:E( { NewCoalition = NewCoalition } )
|
self:F( { NewCoalition = NewCoalition } )
|
||||||
self:SetCoalition( NewCoalition )
|
self:SetCoalition( NewCoalition )
|
||||||
|
|
||||||
self:Mark()
|
self:Mark()
|
||||||
@ -254,7 +254,7 @@ end
|
|||||||
-- @param #PROTECT self
|
-- @param #PROTECT self
|
||||||
function PROTECT:StatusCoalition()
|
function PROTECT:StatusCoalition()
|
||||||
|
|
||||||
self:E( { State = self:GetState() } )
|
self:F( { State = self:GetState() } )
|
||||||
|
|
||||||
self.ProtectZone:Scan()
|
self.ProtectZone:Scan()
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ end
|
|||||||
-- @param #PROTECT self
|
-- @param #PROTECT self
|
||||||
function PROTECT:StatusZone()
|
function PROTECT:StatusZone()
|
||||||
|
|
||||||
self:E( { State = self:GetState() } )
|
self:F( { State = self:GetState() } )
|
||||||
|
|
||||||
self.ProtectZone:Scan()
|
self.ProtectZone:Scan()
|
||||||
|
|
||||||
|
|||||||
@ -689,7 +689,7 @@ end
|
|||||||
-- @param #number Score The score can be both positive or negative ( Penalty ).
|
-- @param #number Score The score can be both positive or negative ( Penalty ).
|
||||||
function SCORING:AddGoalScorePlayer( PlayerName, GoalTag, Text, Score )
|
function SCORING:AddGoalScorePlayer( PlayerName, GoalTag, Text, Score )
|
||||||
|
|
||||||
self:E( { PlayerName, PlayerName, GoalTag, Text, Score } )
|
self:F( { PlayerName, PlayerName, GoalTag, Text, Score } )
|
||||||
|
|
||||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
@ -721,7 +721,7 @@ function SCORING:AddGoalScore( PlayerUnit, GoalTag, Text, Score )
|
|||||||
|
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
|
|
||||||
self:E( { PlayerUnit.UnitName, PlayerName, GoalTag, Text, Score } )
|
self:F( { PlayerUnit.UnitName, PlayerName, GoalTag, Text, Score } )
|
||||||
|
|
||||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
@ -749,7 +749,7 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
|||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
local MissionName = Mission:GetName()
|
local MissionName = Mission:GetName()
|
||||||
|
|
||||||
self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
||||||
|
|
||||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
@ -767,7 +767,7 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
|||||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||||
|
|
||||||
MESSAGE:NewType( self.DisplayMessagePrefix .. MissionName .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( self.DisplayMessagePrefix .. Mission:GetText() .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll()
|
||||||
|
|
||||||
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
|
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
|
||||||
end
|
end
|
||||||
@ -783,7 +783,7 @@ function SCORING:_AddMissionGoalScore( Mission, PlayerName, Text, Score )
|
|||||||
|
|
||||||
local MissionName = Mission:GetName()
|
local MissionName = Mission:GetName()
|
||||||
|
|
||||||
self:E( { Mission:GetName(), PlayerName, Text, Score } )
|
self:F( { Mission:GetName(), PlayerName, Text, Score } )
|
||||||
|
|
||||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||||
if PlayerName then
|
if PlayerName then
|
||||||
@ -801,7 +801,7 @@ function SCORING:_AddMissionGoalScore( Mission, PlayerName, Text, Score )
|
|||||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||||
|
|
||||||
MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, MissionName, Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, Mission:GetText(), Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll()
|
||||||
|
|
||||||
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score )
|
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score )
|
||||||
end
|
end
|
||||||
@ -817,18 +817,18 @@ function SCORING:_AddMissionScore( Mission, Text, Score )
|
|||||||
|
|
||||||
local MissionName = Mission:GetName()
|
local MissionName = Mission:GetName()
|
||||||
|
|
||||||
self:E( { Mission, Text, Score } )
|
self:F( { Mission, Text, Score } )
|
||||||
self:E( self.Players )
|
self:F( self.Players )
|
||||||
|
|
||||||
for PlayerName, PlayerData in pairs( self.Players ) do
|
for PlayerName, PlayerData in pairs( self.Players ) do
|
||||||
|
|
||||||
self:E( PlayerData )
|
self:F( PlayerData )
|
||||||
if PlayerData.Mission[MissionName] then
|
if PlayerData.Mission[MissionName] then
|
||||||
|
|
||||||
PlayerData.Score = PlayerData.Score + Score
|
PlayerData.Score = PlayerData.Score + Score
|
||||||
PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score
|
PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score
|
||||||
|
|
||||||
MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
|
MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in " .. Mission:GetText() .. ". " ..
|
||||||
Score .. " mission score!",
|
Score .. " mission score!",
|
||||||
MESSAGE.Type.Information ):ToAll()
|
MESSAGE.Type.Information ):ToAll()
|
||||||
|
|
||||||
@ -1232,7 +1232,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
local ThreatTypeTarget = TargetThreatType
|
local ThreatTypeTarget = TargetThreatType
|
||||||
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||||
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
|
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
|
||||||
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
self:F( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||||
|
|
||||||
Player.Penalty = Player.Penalty + ThreatPenalty
|
Player.Penalty = Player.Penalty + ThreatPenalty
|
||||||
TargetDestroy.Penalty = TargetDestroy.Penalty + ThreatPenalty
|
TargetDestroy.Penalty = TargetDestroy.Penalty + ThreatPenalty
|
||||||
@ -1267,7 +1267,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||||
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
|
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
|
||||||
|
|
||||||
self:E( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
self:F( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||||
|
|
||||||
Player.Score = Player.Score + ThreatScore
|
Player.Score = Player.Score + ThreatScore
|
||||||
TargetDestroy.Score = TargetDestroy.Score + ThreatScore
|
TargetDestroy.Score = TargetDestroy.Score + ThreatScore
|
||||||
@ -1312,7 +1312,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
|
|
||||||
-- Check if there are Zones where the destruction happened.
|
-- Check if there are Zones where the destruction happened.
|
||||||
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
||||||
self:E( { ScoringZone = ScoreZoneData } )
|
self:F( { ScoringZone = ScoreZoneData } )
|
||||||
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
||||||
local Score = ScoreZoneData.Score
|
local Score = ScoreZoneData.Score
|
||||||
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
||||||
@ -1334,7 +1334,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
|||||||
else
|
else
|
||||||
-- Check if there are Zones where the destruction happened.
|
-- Check if there are Zones where the destruction happened.
|
||||||
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
||||||
self:E( { ScoringZone = ScoreZoneData } )
|
self:F( { ScoringZone = ScoreZoneData } )
|
||||||
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
||||||
local Score = ScoreZoneData.Score
|
local Score = ScoreZoneData.Score
|
||||||
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
||||||
@ -1449,7 +1449,7 @@ function SCORING:ReportDetailedPlayerDestroys( PlayerName )
|
|||||||
local PenaltyDestroy = 0
|
local PenaltyDestroy = 0
|
||||||
|
|
||||||
for UnitName, UnitData in pairs( PlayerData.Destroy[CategoryID] ) do
|
for UnitName, UnitData in pairs( PlayerData.Destroy[CategoryID] ) do
|
||||||
self:E( { UnitData = UnitData } )
|
self:F( { UnitData = UnitData } )
|
||||||
if UnitData ~= {} then
|
if UnitData ~= {} then
|
||||||
Score = Score + UnitData.Score
|
Score = Score + UnitData.Score
|
||||||
ScoreDestroy = ScoreDestroy + UnitData.ScoreDestroy
|
ScoreDestroy = ScoreDestroy + UnitData.ScoreDestroy
|
||||||
@ -1603,23 +1603,23 @@ function SCORING:ReportScoreGroupSummary( PlayerGroup )
|
|||||||
|
|
||||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||||
|
|
||||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||||
|
|
||||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||||
|
|
||||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||||
|
|
||||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||||
|
|
||||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||||
@ -1655,23 +1655,23 @@ function SCORING:ReportScoreGroupDetailed( PlayerGroup )
|
|||||||
|
|
||||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||||
|
|
||||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||||
|
|
||||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||||
|
|
||||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||||
|
|
||||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||||
|
|
||||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||||
@ -1711,23 +1711,23 @@ function SCORING:ReportScoreAllSummary( PlayerGroup )
|
|||||||
|
|
||||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||||
|
|
||||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||||
|
|
||||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||||
|
|
||||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||||
|
|
||||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||||
|
|
||||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||||
@ -1787,7 +1787,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
|||||||
error( "A string containing the CSV file name must be given." )
|
error( "A string containing the CSV file name must be given." )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
self:F( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
@ -285,7 +285,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsGuarded()
|
function ZONE_CAPTURE_COALITION:IsGuarded()
|
||||||
|
|
||||||
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsGuarded = IsGuarded } )
|
self:F( { IsGuarded = IsGuarded } )
|
||||||
return IsGuarded
|
return IsGuarded
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsEmpty()
|
function ZONE_CAPTURE_COALITION:IsEmpty()
|
||||||
|
|
||||||
local IsEmpty = self.Zone:IsNoneInZone()
|
local IsEmpty = self.Zone:IsNoneInZone()
|
||||||
self:E( { IsEmpty = IsEmpty } )
|
self:F( { IsEmpty = IsEmpty } )
|
||||||
return IsEmpty
|
return IsEmpty
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsCaptured()
|
function ZONE_CAPTURE_COALITION:IsCaptured()
|
||||||
|
|
||||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||||
self:E( { IsCaptured = IsCaptured } )
|
self:F( { IsCaptured = IsCaptured } )
|
||||||
return IsCaptured
|
return IsCaptured
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsAttacked()
|
function ZONE_CAPTURE_COALITION:IsAttacked()
|
||||||
|
|
||||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsAttacked = IsAttacked } )
|
self:F( { IsAttacked = IsAttacked } )
|
||||||
return IsAttacked
|
return IsAttacked
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
|
|
||||||
if self.MarkRed and self.MarkBlue then
|
if self.MarkRed and self.MarkBlue then
|
||||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||||
Coord:RemoveMark( self.MarkRed )
|
Coord:RemoveMark( self.MarkRed )
|
||||||
Coord:RemoveMark( self.MarkBlue )
|
Coord:RemoveMark( self.MarkBlue )
|
||||||
end
|
end
|
||||||
@ -359,7 +359,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
--self:GetParent( self ):onenterCaptured()
|
--self:GetParent( self ):onenterCaptured()
|
||||||
|
|
||||||
local NewCoalition = self.Zone:GetScannedCoalition()
|
local NewCoalition = self.Zone:GetScannedCoalition()
|
||||||
self:E( { NewCoalition = NewCoalition } )
|
self:F( { NewCoalition = NewCoalition } )
|
||||||
self:SetCoalition( NewCoalition )
|
self:SetCoalition( NewCoalition )
|
||||||
|
|
||||||
self:Mark()
|
self:Mark()
|
||||||
@ -386,7 +386,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
-- @param #ZONE_CAPTURE_COALITION self
|
-- @param #ZONE_CAPTURE_COALITION self
|
||||||
function ZONE_CAPTURE_COALITION:onafterGuard()
|
function ZONE_CAPTURE_COALITION:onafterGuard()
|
||||||
|
|
||||||
--self:E({BASE:GetParent( self )})
|
--self:F({BASE:GetParent( self )})
|
||||||
--BASE:GetParent( self ).onafterGuard( self )
|
--BASE:GetParent( self ).onafterGuard( self )
|
||||||
|
|
||||||
if not self.SmokeScheduler then
|
if not self.SmokeScheduler then
|
||||||
@ -398,7 +398,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsCaptured()
|
function ZONE_CAPTURE_COALITION:IsCaptured()
|
||||||
|
|
||||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||||
self:E( { IsCaptured = IsCaptured } )
|
self:F( { IsCaptured = IsCaptured } )
|
||||||
return IsCaptured
|
return IsCaptured
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:IsAttacked()
|
function ZONE_CAPTURE_COALITION:IsAttacked()
|
||||||
|
|
||||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsAttacked = IsAttacked } )
|
self:F( { IsAttacked = IsAttacked } )
|
||||||
return IsAttacked
|
return IsAttacked
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ do -- ZONE_CAPTURE_COALITION
|
|||||||
function ZONE_CAPTURE_COALITION:StatusZone()
|
function ZONE_CAPTURE_COALITION:StatusZone()
|
||||||
|
|
||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
self:E( { State = self:GetState() } )
|
self:F( { State = self:GetState() } )
|
||||||
|
|
||||||
self:GetParent( self, ZONE_CAPTURE_COALITION ).StatusZone( self )
|
self:GetParent( self, ZONE_CAPTURE_COALITION ).StatusZone( self )
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ do -- Zone
|
|||||||
|
|
||||||
--self:GetParent( self ):onafterStart()
|
--self:GetParent( self ):onafterStart()
|
||||||
|
|
||||||
self:E("Guard")
|
self:F("Guard")
|
||||||
|
|
||||||
--self:ScheduleRepeat( 15, 15, 0.1, nil, self.StatusZone, self )
|
--self:ScheduleRepeat( 15, 15, 0.1, nil, self.StatusZone, self )
|
||||||
if not self.SmokeScheduler then
|
if not self.SmokeScheduler then
|
||||||
@ -142,14 +142,14 @@ do -- Zone
|
|||||||
--- @param #ZONE_GOAL self
|
--- @param #ZONE_GOAL self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function ZONE_GOAL:__Destroyed( EventData )
|
function ZONE_GOAL:__Destroyed( EventData )
|
||||||
self:E( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
self:E( { EventData.IniUnit } )
|
self:F( { EventData.IniUnit } )
|
||||||
|
|
||||||
local Vec3 = EventData.IniDCSUnit:getPosition().p
|
local Vec3 = EventData.IniDCSUnit:getPosition().p
|
||||||
self:E( { Vec3 = Vec3 } )
|
self:F( { Vec3 = Vec3 } )
|
||||||
local ZoneGoal = self:GetZone()
|
local ZoneGoal = self:GetZone()
|
||||||
self:E({ZoneGoal})
|
self:F({ZoneGoal})
|
||||||
|
|
||||||
if EventData.IniDCSUnit then
|
if EventData.IniDCSUnit then
|
||||||
if ZoneGoal:IsVec3InZone(Vec3) then
|
if ZoneGoal:IsVec3InZone(Vec3) then
|
||||||
|
|||||||
@ -293,7 +293,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsGuarded()
|
function ZONE_GOAL_CARGO:IsGuarded()
|
||||||
|
|
||||||
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsGuarded = IsGuarded } )
|
self:F( { IsGuarded = IsGuarded } )
|
||||||
return IsGuarded
|
return IsGuarded
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsEmpty()
|
function ZONE_GOAL_CARGO:IsEmpty()
|
||||||
|
|
||||||
local IsEmpty = self.Zone:IsNoneInZone()
|
local IsEmpty = self.Zone:IsNoneInZone()
|
||||||
self:E( { IsEmpty = IsEmpty } )
|
self:F( { IsEmpty = IsEmpty } )
|
||||||
return IsEmpty
|
return IsEmpty
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsCaptured()
|
function ZONE_GOAL_CARGO:IsCaptured()
|
||||||
|
|
||||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||||
self:E( { IsCaptured = IsCaptured } )
|
self:F( { IsCaptured = IsCaptured } )
|
||||||
return IsCaptured
|
return IsCaptured
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsAttacked()
|
function ZONE_GOAL_CARGO:IsAttacked()
|
||||||
|
|
||||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsAttacked = IsAttacked } )
|
self:F( { IsAttacked = IsAttacked } )
|
||||||
return IsAttacked
|
return IsAttacked
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ do -- ZoneGoal
|
|||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
|
|
||||||
if self.MarkRed and self.MarkBlue then
|
if self.MarkRed and self.MarkBlue then
|
||||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||||
Coord:RemoveMark( self.MarkRed )
|
Coord:RemoveMark( self.MarkRed )
|
||||||
Coord:RemoveMark( self.MarkBlue )
|
Coord:RemoveMark( self.MarkBlue )
|
||||||
end
|
end
|
||||||
@ -367,7 +367,7 @@ do -- ZoneGoal
|
|||||||
--self:GetParent( self ):onenterCaptured()
|
--self:GetParent( self ):onenterCaptured()
|
||||||
|
|
||||||
local NewCoalition = self.Zone:GetCoalition()
|
local NewCoalition = self.Zone:GetCoalition()
|
||||||
self:E( { NewCoalition = NewCoalition } )
|
self:F( { NewCoalition = NewCoalition } )
|
||||||
self:SetCoalition( NewCoalition )
|
self:SetCoalition( NewCoalition )
|
||||||
|
|
||||||
self:Mark()
|
self:Mark()
|
||||||
@ -394,7 +394,7 @@ do -- ZoneGoal
|
|||||||
-- @param #ZONE_GOAL_CARGO self
|
-- @param #ZONE_GOAL_CARGO self
|
||||||
function ZONE_GOAL_CARGO:onafterGuard()
|
function ZONE_GOAL_CARGO:onafterGuard()
|
||||||
|
|
||||||
--self:E({BASE:GetParent( self )})
|
--self:F({BASE:GetParent( self )})
|
||||||
--BASE:GetParent( self ).onafterGuard( self )
|
--BASE:GetParent( self ).onafterGuard( self )
|
||||||
|
|
||||||
if not self.SmokeScheduler then
|
if not self.SmokeScheduler then
|
||||||
@ -409,7 +409,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsCaptured()
|
function ZONE_GOAL_CARGO:IsCaptured()
|
||||||
|
|
||||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||||
self:E( { IsCaptured = IsCaptured } )
|
self:F( { IsCaptured = IsCaptured } )
|
||||||
return IsCaptured
|
return IsCaptured
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -417,7 +417,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:IsAttacked()
|
function ZONE_GOAL_CARGO:IsAttacked()
|
||||||
|
|
||||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
self:E( { IsAttacked = IsAttacked } )
|
self:F( { IsAttacked = IsAttacked } )
|
||||||
return IsAttacked
|
return IsAttacked
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -426,7 +426,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_CARGO:StatusZone()
|
function ZONE_GOAL_CARGO:StatusZone()
|
||||||
|
|
||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
self:E( { State = self:GetState() } )
|
self:F( { State = self:GetState() } )
|
||||||
|
|
||||||
self.Zone:Scan()
|
self.Zone:Scan()
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ do -- ZoneGoal
|
|||||||
function ZONE_GOAL_COALITION:StatusZone()
|
function ZONE_GOAL_COALITION:StatusZone()
|
||||||
|
|
||||||
local State = self:GetState()
|
local State = self:GetState()
|
||||||
self:E( { State = self:GetState() } )
|
self:F( { State = self:GetState() } )
|
||||||
|
|
||||||
self.Zone:Scan( { Object.Category.UNIT, Object.Category.STATIC } )
|
self.Zone:Scan( { Object.Category.UNIT, Object.Category.STATIC } )
|
||||||
|
|
||||||
|
|||||||
@ -101,7 +101,6 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
if EventData.IniObjectCategory == 1 then
|
if EventData.IniObjectCategory == 1 then
|
||||||
local EventGroup = GROUP:Find( EventData.IniDCSGroup )
|
local EventGroup = GROUP:Find( EventData.IniDCSGroup )
|
||||||
self:E( { CommandCenter = self:GetName(), EventGroup = EventGroup, HasGroup = self:HasGroup( EventGroup ), EventData = EventData } )
|
self:E( { CommandCenter = self:GetName(), EventGroup = EventGroup, HasGroup = self:HasGroup( EventGroup ), EventData = EventData } )
|
||||||
self:E( { GROUPS = _DATABASE.GROUPS } )
|
|
||||||
if EventGroup and self:HasGroup( EventGroup ) then
|
if EventGroup and self:HasGroup( EventGroup ) then
|
||||||
local CommandCenterMenu = MENU_GROUP:New( EventGroup, "Command Center (" .. self:GetName() .. ")" )
|
local CommandCenterMenu = MENU_GROUP:New( EventGroup, "Command Center (" .. self:GetName() .. ")" )
|
||||||
local MenuReporting = MENU_GROUP:New( EventGroup, "Missions Reports", CommandCenterMenu )
|
local MenuReporting = MENU_GROUP:New( EventGroup, "Missions Reports", CommandCenterMenu )
|
||||||
@ -204,6 +203,24 @@ function COMMANDCENTER:GetName()
|
|||||||
return self.CommandCenterName
|
return self.CommandCenterName
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Gets the text string of the HQ command center.
|
||||||
|
-- @param #COMMANDCENTER self
|
||||||
|
-- @return #string
|
||||||
|
function COMMANDCENTER:GetText()
|
||||||
|
|
||||||
|
return "Command Center [" .. self.CommandCenterName .. "]"
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Gets the short text string of the HQ command center.
|
||||||
|
-- @param #COMMANDCENTER self
|
||||||
|
-- @return #string
|
||||||
|
function COMMANDCENTER:GetShortText()
|
||||||
|
|
||||||
|
return "CC [" .. self.CommandCenterName .. "]"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Gets the POSITIONABLE of the HQ command center.
|
--- Gets the POSITIONABLE of the HQ command center.
|
||||||
-- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
-- @return Wrapper.Positionable#POSITIONABLE
|
-- @return Wrapper.Positionable#POSITIONABLE
|
||||||
@ -360,7 +377,7 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
function COMMANDCENTER:MessageToGroup( Message, TaskGroup )
|
function COMMANDCENTER:MessageToGroup( Message, TaskGroup )
|
||||||
|
|
||||||
self:GetPositionable():MessageToGroup( Message, 15, TaskGroup, self:GetName() )
|
self:GetPositionable():MessageToGroup( Message, 15, TaskGroup, self:GetShortText() )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -371,7 +388,7 @@ end
|
|||||||
-- @param Core.Message#MESSAGE.MessageType MessageType The type of the message, resulting in automatic time duration and prefix of the message.
|
-- @param Core.Message#MESSAGE.MessageType MessageType The type of the message, resulting in automatic time duration and prefix of the message.
|
||||||
function COMMANDCENTER:MessageTypeToGroup( Message, TaskGroup, MessageType )
|
function COMMANDCENTER:MessageTypeToGroup( Message, TaskGroup, MessageType )
|
||||||
|
|
||||||
self:GetPositionable():MessageTypeToGroup( Message, MessageType, TaskGroup, self:GetName() )
|
self:GetPositionable():MessageTypeToGroup( Message, MessageType, TaskGroup, self:GetShortText() )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -405,7 +422,7 @@ end
|
|||||||
-- Each Mission is listed, with an indication how many Tasks are still to be completed.
|
-- Each Mission is listed, with an indication how many Tasks are still to be completed.
|
||||||
-- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
function COMMANDCENTER:ReportSummary( ReportGroup )
|
function COMMANDCENTER:ReportSummary( ReportGroup )
|
||||||
self:E( ReportGroup )
|
self:F( ReportGroup )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
@ -425,7 +442,7 @@ end
|
|||||||
-- Each Mission is listed, with an indication how many Tasks are still to be completed.
|
-- Each Mission is listed, with an indication how many Tasks are still to be completed.
|
||||||
-- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
function COMMANDCENTER:ReportMissionsPlayers( ReportGroup )
|
function COMMANDCENTER:ReportMissionsPlayers( ReportGroup )
|
||||||
self:E( ReportGroup )
|
self:F( ReportGroup )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
@ -443,7 +460,7 @@ end
|
|||||||
-- Report the details of a Mission, listing the Mission, and all the Task details.
|
-- Report the details of a Mission, listing the Mission, and all the Task details.
|
||||||
-- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
function COMMANDCENTER:ReportDetails( ReportGroup, Task )
|
function COMMANDCENTER:ReportDetails( ReportGroup, Task )
|
||||||
self:E( ReportGroup )
|
self:F( ReportGroup )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,6 @@ do -- DETECTION MANAGER
|
|||||||
self:SetRefreshTimeInterval( 30 )
|
self:SetRefreshTimeInterval( 30 )
|
||||||
self:SetReportDisplayTime( 25 )
|
self:SetReportDisplayTime( 25 )
|
||||||
|
|
||||||
self:E( { Detection = Detection } )
|
|
||||||
Detection:__Start( 3 )
|
Detection:__Start( 3 )
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -141,8 +140,6 @@ do -- DETECTION MANAGER
|
|||||||
|
|
||||||
function DETECTION_MANAGER:onafterReport( From, Event, To )
|
function DETECTION_MANAGER:onafterReport( From, Event, To )
|
||||||
|
|
||||||
self:E( "onafterReport" )
|
|
||||||
|
|
||||||
self:__Report( -self._RefreshTimeInterval )
|
self:__Report( -self._RefreshTimeInterval )
|
||||||
|
|
||||||
self:ProcessDetected( self.Detection )
|
self:ProcessDetected( self.Detection )
|
||||||
@ -256,7 +253,6 @@ do -- DETECTION_REPORTING
|
|||||||
function DETECTION_REPORTING:ProcessDetected( Group, Detection )
|
function DETECTION_REPORTING:ProcessDetected( Group, Detection )
|
||||||
self:F2( Group )
|
self:F2( Group )
|
||||||
|
|
||||||
self:E( Group )
|
|
||||||
local DetectedMsg = {}
|
local DetectedMsg = {}
|
||||||
for DetectedAreaID, DetectedAreaData in pairs( Detection:GetDetectedAreas() ) do
|
for DetectedAreaID, DetectedAreaData in pairs( Detection:GetDetectedAreas() ) do
|
||||||
local DetectedArea = DetectedAreaData -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
local DetectedArea = DetectedAreaData -- Functional.Detection#DETECTION_AREAS.DetectedArea
|
||||||
|
|||||||
@ -271,16 +271,33 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function MISSION:onenterCOMPLETED( From, Event, To )
|
function MISSION:onenterCOMPLETED( From, Event, To )
|
||||||
|
|
||||||
self:GetCommandCenter():MessageTypeToCoalition( self:GetName() .. " has been completed! Good job guys!", MESSAGE.Type.Information )
|
self:GetCommandCenter():MessageTypeToCoalition( self:GetText() .. " has been completed! Good job guys!", MESSAGE.Type.Information )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets the mission name.
|
--- Gets the mission name.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
-- @return #MISSION self
|
-- @return #MISSION self
|
||||||
function MISSION:GetName()
|
function MISSION:GetName()
|
||||||
|
return self.Name
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Gets the mission text.
|
||||||
|
-- @param #MISSION self
|
||||||
|
-- @return #MISSION self
|
||||||
|
function MISSION:GetText()
|
||||||
return string.format( 'Mission "%s (%s)"', self.Name, self.MissionPriority )
|
return string.format( 'Mission "%s (%s)"', self.Name, self.MissionPriority )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Gets the short mission text.
|
||||||
|
-- @param #MISSION self
|
||||||
|
-- @return #MISSION self
|
||||||
|
function MISSION:GetShortText()
|
||||||
|
return string.format( 'Mission "%s"', self.Name )
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Add a Unit to join the Mission.
|
--- Add a Unit to join the Mission.
|
||||||
-- For each Task within the Mission, the Unit is joined with the Task.
|
-- For each Task within the Mission, the Unit is joined with the Task.
|
||||||
-- If the Unit was not part of a Task in the Mission, false is returned.
|
-- If the Unit was not part of a Task in the Mission, false is returned.
|
||||||
@ -490,10 +507,10 @@ function MISSION:GetRootMenu( TaskGroup ) -- R2.2
|
|||||||
local CommandCenter = self:GetCommandCenter()
|
local CommandCenter = self:GetCommandCenter()
|
||||||
local CommandCenterMenu = CommandCenter:GetMenu()
|
local CommandCenterMenu = CommandCenter:GetMenu()
|
||||||
|
|
||||||
local MissionName = self:GetName()
|
local MissionName = self:GetText()
|
||||||
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
||||||
|
|
||||||
self.MissionMenu = MENU_COALITION:New( self.MissionCoalition, self:GetName(), CommandCenterMenu )
|
self.MissionMenu = MENU_COALITION:New( self.MissionCoalition, MissionName, CommandCenterMenu )
|
||||||
|
|
||||||
return self.MissionMenu
|
return self.MissionMenu
|
||||||
end
|
end
|
||||||
@ -506,7 +523,6 @@ function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure
|
|||||||
local CommandCenter = self:GetCommandCenter()
|
local CommandCenter = self:GetCommandCenter()
|
||||||
local CommandCenterMenu = CommandCenter:GetMenu()
|
local CommandCenterMenu = CommandCenter:GetMenu()
|
||||||
|
|
||||||
local MissionName = self:GetName()
|
|
||||||
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
||||||
|
|
||||||
self.MissionGroupMenu = self.MissionGroupMenu or {}
|
self.MissionGroupMenu = self.MissionGroupMenu or {}
|
||||||
@ -514,9 +530,11 @@ function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure
|
|||||||
|
|
||||||
local GroupMenu = self.MissionGroupMenu[TaskGroup]
|
local GroupMenu = self.MissionGroupMenu[TaskGroup]
|
||||||
|
|
||||||
CommandCenterMenu = MENU_GROUP:New( TaskGroup, "Command Center (" .. CommandCenter:GetName() .. ")" )
|
local CommandCenterText = CommandCenter:GetText()
|
||||||
|
CommandCenterMenu = MENU_GROUP:New( TaskGroup, CommandCenterText )
|
||||||
|
|
||||||
self.MissionMenu = MENU_GROUP:New( TaskGroup, self:GetName(), CommandCenterMenu )
|
local MissionText = self:GetText()
|
||||||
|
self.MissionMenu = MENU_GROUP:New( TaskGroup, MissionText, CommandCenterMenu )
|
||||||
|
|
||||||
GroupMenu.BriefingMenu = MENU_GROUP_COMMAND:New( TaskGroup, "Mission Briefing", self.MissionMenu, self.MenuReportBriefing, self, TaskGroup )
|
GroupMenu.BriefingMenu = MENU_GROUP_COMMAND:New( TaskGroup, "Mission Briefing", self.MissionMenu, self.MenuReportBriefing, self, TaskGroup )
|
||||||
|
|
||||||
@ -711,7 +729,7 @@ function MISSION:ReportBriefing()
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -744,7 +762,7 @@ function MISSION:ReportSummary()
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -792,7 +810,7 @@ function MISSION:ReportPlayersPerTask( ReportGroup )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -833,7 +851,7 @@ function MISSION:ReportPlayersProgress( ReportGroup )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -878,7 +896,7 @@ function MISSION:MarkTargetLocations( ReportGroup )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -904,7 +922,7 @@ function MISSION:ReportSummary( ReportGroup )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -930,7 +948,7 @@ function MISSION:ReportOverview( ReportGroup, TaskStatus )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
@ -962,7 +980,7 @@ function MISSION:ReportDetails( ReportGroup )
|
|||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the mission.
|
-- List the name of the mission.
|
||||||
local Name = self:GetName()
|
local Name = self:GetText()
|
||||||
|
|
||||||
-- Determine the status of the mission.
|
-- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
local Status = "<" .. self:GetState() .. ">"
|
||||||
|
|||||||
@ -213,7 +213,7 @@ function TASK:New( Mission, SetGroupAssign, TaskName, TaskType, TaskBriefing )
|
|||||||
self:AddTransition( { "Failed", "Aborted", "Cancelled" }, "Replan", "Planned" )
|
self:AddTransition( { "Failed", "Aborted", "Cancelled" }, "Replan", "Planned" )
|
||||||
self:AddTransition( "*", "TimeOut", "Cancelled" )
|
self:AddTransition( "*", "TimeOut", "Cancelled" )
|
||||||
|
|
||||||
self:E( "New TASK " .. TaskName )
|
self:F( "New TASK " .. TaskName )
|
||||||
|
|
||||||
self.Processes = {}
|
self.Processes = {}
|
||||||
self.Fsm = {}
|
self.Fsm = {}
|
||||||
@ -284,7 +284,7 @@ function TASK:JoinUnit( PlayerUnit, PlayerGroup )
|
|||||||
end
|
end
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
self:F( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsGroupAssigned then
|
if IsGroupAssigned then
|
||||||
self:AssignToUnit( PlayerUnit )
|
self:AssignToUnit( PlayerUnit )
|
||||||
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " joined Task " .. self:GetName() )
|
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " joined Task " .. self:GetName() )
|
||||||
@ -313,7 +313,7 @@ function TASK:AbortGroup( PlayerGroup )
|
|||||||
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
self:F( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsGroupAssigned then
|
if IsGroupAssigned then
|
||||||
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
||||||
--self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
--self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
||||||
@ -365,7 +365,7 @@ function TASK:CrashGroup( PlayerGroup )
|
|||||||
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
self:F( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsGroupAssigned then
|
if IsGroupAssigned then
|
||||||
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
||||||
self:MessageToGroups( PlayerName .. " crashed! " )
|
self:MessageToGroups( PlayerName .. " crashed! " )
|
||||||
@ -446,7 +446,7 @@ do -- Group Assignment
|
|||||||
local TaskGroupName = TaskGroup:GetName()
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
self.AssignedGroups[TaskGroupName] = TaskGroup
|
self.AssignedGroups[TaskGroupName] = TaskGroup
|
||||||
self:E( string.format( "Task %s is assigned to %s", TaskName, TaskGroupName ) )
|
self:F( string.format( "Task %s is assigned to %s", TaskName, TaskGroupName ) )
|
||||||
|
|
||||||
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
||||||
self:GetMission():SetGroupAssigned( TaskGroup )
|
self:GetMission():SetGroupAssigned( TaskGroup )
|
||||||
@ -476,7 +476,7 @@ do -- Group Assignment
|
|||||||
local TaskGroupName = TaskGroup:GetName()
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
self.AssignedGroups[TaskGroupName] = nil
|
self.AssignedGroups[TaskGroupName] = nil
|
||||||
--self:E( string.format( "Task %s is unassigned to %s", TaskName, TaskGroupName ) )
|
--self:F( string.format( "Task %s is unassigned to %s", TaskName, TaskGroupName ) )
|
||||||
|
|
||||||
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
||||||
self:GetMission():ClearGroupAssignment( TaskGroup )
|
self:GetMission():ClearGroupAssignment( TaskGroup )
|
||||||
@ -517,7 +517,7 @@ do -- Group Assignment
|
|||||||
for UnitID, UnitData in pairs( TaskUnits ) do
|
for UnitID, UnitData in pairs( TaskUnits ) do
|
||||||
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local PlayerName = TaskUnit:GetPlayerName()
|
local PlayerName = TaskUnit:GetPlayerName()
|
||||||
self:E(PlayerName)
|
self:F(PlayerName)
|
||||||
if PlayerName ~= nil and PlayerName ~= "" then
|
if PlayerName ~= nil and PlayerName ~= "" then
|
||||||
self:AssignToUnit( TaskUnit )
|
self:AssignToUnit( TaskUnit )
|
||||||
CommandCenter:MessageToGroup(
|
CommandCenter:MessageToGroup(
|
||||||
@ -865,7 +865,7 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
function TASK:MenuAssignToGroup( TaskGroup )
|
function TASK:MenuAssignToGroup( TaskGroup )
|
||||||
|
|
||||||
self:E( "Join Task menu selected")
|
self:F( "Join Task menu selected")
|
||||||
|
|
||||||
self:AssignToGroup( TaskGroup )
|
self:AssignToGroup( TaskGroup )
|
||||||
end
|
end
|
||||||
@ -875,7 +875,7 @@ end
|
|||||||
function TASK:MenuMarkToGroup( TaskGroup )
|
function TASK:MenuMarkToGroup( TaskGroup )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
self:UpdateTaskInfo()
|
self:UpdateTaskInfo( self.DetectedItem )
|
||||||
|
|
||||||
local Report = REPORT:New():SetIndent( 0 )
|
local Report = REPORT:New():SetIndent( 0 )
|
||||||
|
|
||||||
@ -981,10 +981,10 @@ end
|
|||||||
function TASK:RemoveStateMachine( TaskUnit )
|
function TASK:RemoveStateMachine( TaskUnit )
|
||||||
self:F( { TaskUnit = TaskUnit:GetName(), HasFsm = ( self.Fsm[TaskUnit] ~= nil ) } )
|
self:F( { TaskUnit = TaskUnit:GetName(), HasFsm = ( self.Fsm[TaskUnit] ~= nil ) } )
|
||||||
|
|
||||||
--self:E( self.Fsm )
|
--self:F( self.Fsm )
|
||||||
--for TaskUnitT, Fsm in pairs( self.Fsm ) do
|
--for TaskUnitT, Fsm in pairs( self.Fsm ) do
|
||||||
--local Fsm = Fsm -- Core.Fsm#FSM_PROCESS
|
--local Fsm = Fsm -- Core.Fsm#FSM_PROCESS
|
||||||
--self:E( TaskUnitT )
|
--self:F( TaskUnitT )
|
||||||
--self.Fsm[TaskUnit] = nil
|
--self.Fsm[TaskUnit] = nil
|
||||||
--end
|
--end
|
||||||
|
|
||||||
@ -994,7 +994,7 @@ function TASK:RemoveStateMachine( TaskUnit )
|
|||||||
end
|
end
|
||||||
|
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
self:E( "Garbage Collected, Processes should be finalized now ...")
|
self:F( "Garbage Collected, Processes should be finalized now ...")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -1186,7 +1186,7 @@ end
|
|||||||
-- @param #string TaskBriefing
|
-- @param #string TaskBriefing
|
||||||
-- @return #TASK self
|
-- @return #TASK self
|
||||||
function TASK:SetBriefing( TaskBriefing )
|
function TASK:SetBriefing( TaskBriefing )
|
||||||
self:E(TaskBriefing)
|
self:F(TaskBriefing)
|
||||||
self.TaskBriefing = TaskBriefing
|
self.TaskBriefing = TaskBriefing
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -1210,7 +1210,7 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
|||||||
|
|
||||||
--- This test is required, because the state transition will be fired also when the state does not change in case of an event.
|
--- This test is required, because the state transition will be fired also when the state does not change in case of an event.
|
||||||
if From ~= "Assigned" then
|
if From ~= "Assigned" then
|
||||||
self:E( { From, Event, To, PlayerUnit:GetName(), PlayerName } )
|
self:F( { From, Event, To, PlayerUnit:GetName(), PlayerName } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is assigned." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is assigned." )
|
||||||
|
|
||||||
@ -1219,7 +1219,7 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
|||||||
self:SetGoalTotal() -- Polymorphic to set the initial goal total!
|
self:SetGoalTotal() -- Polymorphic to set the initial goal total!
|
||||||
|
|
||||||
if self.Dispatcher then
|
if self.Dispatcher then
|
||||||
self:E( "Firing Assign event " )
|
self:F( "Firing Assign event " )
|
||||||
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
|
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1230,8 +1230,8 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
|||||||
|
|
||||||
self:SetMenu()
|
self:SetMenu()
|
||||||
|
|
||||||
self:E( { "--> Task Assigned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "--> Task Assigned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "--> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "--> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1244,8 +1244,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterSuccess( From, Event, To )
|
function TASK:onenterSuccess( From, Event, To )
|
||||||
|
|
||||||
self:E( { "<-> Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "<-> Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "<-> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "<-> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is successful! Good job!" )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is successful! Good job!" )
|
||||||
self:UnAssignFromGroups()
|
self:UnAssignFromGroups()
|
||||||
@ -1262,8 +1262,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterAborted( From, Event, To )
|
function TASK:onenterAborted( From, Event, To )
|
||||||
|
|
||||||
self:E( { "<-- Task Aborted", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "<-- Task Aborted", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "<-- Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "<-- Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
if From ~= "Aborted" then
|
if From ~= "Aborted" then
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
||||||
@ -1280,8 +1280,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterCancelled( From, Event, To )
|
function TASK:onenterCancelled( From, Event, To )
|
||||||
|
|
||||||
self:E( { "<-- Task Cancelled", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "<-- Task Cancelled", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "<-- Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "<-- Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
if From ~= "Cancelled" then
|
if From ~= "Cancelled" then
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been cancelled! The tactical situation has changed." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been cancelled! The tactical situation has changed." )
|
||||||
@ -1298,8 +1298,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onafterReplan( From, Event, To )
|
function TASK:onafterReplan( From, Event, To )
|
||||||
|
|
||||||
self:E( { "Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Replanning Task " .. self:GetName() .. "." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Replanning Task " .. self:GetName() .. "." )
|
||||||
|
|
||||||
@ -1314,8 +1314,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterFailed( From, Event, To )
|
function TASK:onenterFailed( From, Event, To )
|
||||||
|
|
||||||
self:E( { "Task Failed", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
self:F( { "Task Failed", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
self:E( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
self:F( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has failed!" )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has failed!" )
|
||||||
|
|
||||||
@ -1336,7 +1336,7 @@ function TASK:onstatechange( From, Event, To )
|
|||||||
if self.Scores[To] then
|
if self.Scores[To] then
|
||||||
local Scoring = self:GetScoring()
|
local Scoring = self:GetScoring()
|
||||||
if Scoring then
|
if Scoring then
|
||||||
self:E( { self.Scores[To].ScoreText, self.Scores[To].Score } )
|
self:F( { self.Scores[To].ScoreText, self.Scores[To].Score } )
|
||||||
Scoring:_AddMissionScore( self.Mission, self.Scores[To].ScoreText, self.Scores[To].Score )
|
Scoring:_AddMissionScore( self.Mission, self.Scores[To].ScoreText, self.Scores[To].Score )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1380,14 +1380,14 @@ do -- Links
|
|||||||
--- Set detection of a task
|
--- Set detection of a task
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Function.Detection#DETECTION_BASE Detection
|
-- @param Function.Detection#DETECTION_BASE Detection
|
||||||
-- @param #number DetectedItemIndex
|
-- @param DetectedItem
|
||||||
-- @return #TASK
|
-- @return #TASK
|
||||||
function TASK:SetDetection( Detection, DetectedItemIndex )
|
function TASK:SetDetection( Detection, DetectedItem )
|
||||||
|
|
||||||
self:E({DetectedItemIndex,Detection})
|
self:F( { DetectedItem, Detection } )
|
||||||
|
|
||||||
self.Detection = Detection
|
self.Detection = Detection
|
||||||
self.DetectedItemIndex = DetectedItemIndex
|
self.DetectedItem = DetectedItem
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -1420,7 +1420,7 @@ end
|
|||||||
-- @return #string
|
-- @return #string
|
||||||
function TASK:ReportOverview( ReportGroup )
|
function TASK:ReportOverview( ReportGroup )
|
||||||
|
|
||||||
self:UpdateTaskInfo()
|
self:UpdateTaskInfo( self.DetectedItem )
|
||||||
|
|
||||||
-- List the name of the Task.
|
-- List the name of the Task.
|
||||||
local TaskName = self:GetName()
|
local TaskName = self:GetName()
|
||||||
@ -1480,7 +1480,7 @@ end
|
|||||||
-- @return #string
|
-- @return #string
|
||||||
function TASK:ReportDetails( ReportGroup )
|
function TASK:ReportDetails( ReportGroup )
|
||||||
|
|
||||||
self:UpdateTaskInfo()
|
self:UpdateTaskInfo( self.DetectedItem )
|
||||||
|
|
||||||
local Report = REPORT:New():SetIndent( 3 )
|
local Report = REPORT:New():SetIndent( 3 )
|
||||||
|
|
||||||
|
|||||||
@ -283,7 +283,7 @@ function TASKINFO:Report( Report, Detail, ReportGroup )
|
|||||||
|
|
||||||
for Key, Data in UTILS.spairs( self.Info.Set, function( t, a, b ) return t[a].Order < t[b].Order end ) do
|
for Key, Data in UTILS.spairs( self.Info.Set, function( t, a, b ) return t[a].Order < t[b].Order end ) do
|
||||||
|
|
||||||
self:E( { Key = Key, Detail = Detail, Data = Data } )
|
self:F( { Key = Key, Detail = Detail, Data = Data } )
|
||||||
|
|
||||||
if Data.Detail:find( Detail ) then
|
if Data.Detail:find( Detail ) then
|
||||||
local Text = ""
|
local Text = ""
|
||||||
|
|||||||
@ -77,7 +77,7 @@ do -- TASK_ZONE_GOAL
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_ZONE_GOAL Task
|
-- @param Tasking.Task#TASK_ZONE_GOAL Task
|
||||||
function Fsm:onafterStartMonitoring( TaskUnit, Task )
|
function Fsm:onafterStartMonitoring( TaskUnit, Task )
|
||||||
self:E( { self } )
|
self:F( { self } )
|
||||||
self:__Monitor( 0.1 )
|
self:__Monitor( 0.1 )
|
||||||
self:__RouteTo( 0.1 )
|
self:__RouteTo( 0.1 )
|
||||||
end
|
end
|
||||||
@ -87,7 +87,7 @@ do -- TASK_ZONE_GOAL
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_ZONE_GOAL Task
|
-- @param Tasking.Task#TASK_ZONE_GOAL Task
|
||||||
function Fsm:onafterMonitor( TaskUnit, Task )
|
function Fsm:onafterMonitor( TaskUnit, Task )
|
||||||
self:E( { self } )
|
self:F( { self } )
|
||||||
self:__Monitor( 15 )
|
self:__Monitor( 15 )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ do -- TASK_ZONE_GOAL
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2G#TASK_ZONE_GOAL Task
|
-- @param Tasking.Task_A2G#TASK_ZONE_GOAL Task
|
||||||
function Fsm:onafterRouteTo( TaskUnit, Task )
|
function Fsm:onafterRouteTo( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.TargetSetUnit
|
-- Determine the first Unit from the self.TargetSetUnit
|
||||||
|
|
||||||
if Task:GetTargetZone( TaskUnit ) then
|
if Task:GetTargetZone( TaskUnit ) then
|
||||||
@ -236,14 +236,14 @@ do -- TASK_ZONE_CAPTURE
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function TASK_ZONE_CAPTURE:OnAfterGoal( From, Event, To, PlayerUnit, PlayerName )
|
function TASK_ZONE_CAPTURE:OnAfterGoal( From, Event, To, PlayerUnit, PlayerName )
|
||||||
|
|
||||||
self:E( { PlayerUnit = PlayerUnit } )
|
self:F( { PlayerUnit = PlayerUnit } )
|
||||||
|
|
||||||
if self.ZoneGoal then
|
if self.ZoneGoal then
|
||||||
if self.ZoneGoal.Goal:IsAchieved() then
|
if self.ZoneGoal.Goal:IsAchieved() then
|
||||||
self:Success()
|
self:Success()
|
||||||
local TotalContributions = self.ZoneGoal.Goal:GetTotalContributions()
|
local TotalContributions = self.ZoneGoal.Goal:GetTotalContributions()
|
||||||
local PlayerContributions = self.ZoneGoal.Goal:GetPlayerContributions()
|
local PlayerContributions = self.ZoneGoal.Goal:GetPlayerContributions()
|
||||||
self:E( { TotalContributions = TotalContributions, PlayerContributions = PlayerContributions } )
|
self:F( { TotalContributions = TotalContributions, PlayerContributions = PlayerContributions } )
|
||||||
for PlayerName, PlayerContribution in pairs( PlayerContributions ) do
|
for PlayerName, PlayerContribution in pairs( PlayerContributions ) do
|
||||||
local Scoring = self:GetScoring()
|
local Scoring = self:GetScoring()
|
||||||
if Scoring then
|
if Scoring then
|
||||||
|
|||||||
@ -90,7 +90,7 @@ do -- TASK_A2A
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2A#TASK_A2A Task
|
-- @param Tasking.Task_A2A#TASK_A2A Task
|
||||||
function Fsm:onafterRouteToRendezVous( TaskUnit, Task )
|
function Fsm:onafterRouteToRendezVous( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.RendezVousSetUnit
|
-- Determine the first Unit from the self.RendezVousSetUnit
|
||||||
|
|
||||||
if Task:GetRendezVousZone( TaskUnit ) then
|
if Task:GetRendezVousZone( TaskUnit ) then
|
||||||
@ -109,7 +109,7 @@ do -- TASK_A2A
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_A2A Task
|
-- @param Tasking.Task#TASK_A2A Task
|
||||||
function Fsm:OnAfterArriveAtRendezVous( TaskUnit, Task )
|
function Fsm:OnAfterArriveAtRendezVous( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.TargetSetUnit
|
-- Determine the first Unit from the self.TargetSetUnit
|
||||||
|
|
||||||
self:__Engage( 0.1 )
|
self:__Engage( 0.1 )
|
||||||
@ -120,7 +120,7 @@ do -- TASK_A2A
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_A2A Task
|
-- @param Tasking.Task#TASK_A2A Task
|
||||||
function Fsm:onafterEngage( TaskUnit, Task )
|
function Fsm:onafterEngage( TaskUnit, Task )
|
||||||
self:E( { self } )
|
self:F( { self } )
|
||||||
self:__Account( 0.1 )
|
self:__Account( 0.1 )
|
||||||
self:__RouteToTarget(0.1 )
|
self:__RouteToTarget(0.1 )
|
||||||
self:__RouteToTargets( -10 )
|
self:__RouteToTargets( -10 )
|
||||||
@ -131,7 +131,7 @@ do -- TASK_A2A
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2A#TASK_A2A Task
|
-- @param Tasking.Task_A2A#TASK_A2A Task
|
||||||
function Fsm:onafterRouteToTarget( TaskUnit, Task )
|
function Fsm:onafterRouteToTarget( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.TargetSetUnit
|
-- Determine the first Unit from the self.TargetSetUnit
|
||||||
|
|
||||||
if Task:GetTargetZone( TaskUnit ) then
|
if Task:GetTargetZone( TaskUnit ) then
|
||||||
@ -152,7 +152,7 @@ do -- TASK_A2A
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2A#TASK_A2A Task
|
-- @param Tasking.Task_A2A#TASK_A2A Task
|
||||||
function Fsm:onafterRouteToTargets( TaskUnit, Task )
|
function Fsm:onafterRouteToTargets( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
||||||
if TargetUnit then
|
if TargetUnit then
|
||||||
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
||||||
@ -308,16 +308,16 @@ do -- TASK_A2A
|
|||||||
|
|
||||||
|
|
||||||
--- @param #TASK_A2A self
|
--- @param #TASK_A2A self
|
||||||
function TASK_A2A:UpdateTaskInfo()
|
function TASK_A2A:UpdateTaskInfo( DetectedItem )
|
||||||
|
|
||||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||||
local TargetCoordinate = self.Detection and self.Detection:GetDetectedItemCoordinate( self.DetectedItemIndex ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
local TargetCoordinate = DetectedItem and self.Detection:GetDetectedItemCoordinate( DetectedItem ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
||||||
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
||||||
self.TaskInfo:AddCoordinate( TargetCoordinate, 1, "SOD" )
|
self.TaskInfo:AddCoordinate( TargetCoordinate, 1, "SOD" )
|
||||||
|
|
||||||
local ThreatLevel, ThreatText
|
local ThreatLevel, ThreatText
|
||||||
if self.Detection then
|
if DetectedItem then
|
||||||
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( self.DetectedItemIndex )
|
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
else
|
else
|
||||||
ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -376,7 +376,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
|
|
||||||
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
||||||
--DetectedSet:Flush()
|
--DetectedSet:Flush()
|
||||||
--self:E( { DetectedSetCount = DetectedSet:Count() } )
|
--self:F( { DetectedSetCount = DetectedSet:Count() } )
|
||||||
if DetectedSet:Count() == 0 then
|
if DetectedSet:Count() == 0 then
|
||||||
Remove = true
|
Remove = true
|
||||||
end
|
end
|
||||||
@ -418,7 +418,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:E( { FriendliesCount = FriendliesCount } )
|
--self:F( { FriendliesCount = FriendliesCount } )
|
||||||
|
|
||||||
local FriendlyTypesReport = REPORT:New()
|
local FriendlyTypesReport = REPORT:New()
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
for PlayerUnitName, PlayerUnitData in pairs( PlayersNearBy ) do
|
for PlayerUnitName, PlayerUnitData in pairs( PlayersNearBy ) do
|
||||||
local PlayerUnit = PlayerUnitData -- Wrapper.Unit#UNIT
|
local PlayerUnit = PlayerUnitData -- Wrapper.Unit#UNIT
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
--self:E( { PlayerName = PlayerName, PlayerUnit = PlayerUnit } )
|
--self:F( { PlayerName = PlayerName, PlayerUnit = PlayerUnit } )
|
||||||
if PlayerUnit:IsAirPlane() and PlayerName ~= nil then
|
if PlayerUnit:IsAirPlane() and PlayerName ~= nil then
|
||||||
local FriendlyUnitThreatLevel = PlayerUnit:GetThreatLevel()
|
local FriendlyUnitThreatLevel = PlayerUnit:GetThreatLevel()
|
||||||
PlayersCount = PlayersCount + 1
|
PlayersCount = PlayersCount + 1
|
||||||
@ -464,8 +464,6 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--self:E( { PlayersCount = PlayersCount } )
|
|
||||||
|
|
||||||
local PlayerTypesReport = REPORT:New()
|
local PlayerTypesReport = REPORT:New()
|
||||||
|
|
||||||
if PlayersCount > 0 then
|
if PlayersCount > 0 then
|
||||||
@ -491,7 +489,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
-- @param Functional.Detection#DETECTION_BASE Detection The detection created by the @{Detection#DETECTION_BASE} derived object.
|
-- @param Functional.Detection#DETECTION_BASE Detection The detection created by the @{Detection#DETECTION_BASE} derived object.
|
||||||
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
||||||
function TASK_A2A_DISPATCHER:ProcessDetected( Detection )
|
function TASK_A2A_DISPATCHER:ProcessDetected( Detection )
|
||||||
self:E()
|
self:F()
|
||||||
|
|
||||||
local AreaMsg = {}
|
local AreaMsg = {}
|
||||||
local TaskMsg = {}
|
local TaskMsg = {}
|
||||||
@ -507,11 +505,11 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
||||||
local Task = TaskData -- Tasking.Task#TASK
|
local Task = TaskData -- Tasking.Task#TASK
|
||||||
if Task:IsStatePlanned() then
|
if Task:IsStatePlanned() then
|
||||||
local DetectedItem = Detection:GetDetectedItem( TaskIndex )
|
local DetectedItem = Detection:GetDetectedItemByIndex( TaskIndex )
|
||||||
if not DetectedItem then
|
if not DetectedItem then
|
||||||
local TaskText = Task:GetName()
|
local TaskText = Task:GetName()
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2A task %s for %s removed.", TaskText, Mission:GetName() ), TaskGroup )
|
Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2A task %s for %s removed.", TaskText, Mission:GetShortText() ), TaskGroup )
|
||||||
end
|
end
|
||||||
Task = self:RemoveTask( TaskIndex )
|
Task = self:RemoveTask( TaskIndex )
|
||||||
end
|
end
|
||||||
@ -525,7 +523,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
||||||
local DetectedCount = DetectedSet:Count()
|
local DetectedCount = DetectedSet:Count()
|
||||||
local DetectedZone = DetectedItem.Zone
|
local DetectedZone = DetectedItem.Zone
|
||||||
--self:E( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
|
--self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
|
||||||
--DetectedSet:Flush()
|
--DetectedSet:Flush()
|
||||||
|
|
||||||
local DetectedID = DetectedItem.ID
|
local DetectedID = DetectedItem.ID
|
||||||
@ -540,17 +538,17 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateENGAGE( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
local TargetSetUnit = self:EvaluateENGAGE( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_ENGAGE:New( Mission, self.SetGroup, string.format( "ENGAGE.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_ENGAGE:New( Mission, self.SetGroup, string.format( "ENGAGE.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
else
|
else
|
||||||
local TargetSetUnit = self:EvaluateINTERCEPT( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
local TargetSetUnit = self:EvaluateINTERCEPT( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_INTERCEPT:New( Mission, self.SetGroup, string.format( "INTERCEPT.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_INTERCEPT:New( Mission, self.SetGroup, string.format( "INTERCEPT.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
else
|
else
|
||||||
local TargetSetUnit = self:EvaluateSWEEP( DetectedItem ) -- Returns a SetUnit
|
local TargetSetUnit = self:EvaluateSWEEP( DetectedItem ) -- Returns a SetUnit
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_SWEEP:New( Mission, self.SetGroup, string.format( "SWEEP.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_SWEEP:New( Mission, self.SetGroup, string.format( "SWEEP.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -563,7 +561,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
|
|
||||||
TaskReport:Add( Task:GetName() )
|
TaskReport:Add( Task:GetName() )
|
||||||
else
|
else
|
||||||
self:E("This should not happen")
|
self:F("This should not happen")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -586,7 +584,7 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
|
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then
|
if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then
|
||||||
Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetName(), TaskText ), TaskGroup )
|
Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetShortText(), TaskText ), TaskGroup )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ do -- TASK_A2G
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2G#TASK_A2G Task
|
-- @param Tasking.Task_A2G#TASK_A2G Task
|
||||||
function Fsm:onafterRouteToRendezVous( TaskUnit, Task )
|
function Fsm:onafterRouteToRendezVous( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.RendezVousSetUnit
|
-- Determine the first Unit from the self.RendezVousSetUnit
|
||||||
|
|
||||||
if Task:GetRendezVousZone( TaskUnit ) then
|
if Task:GetRendezVousZone( TaskUnit ) then
|
||||||
@ -109,7 +109,7 @@ do -- TASK_A2G
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_A2G Task
|
-- @param Tasking.Task#TASK_A2G Task
|
||||||
function Fsm:OnAfterArriveAtRendezVous( TaskUnit, Task )
|
function Fsm:OnAfterArriveAtRendezVous( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.TargetSetUnit
|
-- Determine the first Unit from the self.TargetSetUnit
|
||||||
|
|
||||||
self:__Engage( 0.1 )
|
self:__Engage( 0.1 )
|
||||||
@ -120,7 +120,7 @@ do -- TASK_A2G
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task#TASK_A2G Task
|
-- @param Tasking.Task#TASK_A2G Task
|
||||||
function Fsm:onafterEngage( TaskUnit, Task )
|
function Fsm:onafterEngage( TaskUnit, Task )
|
||||||
self:E( { self } )
|
self:F( { self } )
|
||||||
self:__Account( 0.1 )
|
self:__Account( 0.1 )
|
||||||
self:__RouteToTarget(0.1 )
|
self:__RouteToTarget(0.1 )
|
||||||
self:__RouteToTargets( -10 )
|
self:__RouteToTargets( -10 )
|
||||||
@ -131,7 +131,7 @@ do -- TASK_A2G
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2G#TASK_A2G Task
|
-- @param Tasking.Task_A2G#TASK_A2G Task
|
||||||
function Fsm:onafterRouteToTarget( TaskUnit, Task )
|
function Fsm:onafterRouteToTarget( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
-- Determine the first Unit from the self.TargetSetUnit
|
-- Determine the first Unit from the self.TargetSetUnit
|
||||||
|
|
||||||
if Task:GetTargetZone( TaskUnit ) then
|
if Task:GetTargetZone( TaskUnit ) then
|
||||||
@ -152,7 +152,7 @@ do -- TASK_A2G
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_A2G#TASK_A2G Task
|
-- @param Tasking.Task_A2G#TASK_A2G Task
|
||||||
function Fsm:onafterRouteToTargets( TaskUnit, Task )
|
function Fsm:onafterRouteToTargets( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
||||||
if TargetUnit then
|
if TargetUnit then
|
||||||
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
Task:SetTargetCoordinate( TargetUnit:GetCoordinate(), TaskUnit )
|
||||||
@ -307,16 +307,16 @@ do -- TASK_A2G
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_A2G self
|
--- @param #TASK_A2G self
|
||||||
function TASK_A2G:UpdateTaskInfo()
|
function TASK_A2G:UpdateTaskInfo( DetectedItem )
|
||||||
|
|
||||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||||
local TargetCoordinate = self.Detection and self.Detection:GetDetectedItemCoordinate( self.DetectedItemIndex ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
local TargetCoordinate = DetectedItem and self.Detection:GetDetectedItemCoordinate( DetectedItem ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
||||||
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
||||||
self.TaskInfo:AddCoordinate( TargetCoordinate, 1, "SOD" )
|
self.TaskInfo:AddCoordinate( TargetCoordinate, 1, "SOD" )
|
||||||
|
|
||||||
local ThreatLevel, ThreatText
|
local ThreatLevel, ThreatText
|
||||||
if self.Detection then
|
if DetectedItem then
|
||||||
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( self.DetectedItemIndex )
|
ThreatLevel, ThreatText = self.Detection:GetDetectedItemThreatLevel( DetectedItem )
|
||||||
else
|
else
|
||||||
ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -47,11 +47,34 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
-- This chapters provides some insights in the tactical situations when certain Task Types are created.
|
-- This chapters provides some insights in the tactical situations when certain Task Types are created.
|
||||||
-- The Task Types are depending on the enemy positions that were detected, and the current location of friendly units.
|
-- The Task Types are depending on the enemy positions that were detected, and the current location of friendly units.
|
||||||
--
|
--
|
||||||
|
-- 
|
||||||
|
--
|
||||||
|
-- In the demonstration mission [TAD-A2G-000 - AREAS - Detection test],
|
||||||
|
-- the tactical situation is a demonstration how the A2G detection works.
|
||||||
|
-- This example will be taken further in the explanation in the following chapters.
|
||||||
|
--
|
||||||
|
-- 
|
||||||
|
--
|
||||||
|
-- The red coalition are the players, the blue coalition is the enemy.
|
||||||
|
--
|
||||||
|
-- Red reconnaissance vehicles and airborne units are detecting the targets.
|
||||||
|
-- We call this the RecceSet as explained above, which is a Set of Groups that
|
||||||
|
-- have a group name starting with `Recce` (configured in the mission script).
|
||||||
|
--
|
||||||
|
-- Red attack units are responsible for executing the mission for the command center.
|
||||||
|
-- We call this the AttackSet, which is a Set of Groups with a group name starting with `Attack` (configured in the mission script).
|
||||||
|
-- These units are setup in this demonstration mission to be ground vehicles and airplanes.
|
||||||
|
-- For demonstration purposes, the attack airplane is stationed on the ground to explain
|
||||||
|
-- the messages and the menus properly.
|
||||||
|
-- Further test missions demonstrate the A2G task dispatcher from within air.
|
||||||
|
--
|
||||||
|
-- Depending upon the detection results, the A2G dispatcher will create different tasks.
|
||||||
|
--
|
||||||
-- # 0.1. SEAD Task
|
-- # 0.1. SEAD Task
|
||||||
--
|
--
|
||||||
-- A SEAD Task is dispatched when there are ground based Radar Emitters detected within an area.
|
-- A SEAD Task is dispatched when there are ground based Radar Emitters detected within an area.
|
||||||
--
|
--
|
||||||
-- 
|
-- 
|
||||||
--
|
--
|
||||||
-- - Once all Radar Emitting Units have been destroyed, the Task will convert into a BAI or CAS task!
|
-- - Once all Radar Emitting Units have been destroyed, the Task will convert into a BAI or CAS task!
|
||||||
-- - A CAS and BAI task may be converted into a SEAD task, once a radar has been detected within the area!
|
-- - A CAS and BAI task may be converted into a SEAD task, once a radar has been detected within the area!
|
||||||
@ -60,7 +83,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- A CAS Task is dispatched when there are no ground based Radar Emitters within the area, but there are friendly ground Units within 6 km from the enemy.
|
-- A CAS Task is dispatched when there are no ground based Radar Emitters within the area, but there are friendly ground Units within 6 km from the enemy.
|
||||||
--
|
--
|
||||||
-- 
|
-- 
|
||||||
--
|
--
|
||||||
-- - After the detection of the CAS task, if the friendly Units are destroyed, the CAS task will convert into a BAI task!
|
-- - After the detection of the CAS task, if the friendly Units are destroyed, the CAS task will convert into a BAI task!
|
||||||
-- - Only ground Units are taken into account. Airborne units are ships are not considered friendlies that require Close Air Support.
|
-- - Only ground Units are taken into account. Airborne units are ships are not considered friendlies that require Close Air Support.
|
||||||
@ -69,7 +92,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- A BAI Task is dispatched when there are no ground based Radar Emitters within the area, and there aren't friendly ground Units within 6 km from the enemy.
|
-- A BAI Task is dispatched when there are no ground based Radar Emitters within the area, and there aren't friendly ground Units within 6 km from the enemy.
|
||||||
--
|
--
|
||||||
-- 
|
-- 
|
||||||
--
|
--
|
||||||
-- - A BAI task may be converted into a CAS task if friendly Ground Units approach within 6 km range!
|
-- - A BAI task may be converted into a CAS task if friendly Ground Units approach within 6 km range!
|
||||||
--
|
--
|
||||||
@ -83,16 +106,15 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha (Primary)"
|
||||||
-- F2. Mission "Beta"
|
-- F2. Mission "Beta (Secondary)"
|
||||||
-- F3. Mission "Gamma"
|
-- F3. Mission "Gamma (Tactical)"
|
||||||
-- F1. Command Center |Gudauta|
|
-- F1. Command Center [Lima]
|
||||||
-- F1. Mission "Overlord"
|
-- F1. Mission "Overlord (High)"
|
||||||
-- F2. Mission "Desert Storm"
|
|
||||||
--
|
--
|
||||||
-- CC |Gori| is controlling Mission "Alpha", "Beta", "Gamma".
|
-- Command Center [Gori] is controlling Mission "Alpha", "Beta", "Gamma". Alpha is the Primary mission, Beta the Secondary and there is a Tacical mission Gamma.
|
||||||
-- CC |Gudauta| is controlling Missions "Overlord" and "Desert Storm".
|
-- Command Center [Lima] is controlling Missions "Overlord", which needs to be executed with High priority.
|
||||||
--
|
--
|
||||||
-- ## 1.1. Mission Menu (Under the Command Center Menu)
|
-- ## 1.1. Mission Menu (Under the Command Center Menu)
|
||||||
--
|
--
|
||||||
@ -103,19 +125,18 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
-- - **Create Task Reports**: A menu to create various reports of the current tasks dispatched by the A2G dispatcher.
|
-- - **Create Task Reports**: A menu to create various reports of the current tasks dispatched by the A2G dispatcher.
|
||||||
-- - **Create Mission Reports**: A menu to create various reports on the current mission.
|
-- - **Create Mission Reports**: A menu to create various reports on the current mission.
|
||||||
--
|
--
|
||||||
-- 
|
-- For CC [Lima], Mission "Overlord", the menu structure could look like this:
|
||||||
--
|
|
||||||
-- For CC |Gori|, Mission "Alpha", the menu structure could look like this:
|
|
||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Lima]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Overlord"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
-- F3. Task Reports
|
-- F3. Task Reports
|
||||||
-- F4. Mission Reports
|
-- F4. Mission Reports
|
||||||
--
|
--
|
||||||
|
-- 
|
||||||
--
|
--
|
||||||
-- ### 1.1.1. Mission Briefing Menu
|
-- ### 1.1.1. Mission Briefing Menu
|
||||||
--
|
--
|
||||||
@ -143,11 +164,11 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- The information shown of the tasks will vary according the underlying task type, but are self explanatory.
|
-- The information shown of the tasks will vary according the underlying task type, but are self explanatory.
|
||||||
--
|
--
|
||||||
-- For CC |Gori|, Mission "Alpha", the Task Reports menu structure could look like this:
|
-- For CC [Gori], Mission "Alpha", the Task Reports menu structure could look like this:
|
||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
@ -173,7 +194,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
@ -200,7 +221,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
@ -224,7 +245,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
@ -240,7 +261,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
-- The Join Planned Task Menu contains the different Planned A2G Tasks **in a structured Menu Hierarchy**.
|
-- The Join Planned Task Menu contains the different Planned A2G Tasks **in a structured Menu Hierarchy**.
|
||||||
-- The Menu Hierarchy is structuring the Tasks per **Task Type**, and then by **Task Name (ID)**.
|
-- The Menu Hierarchy is structuring the Tasks per **Task Type**, and then by **Task Name (ID)**.
|
||||||
--
|
--
|
||||||
-- For example, for CC |Gori|, Mission "Alpha",
|
-- For example, for CC [Gori], Mission "Alpha",
|
||||||
-- if a Mission "ALpha" contains 5 Planned Tasks, which would be:
|
-- if a Mission "ALpha" contains 5 Planned Tasks, which would be:
|
||||||
--
|
--
|
||||||
-- - 2 CAS Tasks
|
-- - 2 CAS Tasks
|
||||||
@ -251,34 +272,29 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Radio MENU Structure (F10. Other)
|
-- Radio MENU Structure (F10. Other)
|
||||||
--
|
--
|
||||||
-- F1. Command Center |Gori|
|
-- F1. Command Center [Gori]
|
||||||
-- F1. Mission "Alpha"
|
-- F1. Mission "Alpha"
|
||||||
-- F1. Mission Briefing
|
-- F1. Mission Briefing
|
||||||
-- F2. Mark Task Locations on Map
|
-- F2. Mark Task Locations on Map
|
||||||
-- F3. Task Reports
|
-- F3. Task Reports
|
||||||
-- F4. Mission Reports
|
-- F4. Mission Reports
|
||||||
-- F5. Join Planned Task
|
-- F5. Join Planned Task
|
||||||
-- F1. CAS
|
|
||||||
-- F1. CAS.001
|
|
||||||
-- F2. CAS.002
|
|
||||||
-- F2. BAI
|
-- F2. BAI
|
||||||
-- F1. BAI.001
|
-- F1. BAI.001
|
||||||
|
-- F1. CAS
|
||||||
|
-- F1. CAS.002
|
||||||
-- F3. SEAD
|
-- F3. SEAD
|
||||||
-- F1. SEAD.001
|
-- F1. SEAD.003
|
||||||
-- F2. SEAD.002
|
-- F2. SEAD.004
|
||||||
|
-- F3. SEAD.005
|
||||||
--
|
--
|
||||||
-- An example from within a running simulation:
|
-- An example from within a running simulation:
|
||||||
--
|
--
|
||||||
-- 
|
-- 
|
||||||
--
|
--
|
||||||
-- Each Task Type Menu would have a list of the Task Menus underneath.
|
-- Each Task Type Menu would have a list of the Task Menus underneath.
|
||||||
-- Each Task Menu (eg. `CAS.001`) has a **detailed Task Menu structure to control the specific task**!
|
-- Each Task Menu (eg. `CAS.001`) has a **detailed Task Menu structure to control the specific task**!
|
||||||
--
|
--
|
||||||
-- An example from within a running simulation:
|
|
||||||
--
|
|
||||||
-- 
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- ### 1.3.1. Planned Task Menu
|
-- ### 1.3.1. Planned Task Menu
|
||||||
--
|
--
|
||||||
-- Each Planned Task Menu will allow for the following actions:
|
-- Each Planned Task Menu will allow for the following actions:
|
||||||
@ -306,10 +322,6 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- **The Join Task is THE menu option to let a Player join the Task, and to engage within the Mission.**
|
-- **The Join Task is THE menu option to let a Player join the Task, and to engage within the Mission.**
|
||||||
--
|
--
|
||||||
-- An example from within a running simulation:
|
|
||||||
--
|
|
||||||
-- 
|
|
||||||
--
|
|
||||||
--
|
--
|
||||||
-- ## 1.4. Assigned Task Menu
|
-- ## 1.4. Assigned Task Menu
|
||||||
--
|
--
|
||||||
@ -337,13 +349,29 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
-- Task abortion will result in the Task to be Cancelled, and the Task **may** be **Replanned**.
|
-- Task abortion will result in the Task to be Cancelled, and the Task **may** be **Replanned**.
|
||||||
-- However, this will depend on the setup of each Mission.
|
-- However, this will depend on the setup of each Mission.
|
||||||
--
|
--
|
||||||
|
-- ## 1.5. Messages
|
||||||
--
|
--
|
||||||
|
-- During game play, different messages are displayed.
|
||||||
|
-- These messages provide an update of the achievements made, and the state wherein the task is.
|
||||||
--
|
--
|
||||||
-- # 1. TASK_A2G_DISPATCHER constructor
|
-- The various reports can be used also to retrieve the current status of the mission and its tasks.
|
||||||
|
--
|
||||||
|
-- 
|
||||||
|
--
|
||||||
|
-- The @{Settings} menu provides additional options to control the timing of the messages.
|
||||||
|
-- There are:
|
||||||
|
--
|
||||||
|
-- - Status messages, which are quick status updates. The settings menu allows to switch off these messages.
|
||||||
|
-- - Information messages, which are shown a bit longer, as they contain important information.
|
||||||
|
-- - Summary reports, which are quick reports showing a high level summary.
|
||||||
|
-- - Overview reports, which are providing the essential information. It provides an overview of a greater thing, and may take a bit of time to read.
|
||||||
|
-- - Detailed reports, which provide with very detailed information. It takes a bit longer to read those reports, so the display of those could be a bit longer.
|
||||||
|
--
|
||||||
|
-- # 2. TASK_A2G_DISPATCHER constructor
|
||||||
--
|
--
|
||||||
-- The @{#TASK_A2G_DISPATCHER.New}() method creates a new TASK_A2G_DISPATCHER instance.
|
-- The @{#TASK_A2G_DISPATCHER.New}() method creates a new TASK_A2G_DISPATCHER instance.
|
||||||
--
|
--
|
||||||
-- # 2. Usage
|
-- # 3. Usage
|
||||||
--
|
--
|
||||||
-- To use the TASK\_A2G\_DISPATCHER class, you need:
|
-- To use the TASK\_A2G\_DISPATCHER class, you need:
|
||||||
--
|
--
|
||||||
@ -545,7 +573,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
|
|
||||||
if Task then
|
if Task then
|
||||||
if ( Task:IsStatePlanned() and DetectedItemChanged == true ) or Task:IsStateCancelled() then
|
if ( Task:IsStatePlanned() and DetectedItemChanged == true ) or Task:IsStateCancelled() then
|
||||||
--self:E( "Removing Tasking: " .. Task:GetTaskName() )
|
--self:F( "Removing Tasking: " .. Task:GetTaskName() )
|
||||||
self:RemoveTask( TaskIndex )
|
self:RemoveTask( TaskIndex )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -559,7 +587,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
-- @param Functional.Detection#DETECTION_BASE Detection The detection created by the @{Detection#DETECTION_BASE} derived object.
|
-- @param Functional.Detection#DETECTION_BASE Detection The detection created by the @{Detection#DETECTION_BASE} derived object.
|
||||||
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
-- @return #boolean Return true if you want the task assigning to continue... false will cancel the loop.
|
||||||
function TASK_A2G_DISPATCHER:ProcessDetected( Detection )
|
function TASK_A2G_DISPATCHER:ProcessDetected( Detection )
|
||||||
self:E()
|
self:F()
|
||||||
|
|
||||||
local AreaMsg = {}
|
local AreaMsg = {}
|
||||||
local TaskMsg = {}
|
local TaskMsg = {}
|
||||||
@ -575,11 +603,11 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
for TaskIndex, TaskData in pairs( self.Tasks ) do
|
||||||
local Task = TaskData -- Tasking.Task#TASK
|
local Task = TaskData -- Tasking.Task#TASK
|
||||||
if Task:IsStatePlanned() then
|
if Task:IsStatePlanned() then
|
||||||
local DetectedItem = Detection:GetDetectedItem( TaskIndex )
|
local DetectedItem = Detection:GetDetectedItemByIndex( TaskIndex )
|
||||||
if not DetectedItem then
|
if not DetectedItem then
|
||||||
local TaskText = Task:GetName()
|
local TaskText = Task:GetName()
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2G task %s for %s removed.", TaskText, Mission:GetName() ), TaskGroup )
|
Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2G task %s for %s removed.", TaskText, Mission:GetShortText() ), TaskGroup )
|
||||||
end
|
end
|
||||||
Task = self:RemoveTask( TaskIndex )
|
Task = self:RemoveTask( TaskIndex )
|
||||||
end
|
end
|
||||||
@ -592,14 +620,14 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local DetectedItem = DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
|
local DetectedItem = DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
|
||||||
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
local DetectedSet = DetectedItem.Set -- Core.Set#SET_UNIT
|
||||||
local DetectedZone = DetectedItem.Zone
|
local DetectedZone = DetectedItem.Zone
|
||||||
--self:E( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
|
--self:F( { "Targets in DetectedItem", DetectedItem.ItemID, DetectedSet:Count(), tostring( DetectedItem ) } )
|
||||||
--DetectedSet:Flush()
|
--DetectedSet:Flush()
|
||||||
|
|
||||||
local DetectedItemID = DetectedItem.ID
|
local DetectedItemID = DetectedItem.ID
|
||||||
local TaskIndex = DetectedItem.ID
|
local TaskIndex = DetectedItem.ID
|
||||||
local DetectedItemChanged = DetectedItem.Changed
|
local DetectedItemChanged = DetectedItem.Changed
|
||||||
|
|
||||||
self:E( { DetectedItemChanged = DetectedItemChanged, DetectedItemID = DetectedItemID, TaskIndex = TaskIndex } )
|
self:F( { DetectedItemChanged = DetectedItemChanged, DetectedItemID = DetectedItemID, TaskIndex = TaskIndex } )
|
||||||
|
|
||||||
local Task = self.Tasks[TaskIndex] -- Tasking.Task_A2G#TASK_A2G
|
local Task = self.Tasks[TaskIndex] -- Tasking.Task_A2G#TASK_A2G
|
||||||
|
|
||||||
@ -612,7 +640,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
if Task:IsInstanceOf( TASK_A2G_SEAD ) then
|
if Task:IsInstanceOf( TASK_A2G_SEAD ) then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
@ -623,7 +651,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
if Task:IsInstanceOf( TASK_A2G_CAS ) then
|
if Task:IsInstanceOf( TASK_A2G_CAS ) then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, TaskIndex )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
@ -635,7 +663,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
if Task:IsInstanceOf( TASK_A2G_BAI ) then
|
if Task:IsInstanceOf( TASK_A2G_BAI ) then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, TaskIndex )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
TargetsReport:Add( Detection:GetChangeText( DetectedItem ) )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
@ -663,7 +691,8 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:UpdateTaskInfo()
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
Task = self:RemoveTask( TaskIndex )
|
Task = self:RemoveTask( TaskIndex )
|
||||||
@ -673,8 +702,8 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
Task = self:RemoveTask( TaskIndex )
|
Task = self:RemoveTask( TaskIndex )
|
||||||
@ -684,8 +713,8 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateBAI( DetectedItem ) -- Returns a SetUnit if there are targets to be BAIed...
|
local TargetSetUnit = self:EvaluateBAI( DetectedItem ) -- Returns a SetUnit if there are targets to be BAIed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task:SetTargetSetUnit( TargetSetUnit )
|
Task:SetTargetSetUnit( TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
else
|
else
|
||||||
Task:Cancel()
|
Task:Cancel()
|
||||||
Task = self:RemoveTask( TaskIndex )
|
Task = self:RemoveTask( TaskIndex )
|
||||||
@ -705,7 +734,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
local TargetSetUnit = self:EvaluateSEAD( DetectedItem ) -- Returns a SetUnit if there are targets to be SEADed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2G_SEAD:New( Mission, self.SetGroup, string.format( "SEAD.%03d", DetectedItemID ), TargetSetUnit )
|
Task = TASK_A2G_SEAD:New( Mission, self.SetGroup, string.format( "SEAD.%03d", DetectedItemID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Evaluate CAS
|
-- Evaluate CAS
|
||||||
@ -713,7 +742,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
local TargetSetUnit = self:EvaluateCAS( DetectedItem ) -- Returns a SetUnit if there are targets to be CASed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2G_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", DetectedItemID ), TargetSetUnit )
|
Task = TASK_A2G_CAS:New( Mission, self.SetGroup, string.format( "CAS.%03d", DetectedItemID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Evaluate BAI
|
-- Evaluate BAI
|
||||||
@ -721,7 +750,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TargetSetUnit = self:EvaluateBAI( DetectedItem, self.Mission:GetCommandCenter():GetPositionable():GetCoalition() ) -- Returns a SetUnit if there are targets to be BAIed...
|
local TargetSetUnit = self:EvaluateBAI( DetectedItem, self.Mission:GetCommandCenter():GetPositionable():GetCoalition() ) -- Returns a SetUnit if there are targets to be BAIed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2G_BAI:New( Mission, self.SetGroup, string.format( "BAI.%03d", DetectedItemID ), TargetSetUnit )
|
Task = TASK_A2G_BAI:New( Mission, self.SetGroup, string.format( "BAI.%03d", DetectedItemID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, TaskIndex )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -730,12 +759,12 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
self.Tasks[TaskIndex] = Task
|
self.Tasks[TaskIndex] = Task
|
||||||
Task:SetTargetZone( DetectedZone )
|
Task:SetTargetZone( DetectedZone )
|
||||||
Task:SetDispatcher( self )
|
Task:SetDispatcher( self )
|
||||||
Task:UpdateTaskInfo()
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
Mission:AddTask( Task )
|
Mission:AddTask( Task )
|
||||||
|
|
||||||
TaskReport:Add( Task:GetName() )
|
TaskReport:Add( Task:GetName() )
|
||||||
else
|
else
|
||||||
self:E("This should not happen")
|
self:F("This should not happen")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -750,7 +779,7 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
local TaskText = TaskReport:Text(", ")
|
local TaskText = TaskReport:Text(", ")
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then
|
if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then
|
||||||
Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetName(), TaskText ), TaskGroup )
|
Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetShortText(), TaskText ), TaskGroup )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -212,7 +212,7 @@ do -- TASK_CARGO
|
|||||||
|
|
||||||
local TaskUnitName = TaskUnit:GetName()
|
local TaskUnitName = TaskUnit:GetName()
|
||||||
|
|
||||||
self:E( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
local MenuTime = timer.getTime()
|
local MenuTime = timer.getTime()
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:OnLeaveWaitingForCommand( TaskUnit, Task )
|
function Fsm:OnLeaveWaitingForCommand( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
TaskUnit.Menu:Remove()
|
TaskUnit.Menu:Remove()
|
||||||
end
|
end
|
||||||
@ -332,7 +332,7 @@ do -- TASK_CARGO
|
|||||||
-- @param To
|
-- @param To
|
||||||
-- @param Core.Cargo#CARGO Cargo
|
-- @param Core.Cargo#CARGO Cargo
|
||||||
function Fsm:onafterRouteToPickup( TaskUnit, Task, From, Event, To, Cargo )
|
function Fsm:onafterRouteToPickup( TaskUnit, Task, From, Event, To, Cargo )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if Cargo:IsAlive() then
|
if Cargo:IsAlive() then
|
||||||
self.Cargo = Cargo -- Core.Cargo#CARGO
|
self.Cargo = Cargo -- Core.Cargo#CARGO
|
||||||
@ -348,7 +348,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterArriveAtPickup( TaskUnit, Task )
|
function Fsm:onafterArriveAtPickup( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
if self.Cargo:IsAlive() then
|
if self.Cargo:IsAlive() then
|
||||||
self.Cargo:Smoke( Task:GetSmokeColor(), 15 )
|
self.Cargo:Smoke( Task:GetSmokeColor(), 15 )
|
||||||
if TaskUnit:IsAir() then
|
if TaskUnit:IsAir() then
|
||||||
@ -365,7 +365,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterCancelRouteToPickup( TaskUnit, Task )
|
function Fsm:onafterCancelRouteToPickup( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
self:__SelectAction( -0.1 )
|
self:__SelectAction( -0.1 )
|
||||||
end
|
end
|
||||||
@ -374,9 +374,9 @@ do -- TASK_CARGO
|
|||||||
--- @param #FSM_PROCESS self
|
--- @param #FSM_PROCESS self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function Fsm:onafterRouteToDeploy( TaskUnit, Task, From, Event, To, DeployZone )
|
function Fsm:onafterRouteToDeploy( TaskUnit, Task, From, Event, To, DeployZone )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
self:E( DeployZone )
|
self:F( DeployZone )
|
||||||
self.DeployZone = DeployZone
|
self.DeployZone = DeployZone
|
||||||
Task:SetDeployZone( self.DeployZone, TaskUnit )
|
Task:SetDeployZone( self.DeployZone, TaskUnit )
|
||||||
self:__RouteToDeployZone( -0.1 )
|
self:__RouteToDeployZone( -0.1 )
|
||||||
@ -387,7 +387,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterArriveAtDeploy( TaskUnit, Task )
|
function Fsm:onafterArriveAtDeploy( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if TaskUnit:IsAir() then
|
if TaskUnit:IsAir() then
|
||||||
Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() )
|
Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() )
|
||||||
@ -402,7 +402,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterCancelRouteToDeploy( TaskUnit, Task )
|
function Fsm:onafterCancelRouteToDeploy( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
self:__SelectAction( -0.1 )
|
self:__SelectAction( -0.1 )
|
||||||
end
|
end
|
||||||
@ -413,7 +413,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterLand( TaskUnit, Task, From, Event, To, Action )
|
function Fsm:onafterLand( TaskUnit, Task, From, Event, To, Action )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if self.Cargo:IsAlive() then
|
if self.Cargo:IsAlive() then
|
||||||
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
||||||
@ -437,7 +437,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterLanded( TaskUnit, Task, From, Event, To, Action )
|
function Fsm:onafterLanded( TaskUnit, Task, From, Event, To, Action )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if self.Cargo:IsAlive() then
|
if self.Cargo:IsAlive() then
|
||||||
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
||||||
@ -460,7 +460,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterPrepareBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
function Fsm:onafterPrepareBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if Cargo and Cargo:IsAlive() then
|
if Cargo and Cargo:IsAlive() then
|
||||||
self.Cargo = Cargo -- Core.Cargo#CARGO_GROUP
|
self.Cargo = Cargo -- Core.Cargo#CARGO_GROUP
|
||||||
@ -472,10 +472,10 @@ do -- TASK_CARGO
|
|||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterBoard( TaskUnit, Task )
|
function Fsm:onafterBoard( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
function self.Cargo:OnEnterLoaded( From, Event, To, TaskUnit, TaskProcess )
|
function self.Cargo:OnEnterLoaded( From, Event, To, TaskUnit, TaskProcess )
|
||||||
self:E({From, Event, To, TaskUnit, TaskProcess })
|
self:F({From, Event, To, TaskUnit, TaskProcess })
|
||||||
TaskProcess:__Boarded( 0.1 )
|
TaskProcess:__Boarded( 0.1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ do -- TASK_CARGO
|
|||||||
function Fsm:onafterBoarded( TaskUnit, Task )
|
function Fsm:onafterBoarded( TaskUnit, Task )
|
||||||
|
|
||||||
local TaskUnitName = TaskUnit:GetName()
|
local TaskUnitName = TaskUnit:GetName()
|
||||||
self:E( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
self.Cargo:MessageToGroup( "Boarded ...", TaskUnit:GetGroup() )
|
self.Cargo:MessageToGroup( "Boarded ...", TaskUnit:GetGroup() )
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ do -- TASK_CARGO
|
|||||||
-- @param Cargo
|
-- @param Cargo
|
||||||
-- @param Core.Zone#ZONE_BASE DeployZone
|
-- @param Core.Zone#ZONE_BASE DeployZone
|
||||||
function Fsm:onafterPrepareUnBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
function Fsm:onafterPrepareUnBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID(), From, Event, To, Cargo } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID(), From, Event, To, Cargo } )
|
||||||
|
|
||||||
self.Cargo = Cargo
|
self.Cargo = Cargo
|
||||||
self.DeployZone = nil
|
self.DeployZone = nil
|
||||||
@ -558,10 +558,10 @@ do -- TASK_CARGO
|
|||||||
-- @param Cargo
|
-- @param Cargo
|
||||||
-- @param Core.Zone#ZONE_BASE DeployZone
|
-- @param Core.Zone#ZONE_BASE DeployZone
|
||||||
function Fsm:onafterUnBoard( TaskUnit, Task, From, Event, To, Cargo, DeployZone )
|
function Fsm:onafterUnBoard( TaskUnit, Task, From, Event, To, Cargo, DeployZone )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID(), From, Event, To, Cargo, DeployZone } )
|
self:F( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID(), From, Event, To, Cargo, DeployZone } )
|
||||||
|
|
||||||
function self.Cargo:OnEnterUnLoaded( From, Event, To, DeployZone, TaskProcess )
|
function self.Cargo:OnEnterUnLoaded( From, Event, To, DeployZone, TaskProcess )
|
||||||
self:E({From, Event, To, DeployZone, TaskProcess })
|
self:F({From, Event, To, DeployZone, TaskProcess })
|
||||||
TaskProcess:__UnBoarded( -0.1 )
|
TaskProcess:__UnBoarded( -0.1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ do -- TASK_CARGO
|
|||||||
function Fsm:onafterUnBoarded( TaskUnit, Task )
|
function Fsm:onafterUnBoarded( TaskUnit, Task )
|
||||||
|
|
||||||
local TaskUnitName = TaskUnit:GetName()
|
local TaskUnitName = TaskUnit:GetName()
|
||||||
self:E( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
self:F( { TaskUnit = TaskUnitName, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
self.Cargo:MessageToGroup( "UnBoarded ...", TaskUnit:GetGroup() )
|
self.Cargo:MessageToGroup( "UnBoarded ...", TaskUnit:GetGroup() )
|
||||||
|
|
||||||
@ -810,7 +810,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- @param #TASK_CARGO self
|
--- @param #TASK_CARGO self
|
||||||
function TASK_CARGO:UpdateTaskInfo()
|
function TASK_CARGO:UpdateTaskInfo( DetectedItem )
|
||||||
|
|
||||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||||
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
||||||
@ -855,7 +855,7 @@ do -- TASK_CARGO_TRANSPORT
|
|||||||
self:AddTransition( "*", "CargoPickedUp", "*" )
|
self:AddTransition( "*", "CargoPickedUp", "*" )
|
||||||
self:AddTransition( "*", "CargoDeployed", "*" )
|
self:AddTransition( "*", "CargoDeployed", "*" )
|
||||||
|
|
||||||
self:E( { CargoDeployed = self.CargoDeployed ~= nil and "true" or "false" } )
|
self:F( { CargoDeployed = self.CargoDeployed ~= nil and "true" or "false" } )
|
||||||
|
|
||||||
--- OnBefore Transition Handler for Event CargoPickedUp.
|
--- OnBefore Transition Handler for Event CargoPickedUp.
|
||||||
-- @function [parent=#TASK_CARGO_TRANSPORT] OnBeforeCargoPickedUp
|
-- @function [parent=#TASK_CARGO_TRANSPORT] OnBeforeCargoPickedUp
|
||||||
|
|||||||
@ -71,7 +71,6 @@ UTILS.IsInstanceOf = function( object, className )
|
|||||||
|
|
||||||
-- I'm not sure if this should take advantage of MOOSE logging function, or throw an error for pcall
|
-- I'm not sure if this should take advantage of MOOSE logging function, or throw an error for pcall
|
||||||
local err_str = 'className parameter should be a string; parameter received: '..type( className )
|
local err_str = 'className parameter should be a string; parameter received: '..type( className )
|
||||||
self:E( err_str )
|
|
||||||
return false
|
return false
|
||||||
-- error( err_str )
|
-- error( err_str )
|
||||||
|
|
||||||
|
|||||||
@ -143,7 +143,7 @@ function CLIENT:Register( ClientName )
|
|||||||
--self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 )
|
--self.AliveCheckScheduler = routines.scheduleFunction( self._AliveCheckScheduler, { self }, timer.getTime() + 1, 5 )
|
||||||
self.AliveCheckScheduler = SCHEDULER:New( self, self._AliveCheckScheduler, { "Client Alive " .. ClientName }, 1, 5 )
|
self.AliveCheckScheduler = SCHEDULER:New( self, self._AliveCheckScheduler, { "Client Alive " .. ClientName }, 1, 5 )
|
||||||
|
|
||||||
self:E( self )
|
self:F( self )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ function CLIENT:GetDCSGroup()
|
|||||||
self:T3( { "UnitData:", UnitData } )
|
self:T3( { "UnitData:", UnitData } )
|
||||||
if UnitData and UnitData:isExist() then
|
if UnitData and UnitData:isExist() then
|
||||||
|
|
||||||
--self:E(self.ClientName)
|
--self:F(self.ClientName)
|
||||||
if ClientUnit then
|
if ClientUnit then
|
||||||
local ClientGroup = ClientUnit:getGroup()
|
local ClientGroup = ClientUnit:getGroup()
|
||||||
if ClientGroup then
|
if ClientGroup then
|
||||||
@ -323,7 +323,7 @@ function CLIENT:GetDCSGroup()
|
|||||||
-- error( "Client " .. self.ClientName .. " not found!" )
|
-- error( "Client " .. self.ClientName .. " not found!" )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--self:E( { "Client not found!", self.ClientName } )
|
--self:F( { "Client not found!", self.ClientName } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -357,7 +357,7 @@ function CLIENT:GetClientGroupID()
|
|||||||
|
|
||||||
local ClientGroup = self:GetDCSGroup()
|
local ClientGroup = self:GetDCSGroup()
|
||||||
|
|
||||||
--self:E( self.ClientGroupID ) -- Determined in GetDCSGroup()
|
--self:F( self.ClientGroupID ) -- Determined in GetDCSGroup()
|
||||||
return self.ClientGroupID
|
return self.ClientGroupID
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1647,7 +1647,7 @@ do -- Patrol methods
|
|||||||
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( { PatrolGroup = PatrolGroup:GetName() } )
|
self:F( { PatrolGroup = PatrolGroup:GetName() } )
|
||||||
|
|
||||||
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
||||||
|
|
||||||
@ -1661,7 +1661,7 @@ do -- Patrol methods
|
|||||||
|
|
||||||
local TaskRoute = PatrolGroup:TaskFunction( "CONTROLLABLE.PatrolRoute" )
|
local TaskRoute = PatrolGroup:TaskFunction( "CONTROLLABLE.PatrolRoute" )
|
||||||
|
|
||||||
self:E({Waypoints = Waypoints})
|
self:F({Waypoints = Waypoints})
|
||||||
local Waypoint = Waypoints[#Waypoints]
|
local Waypoint = Waypoints[#Waypoints]
|
||||||
PatrolGroup:SetTaskWaypoint( Waypoint, TaskRoute ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone.
|
PatrolGroup:SetTaskWaypoint( Waypoint, TaskRoute ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone.
|
||||||
|
|
||||||
@ -1681,7 +1681,7 @@ do -- Patrol methods
|
|||||||
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( { PatrolGroup = PatrolGroup:GetName() } )
|
self:F( { PatrolGroup = PatrolGroup:GetName() } )
|
||||||
|
|
||||||
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
||||||
|
|
||||||
@ -1702,7 +1702,7 @@ do -- Patrol methods
|
|||||||
-- Select a random waypoint and check if it is not the same waypoint as where the object is about.
|
-- Select a random waypoint and check if it is not the same waypoint as where the object is about.
|
||||||
ToWaypoint = math.random( 1, #Waypoints )
|
ToWaypoint = math.random( 1, #Waypoints )
|
||||||
until( ToWaypoint ~= FromWaypoint )
|
until( ToWaypoint ~= FromWaypoint )
|
||||||
self:E( { FromWaypoint = FromWaypoint, ToWaypoint = ToWaypoint } )
|
self:F( { FromWaypoint = FromWaypoint, ToWaypoint = ToWaypoint } )
|
||||||
|
|
||||||
local Waypoint = Waypoints[ToWaypoint] -- Select random waypoint.
|
local Waypoint = Waypoints[ToWaypoint] -- Select random waypoint.
|
||||||
local ToCoord = COORDINATE:NewFromVec2( { x = Waypoint.x, y = Waypoint.y } )
|
local ToCoord = COORDINATE:NewFromVec2( { x = Waypoint.x, y = Waypoint.y } )
|
||||||
@ -1736,7 +1736,7 @@ do -- Patrol methods
|
|||||||
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( { PatrolGroup = PatrolGroup:GetName() } )
|
self:F( { PatrolGroup = PatrolGroup:GetName() } )
|
||||||
|
|
||||||
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
if PatrolGroup:IsGround() or PatrolGroup:IsShip() then
|
||||||
|
|
||||||
|
|||||||
@ -1063,13 +1063,13 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
--Template.x = nil
|
--Template.x = nil
|
||||||
--Template.y = nil
|
--Template.y = nil
|
||||||
|
|
||||||
self:E( #Template.units )
|
self:F( #Template.units )
|
||||||
if Reset == true then
|
if Reset == true then
|
||||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||||
local GroupUnit = UnitData -- Wrapper.Unit#UNIT
|
local GroupUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
self:E( GroupUnit:GetName() )
|
self:F( GroupUnit:GetName() )
|
||||||
if GroupUnit:IsAlive() then
|
if GroupUnit:IsAlive() then
|
||||||
self:E( "Alive" )
|
self:F( "Alive" )
|
||||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||||
if Zone then
|
if Zone then
|
||||||
if self.InitRespawnRandomizePositionZone then
|
if self.InitRespawnRandomizePositionZone then
|
||||||
@ -1087,12 +1087,12 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
||||||
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
||||||
Template.units[UnitID].heading = self.InitRespawnHeading and self.InitRespawnHeading or GroupUnit:GetHeading()
|
Template.units[UnitID].heading = self.InitRespawnHeading and self.InitRespawnHeading or GroupUnit:GetHeading()
|
||||||
self:E( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
self:F( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for UnitID, TemplateUnitData in pairs( Template.units ) do
|
for UnitID, TemplateUnitData in pairs( Template.units ) do
|
||||||
self:E( "Reset" )
|
self:F( "Reset" )
|
||||||
local GroupUnitVec3 = { x = TemplateUnitData.x, y = TemplateUnitData.alt, z = TemplateUnitData.z }
|
local GroupUnitVec3 = { x = TemplateUnitData.x, y = TemplateUnitData.alt, z = TemplateUnitData.z }
|
||||||
if Zone then
|
if Zone then
|
||||||
if self.InitRespawnRandomizePositionZone then
|
if self.InitRespawnRandomizePositionZone then
|
||||||
@ -1110,7 +1110,7 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
Template.units[UnitID].x = ( Template.units[UnitID].x - From.x ) + GroupUnitVec3.x -- Keep the original x position of the template and translate to the new position.
|
||||||
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
Template.units[UnitID].y = ( Template.units[UnitID].y - From.y ) + GroupUnitVec3.z -- Keep the original z position of the template and translate to the new position.
|
||||||
Template.units[UnitID].heading = self.InitRespawnHeading and self.InitRespawnHeading or TemplateUnitData.heading
|
Template.units[UnitID].heading = self.InitRespawnHeading and self.InitRespawnHeading or TemplateUnitData.heading
|
||||||
self:E( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
self:F( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1281,7 +1281,7 @@ do -- Route methods
|
|||||||
AirbaseAirPoint["airdromeId"] = RTBAirbase:GetID()
|
AirbaseAirPoint["airdromeId"] = RTBAirbase:GetID()
|
||||||
AirbaseAirPoint["speed_locked"] = true,
|
AirbaseAirPoint["speed_locked"] = true,
|
||||||
|
|
||||||
self:E(AirbaseAirPoint )
|
self:F(AirbaseAirPoint )
|
||||||
|
|
||||||
local Points = { PointFrom, AirbaseAirPoint }
|
local Points = { PointFrom, AirbaseAirPoint }
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ function IDENTIFIABLE:GetTypeName()
|
|||||||
return IdentifiableTypeName
|
return IdentifiableTypeName
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ function IDENTIFIABLE:GetCategoryName()
|
|||||||
return IdentifiableCategoryName
|
return IdentifiableCategoryName
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ function IDENTIFIABLE:GetCoalition()
|
|||||||
return IdentifiableCoalition
|
return IdentifiableCoalition
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ function IDENTIFIABLE:GetCoalitionName()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ function IDENTIFIABLE:GetCountry()
|
|||||||
return IdentifiableCountry
|
return IdentifiableCountry
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ function IDENTIFIABLE:GetDesc()
|
|||||||
return IdentifiableDesc
|
return IdentifiableDesc
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.IdentifiableName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -211,7 +211,7 @@ function POSITIONABLE:GetRandomVec3( Radius )
|
|||||||
self:T3( PositionableRandomVec3 )
|
self:T3( PositionableRandomVec3 )
|
||||||
return PositionableRandomVec3
|
return PositionableRandomVec3
|
||||||
else
|
else
|
||||||
self:E("Radius is nil, returning the PointVec3 of the POSITIONABLE", PositionablePointVec3)
|
self:F("Radius is nil, returning the PointVec3 of the POSITIONABLE", PositionablePointVec3)
|
||||||
return PositionablePointVec3
|
return PositionablePointVec3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -456,13 +456,12 @@ end
|
|||||||
-- @param #string Message The message text
|
-- @param #string Message The message text
|
||||||
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
||||||
-- @return #string The message text
|
-- @return #string The message text
|
||||||
function POSITIONABLE:GetMessageText( Message, Name ) --R2.1 added
|
function POSITIONABLE:GetMessageText( Message, Name )
|
||||||
|
|
||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
if DCSObject then
|
if DCSObject then
|
||||||
Name = Name and ( " (" .. Name .. ")" ) or ""
|
local Callsign = string.format( "%s", ( ( Name ~= "" and Name ) or self:GetCallsign() ~= "" and self:GetCallsign() ) or self:GetName() )
|
||||||
local Callsign = string.format( "%s", self:GetCallsign() ~= "" and self:GetCallsign() or self:GetName() )
|
local MessageText = string.format("%s - %s", Callsign, Message )
|
||||||
local MessageText = string.format("[%s%s]: %s", Callsign, Name, Message )
|
|
||||||
return MessageText
|
return MessageText
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -732,7 +731,7 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration ) --R2.1
|
|||||||
local RecceDcsUnit = self:GetDCSObject()
|
local RecceDcsUnit = self:GetDCSObject()
|
||||||
local TargetVec3 = Target:GetVec3()
|
local TargetVec3 = Target:GetVec3()
|
||||||
|
|
||||||
self:E("bulding spot")
|
self:F("bulding spot")
|
||||||
self.Spot = SPOT:New( self ) -- Core.Spot#SPOT
|
self.Spot = SPOT:New( self ) -- Core.Spot#SPOT
|
||||||
self.Spot:LaseOn( Target, LaserCode, Duration)
|
self.Spot:LaseOn( Target, LaserCode, Duration)
|
||||||
self.LaserCode = LaserCode
|
self.LaserCode = LaserCode
|
||||||
|
|||||||
@ -204,10 +204,10 @@ function UNIT:ReSpawn( SpawnVec3, Heading )
|
|||||||
SpawnGroupTemplate.x = SpawnVec3.x
|
SpawnGroupTemplate.x = SpawnVec3.x
|
||||||
SpawnGroupTemplate.y = SpawnVec3.z
|
SpawnGroupTemplate.y = SpawnVec3.z
|
||||||
|
|
||||||
self:E( #SpawnGroupTemplate.units )
|
self:F( #SpawnGroupTemplate.units )
|
||||||
for UnitID, UnitData in pairs( SpawnGroup:GetUnits() ) do
|
for UnitID, UnitData in pairs( SpawnGroup:GetUnits() ) do
|
||||||
local GroupUnit = UnitData -- #UNIT
|
local GroupUnit = UnitData -- #UNIT
|
||||||
self:E( GroupUnit:GetName() )
|
self:F( GroupUnit:GetName() )
|
||||||
if GroupUnit:IsAlive() then
|
if GroupUnit:IsAlive() then
|
||||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||||
local GroupUnitHeading = GroupUnit:GetHeading()
|
local GroupUnitHeading = GroupUnit:GetHeading()
|
||||||
@ -215,7 +215,7 @@ function UNIT:ReSpawn( SpawnVec3, Heading )
|
|||||||
SpawnGroupTemplate.units[UnitID].x = GroupUnitVec3.x
|
SpawnGroupTemplate.units[UnitID].x = GroupUnitVec3.x
|
||||||
SpawnGroupTemplate.units[UnitID].y = GroupUnitVec3.z
|
SpawnGroupTemplate.units[UnitID].y = GroupUnitVec3.z
|
||||||
SpawnGroupTemplate.units[UnitID].heading = GroupUnitHeading
|
SpawnGroupTemplate.units[UnitID].heading = GroupUnitHeading
|
||||||
self:E( { UnitID, SpawnGroupTemplate.units[UnitID], SpawnGroupTemplate.units[UnitID] } )
|
self:F( { UnitID, SpawnGroupTemplate.units[UnitID], SpawnGroupTemplate.units[UnitID] } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -228,9 +228,9 @@ function UNIT:ReSpawn( SpawnVec3, Heading )
|
|||||||
SpawnGroupTemplate.units[UnitTemplateID].x = SpawnVec3.x
|
SpawnGroupTemplate.units[UnitTemplateID].x = SpawnVec3.x
|
||||||
SpawnGroupTemplate.units[UnitTemplateID].y = SpawnVec3.z
|
SpawnGroupTemplate.units[UnitTemplateID].y = SpawnVec3.z
|
||||||
SpawnGroupTemplate.units[UnitTemplateID].heading = Heading
|
SpawnGroupTemplate.units[UnitTemplateID].heading = Heading
|
||||||
self:E( { UnitTemplateID, SpawnGroupTemplate.units[UnitTemplateID], SpawnGroupTemplate.units[UnitTemplateID] } )
|
self:F( { UnitTemplateID, SpawnGroupTemplate.units[UnitTemplateID], SpawnGroupTemplate.units[UnitTemplateID] } )
|
||||||
else
|
else
|
||||||
self:E( SpawnGroupTemplate.units[UnitTemplateID].name )
|
self:F( SpawnGroupTemplate.units[UnitTemplateID].name )
|
||||||
local GroupUnit = UNIT:FindByName( SpawnGroupTemplate.units[UnitTemplateID].name ) -- #UNIT
|
local GroupUnit = UNIT:FindByName( SpawnGroupTemplate.units[UnitTemplateID].name ) -- #UNIT
|
||||||
if GroupUnit and GroupUnit:IsAlive() then
|
if GroupUnit and GroupUnit:IsAlive() then
|
||||||
local GroupUnitVec3 = GroupUnit:GetVec3()
|
local GroupUnitVec3 = GroupUnit:GetVec3()
|
||||||
@ -322,7 +322,7 @@ function UNIT:GetCallsign()
|
|||||||
return UnitCallSign
|
return UnitCallSign
|
||||||
end
|
end
|
||||||
|
|
||||||
self:E( self.ClassName .. " " .. self.UnitName .. " not found!" )
|
self:F( self.ClassName .. " " .. self.UnitName .. " not found!" )
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -875,7 +875,7 @@ function UNIT:IsFriendly( FriendlyCoalition )
|
|||||||
|
|
||||||
local IsFriendlyResult = ( UnitCoalition == FriendlyCoalition )
|
local IsFriendlyResult = ( UnitCoalition == FriendlyCoalition )
|
||||||
|
|
||||||
self:E( IsFriendlyResult )
|
self:F( IsFriendlyResult )
|
||||||
return IsFriendlyResult
|
return IsFriendlyResult
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user