mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Tracify comments
This commit is contained in:
parent
9d100e9bc1
commit
7c2c6daf3e
@ -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,7 +2957,7 @@ 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
|
||||||
@ -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 = {}
|
||||||
|
|
||||||
@ -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 )
|
||||||
|
|||||||
@ -516,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
|
||||||
@ -526,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
|
||||||
@ -539,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
|
||||||
|
|
||||||
@ -673,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
|
||||||
@ -800,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
|
||||||
|
|
||||||
@ -1001,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
|
||||||
|
|
||||||
@ -1022,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
|
||||||
|
|
||||||
@ -1114,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
|
||||||
@ -1137,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
|
||||||
@ -1890,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
|
||||||
@ -2138,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
|
||||||
@ -2589,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
|
||||||
@ -2667,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
|
||||||
|
|||||||
@ -850,7 +850,7 @@ end
|
|||||||
function ESCORT:_AttackTarget( DetectedItem )
|
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
|
||||||
|
|
||||||
@ -1152,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
|
||||||
|
|
||||||
@ -1164,7 +1164,7 @@ function ESCORT:_ReportTargetsScheduler()
|
|||||||
--local EscortUnit = EscortGroupData:GetUnit( 1 )
|
--local EscortUnit = EscortGroupData:GetUnit( 1 )
|
||||||
|
|
||||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||||
self:E( { DetectedItemIndex, 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( DetectedItem, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItem, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
||||||
@ -1205,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
|
||||||
@ -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
|
||||||
@ -817,12 +817,12 @@ 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
|
||||||
@ -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 )
|
||||||
@ -423,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()
|
||||||
|
|
||||||
@ -443,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()
|
||||||
|
|
||||||
@ -461,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
|
||||||
|
|||||||
@ -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
|
||||||
@ -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
|
||||||
@ -1384,7 +1384,7 @@ do -- Links
|
|||||||
-- @return #TASK
|
-- @return #TASK
|
||||||
function TASK:SetDetection( Detection, DetectedItem )
|
function TASK:SetDetection( Detection, DetectedItem )
|
||||||
|
|
||||||
self:E( { DetectedItem, Detection } )
|
self:F( { DetectedItem, Detection } )
|
||||||
|
|
||||||
self.Detection = Detection
|
self.Detection = Detection
|
||||||
self.DetectedItem = DetectedItem
|
self.DetectedItem = DetectedItem
|
||||||
|
|||||||
@ -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 )
|
||||||
|
|||||||
@ -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 = {}
|
||||||
@ -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
|
||||||
@ -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
|
||||||
|
|||||||
@ -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 )
|
||||||
|
|||||||
@ -573,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
|
||||||
@ -587,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 = {}
|
||||||
@ -620,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
|
||||||
|
|
||||||
@ -764,7 +764,7 @@ do -- TASK_A2G_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
|
||||||
|
|
||||||
|
|||||||
@ -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() )
|
||||||
|
|
||||||
@ -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
|
||||||
@ -731,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