Merge pull request #573 from FlightControl-Master/562-AI-A2A-Dispatcher

562 ai a2a dispatcher
This commit is contained in:
Sven Van de Velde 2017-06-13 13:18:30 +02:00 committed by GitHub
commit 922b61b9fe
109 changed files with 15469 additions and 111 deletions

View File

@ -0,0 +1,547 @@
--- **AI** -- **AI A2A Air Patrolling or Staging.**
--
-- ====
--
-- ### Author: **Sven Van de Velde (FlightControl)**
-- ### Contributions:
--
-- * **[Dutch_Baron](https://forums.eagle.ru/member.php?u=112075)**: Working together with James has resulted in the creation of the AI_BALANCER class. James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Testing and API concept review.
--
-- ====
--
-- @module AI_A2A
--BASE:TraceClass("AI_A2A")
--- @type AI_A2A
-- @extends Core.Fsm#FSM_CONTROLLABLE
--- # AI_A2A class, extends @{Fsm#FSM_CONTROLLABLE}
--
-- The AI_A2A class implements the core functions to operate an AI @{Group} A2A tasking.
--
--
-- ## AI_A2A constructor
--
-- * @{#AI_A2A.New}(): Creates a new AI_A2A object.
--
-- ## 2. AI_A2A is a FSM
--
-- ![Process](..\Presentations\AI_PATROL\Dia2.JPG)
--
-- ### 2.1. AI_A2A States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Returning** ( Group ): The AI is returning to Base.
-- * **Stopped** ( Group ): The process is stopped.
-- * **Crashed** ( Group ): The AI has crashed or is dead.
--
-- ### 2.2. AI_A2A Events
--
-- * **Start** ( Group ): Start the process.
-- * **Stop** ( Group ): Stop the process.
-- * **Route** ( Group ): Route the AI to a new random 3D point within the Patrol Zone.
-- * **RTB** ( Group ): Route the AI to the home base.
-- * **Detect** ( Group ): The AI is detecting targets.
-- * **Detected** ( Group ): The AI has detected new targets.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 3. Set or Get the AI controllable
--
-- * @{#AI_A2A.SetControllable}(): Set the AIControllable.
-- * @{#AI_A2A.GetControllable}(): Get the AIControllable.
--
-- @field #AI_A2A
AI_A2A = {
ClassName = "AI_A2A",
}
--- Creates a new AI_A2A object
-- @param #AI_A2A self
-- @param Wrapper.Group#GROUP AIGroup The GROUP object to receive the A2A Process.
-- @return #AI_A2A
function AI_A2A:New( AIGroup )
-- Inherits from BASE
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New() ) -- #AI_A2A
self:SetControllable( AIGroup )
self:ManageFuel( .2, 60 )
self:ManageDamage( 0.4 )
self:SetStartState( "Stopped" )
self:AddTransition( "*", "Start", "Started" )
--- Start Handler OnBefore for AI_A2A
-- @function [parent=#AI_A2A] OnBeforeStart
-- @param #AI_A2A self
-- @param #string From
-- @param #string Event
-- @param #string To
-- @return #boolean
--- Start Handler OnAfter for AI_A2A
-- @function [parent=#AI_A2A] OnAfterStart
-- @param #AI_A2A self
-- @param #string From
-- @param #string Event
-- @param #string To
--- Start Trigger for AI_A2A
-- @function [parent=#AI_A2A] Start
-- @param #AI_A2A self
--- Start Asynchronous Trigger for AI_A2A
-- @function [parent=#AI_A2A] __Start
-- @param #AI_A2A self
-- @param #number Delay
self:AddTransition( "*", "Stop", "Stopped" )
--- OnLeave Transition Handler for State Stopped.
-- @function [parent=#AI_A2A] OnLeaveStopped
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Stopped.
-- @function [parent=#AI_A2A] OnEnterStopped
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- OnBefore Transition Handler for Event Stop.
-- @function [parent=#AI_A2A] OnBeforeStop
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Stop.
-- @function [parent=#AI_A2A] OnAfterStop
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Stop.
-- @function [parent=#AI_A2A] Stop
-- @param #AI_A2A self
--- Asynchronous Event Trigger for Event Stop.
-- @function [parent=#AI_A2A] __Stop
-- @param #AI_A2A self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Status", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A.
--- OnBefore Transition Handler for Event Status.
-- @function [parent=#AI_A2A] OnBeforeStatus
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Status.
-- @function [parent=#AI_A2A] OnAfterStatus
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Status.
-- @function [parent=#AI_A2A] Status
-- @param #AI_A2A self
--- Asynchronous Event Trigger for Event Status.
-- @function [parent=#AI_A2A] __Status
-- @param #AI_A2A self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "RTB", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A.
--- OnBefore Transition Handler for Event RTB.
-- @function [parent=#AI_A2A] OnBeforeRTB
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event RTB.
-- @function [parent=#AI_A2A] OnAfterRTB
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event RTB.
-- @function [parent=#AI_A2A] RTB
-- @param #AI_A2A self
--- Asynchronous Event Trigger for Event RTB.
-- @function [parent=#AI_A2A] __RTB
-- @param #AI_A2A self
-- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Returning.
-- @function [parent=#AI_A2A] OnLeaveReturning
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Returning.
-- @function [parent=#AI_A2A] OnEnterReturning
-- @param #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
self:AddTransition( "*", "Return", "Returning" )
self:AddTransition( "*", "Home", "Home" )
self:AddTransition( "*", "LostControl", "LostControl" )
self:AddTransition( "*", "Fuel", "Fuel" )
self:AddTransition( "*", "Damaged", "Damaged" )
self:AddTransition( "*", "Eject", "*" )
self:AddTransition( "*", "Crash", "Crashed" )
self:AddTransition( "*", "PilotDead", "*" )
return self
end
function AI_A2A:SetDispatcher( Dispatcher )
self.Dispatcher = Dispatcher
end
function AI_A2A:GetDispatcher()
return self.Dispatcher
end
function AI_A2A:SetTargetDistance( Coordinate )
local CurrentCoord = self.Controllable:GetCoordinate()
self.TargetDistance = CurrentCoord:Get2DDistance( Coordinate )
self.ClosestTargetDistance = ( not self.ClosestTargetDistance or self.ClosestTargetDistance > self.TargetDistance ) and self.TargetDistance or self.ClosestTargetDistance
end
function AI_A2A:ClearTargetDistance()
self.TargetDistance = nil
self.ClosestTargetDistance = nil
end
--- Sets (modifies) the minimum and maximum speed of the patrol.
-- @param #AI_A2A self
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @return #AI_A2A self
function AI_A2A:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
self.PatrolMinSpeed = PatrolMinSpeed
self.PatrolMaxSpeed = PatrolMaxSpeed
end
--- Sets the floor and ceiling altitude of the patrol.
-- @param #AI_A2A self
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @return #AI_A2A self
function AI_A2A:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
self.PatrolFloorAltitude = PatrolFloorAltitude
self.PatrolCeilingAltitude = PatrolCeilingAltitude
end
--- Sets the home airbase.
-- @param #AI_A2A self
-- @param Wrapper.Airbase#AIRBASE HomeAirbase
-- @return #AI_A2A self
function AI_A2A:SetHomeAirbase( HomeAirbase )
self:F2( { HomeAirbase } )
self.HomeAirbase = HomeAirbase
end
--- Set the status checking off.
-- @param #AI_A2A self
-- @return #AI_A2A self
function AI_A2A:SetStatusOff()
self:F2()
self.CheckStatus = false
end
--- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
-- When the fuel treshold is reached, the AI will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the AI_A2A.
-- Once the time is finished, the old AI will return to the base.
-- @param #AI_A2A self
-- @param #number PatrolFuelTresholdPercentage The treshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.
-- @param #number PatrolOutOfFuelOrbitTime The amount of seconds the out of fuel AIControllable will orbit before returning to the base.
-- @return #AI_A2A self
function AI_A2A:ManageFuel( PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime )
self.PatrolManageFuel = true
self.PatrolFuelTresholdPercentage = PatrolFuelTresholdPercentage
self.PatrolOutOfFuelOrbitTime = PatrolOutOfFuelOrbitTime
self.Controllable:OptionRTBBingoFuel( false )
return self
end
--- When the AI is damaged beyond a certain treshold, it is required that the AI returns to the home base.
-- However, damage cannot be foreseen early on.
-- Therefore, when the damage treshold is reached,
-- the AI will return immediately to the home base (RTB).
-- Note that for groups, the average damage of the complete group will be calculated.
-- So, in a group of 4 airplanes, 2 lost and 2 with damage 0.2, the damage treshold will be 0.25.
-- @param #AI_A2A self
-- @param #number PatrolDamageTreshold The treshold in percentage (between 0 and 1) when the AI is considered to be damaged.
-- @return #AI_A2A self
function AI_A2A:ManageDamage( PatrolDamageTreshold )
self.PatrolManageDamage = true
self.PatrolDamageTreshold = PatrolDamageTreshold
return self
end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings.
-- @param #AI_A2A self
-- @return #AI_A2A self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A:onafterStart( Controllable, From, Event, To )
self:F2()
self:__Status( 10 ) -- Check status status every 30 seconds.
self:HandleEvent( EVENTS.PilotDead, self.OnPilotDead )
self:HandleEvent( EVENTS.Crash, self.OnCrash )
self:HandleEvent( EVENTS.Ejection, self.OnEjection )
Controllable:OptionROEHoldFire()
Controllable:OptionROTVertical()
end
--- @param #AI_A2A self
function AI_A2A:onbeforeStatus()
return self.CheckStatus
end
--- @param #AI_A2A self
function AI_A2A:onafterStatus()
self:F()
if self.Controllable and self.Controllable:IsAlive() then
local RTB = false
local Fuel = self.Controllable:GetUnit(1):GetFuel()
self:F({Fuel=Fuel})
if Fuel < self.PatrolFuelTresholdPercentage then
self:E( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" )
local OldAIControllable = self.Controllable
local AIControllableTemplate = self.Controllable:GetTemplate()
local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
local TimedOrbitTask = OldAIControllable:TaskControlled( OrbitTask, OldAIControllable:TaskCondition(nil,nil,nil,nil,self.PatrolOutOfFuelOrbitTime,nil ) )
OldAIControllable:SetTask( TimedOrbitTask, 10 )
self:Fuel()
RTB = true
else
end
-- TODO: Check GROUP damage function.
local Damage = self.Controllable:GetLife()
local InitialLife = self.Controllable:GetLife0()
self:F( { Damage = Damage, InitialLife = InitialLife, DamageTreshold = self.PatrolDamageTreshold } )
if ( Damage / InitialLife ) < self.PatrolDamageTreshold then
self:E( self.Controllable:GetName() .. " is damaged: " .. Damage .. " ... RTB!" )
self:Damaged()
RTB = true
end
-- Check if planes went RTB
local TargetDistance = self.TargetDistance
local ClosestTargetDistance = self.ClosestTargetDistance
if TargetDistance then
if ClosestTargetDistance <= 40000 then
if TargetDistance > 40000 then
self:E( "Lost control of group " .. self.Controllable:GetName() .. " ... RTB!" )
self:LostControl()
RTB = true
end
end
end
if RTB == true then
self:__RTB( 0.5 )
else
self:__Status( 10 ) -- Execute the Patrol event after 30 seconds.
end
end
end
--- @param Wrapper.Group#GROUP AIGroup
function AI_A2A.RTBRoute( AIGroup )
AIGroup:E( { "RTBRoute:", AIGroup:GetName() } )
local _AI_A2A = AIGroup:GetState( AIGroup, "AI_A2A" ) -- #AI_A2A
_AI_A2A:__RTB( 0.5 )
end
--- @param #AI_A2A self
-- @param Wrapper.Group#GROUP AIGroup
function AI_A2A:onafterRTB( AIGroup, From, Event, To )
self:F( { AIGroup, From, Event, To } )
self:E( "Group " .. self.Controllable:GetName() .. " ... RTB! ( " .. self:GetState() .. " )" )
if AIGroup and AIGroup:IsAlive() then
self.CheckStatus = false
self:ClearTargetDistance()
AIGroup:ClearTasks()
AIGroup:ClearTasks()
local EngageRoute = {}
--- Calculate the target route point.
local CurrentCoord = AIGroup:GetCoordinate()
local ToTargetCoord = self.HomeAirbase:GetCoordinate()
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
local ToAirbaseAngle = CurrentCoord:GetAngleDegrees( CurrentCoord:GetDirectionVec3( ToTargetCoord ) )
local Distance = CurrentCoord:Get2DDistance( ToTargetCoord )
local ToAirbaseCoord = CurrentCoord:Translate( 5000, ToAirbaseAngle )
if Distance < 5000 then
self:Home()
return
end
--- Create a route point of type air.
local ToPatrolRoutePoint = ToAirbaseCoord:RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed,
true
)
self:F( { Angle = ToAirbaseAngle, ToTargetSpeed = ToTargetSpeed } )
self:T2( { self.MinSpeed, self.MaxSpeed, ToTargetSpeed } )
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
AIGroup:OptionROEHoldFire()
AIGroup:OptionROTEvadeFire()
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
AIGroup:WayPointInitialize( EngageRoute )
local Tasks = {}
Tasks[#Tasks+1] = AIGroup:TaskFunction( 1, 1, "AI_A2A.RTBRoute" )
EngageRoute[1].task = AIGroup:TaskCombo( Tasks )
AIGroup:SetState( AIGroup, "AI_A2A", self )
--- NOW ROUTE THE GROUP!
AIGroup:WayPointExecute( 1, 0 )
end
end
--- @param #AI_A2A self
-- @param Wrapper.Group#GROUP AIGroup
function AI_A2A:onafterHome( AIGroup, From, Event, To )
self:F( { AIGroup, From, Event, To } )
self:E( "Group " .. self.Controllable:GetName() .. " ... Home! ( " .. self:GetState() .. " )" )
if AIGroup and AIGroup:IsAlive() then
end
end
--- @param #AI_A2A self
function AI_A2A:onafterDead()
self:SetStatusOff()
end
--- @param #AI_A2A self
-- @param Core.Event#EVENTDATA EventData
function AI_A2A:OnCrash( EventData )
if self.Controllable:IsAlive() and EventData.IniDCSGroupName == self.Controllable:GetName() then
self:E( self.Controllable:GetUnits() )
if #self.Controllable:GetUnits() == 1 then
self:__Crash( 1, EventData )
end
end
end
--- @param #AI_A2A self
-- @param Core.Event#EVENTDATA EventData
function AI_A2A:OnEjection( EventData )
if self.Controllable:IsAlive() and EventData.IniDCSGroupName == self.Controllable:GetName() then
self:__Eject( 1, EventData )
end
end
--- @param #AI_A2A self
-- @param Core.Event#EVENTDATA EventData
function AI_A2A:OnPilotDead( EventData )
if self.Controllable:IsAlive() and EventData.IniDCSGroupName == self.Controllable:GetName() then
self:__PilotDead( 1, EventData )
end
end

View File

@ -0,0 +1,491 @@
--- **AI** -- **Execute Combat Air Patrol (CAP).**
--
-- ![Banner Image](..\Presentations\AI_CAP\Dia1.JPG)
--
-- ===
--
-- AI CAP classes makes AI Controllables execute a Combat Air Patrol.
--
-- There are the following types of CAP classes defined:
--
-- * @{#AI_A2A_CAP}: Perform a CAP in a zone.
--
-- ====
--
-- ### Author: **Sven Van de Velde (FlightControl)**
--
-- ### Contributions:
--
-- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing.
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing.
-- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision.
-- * **[Whisper](http://forums.eagle.ru/member.php?u=3829): Testing.
-- * **[Delta99](https://forums.eagle.ru/member.php?u=125166): Testing.
--
-- ====
--
-- @module AI_A2A_Cap
--BASE:TraceClass("AI_A2A_CAP")
--- @type AI_A2A_CAP
-- @extends AI.AI_A2A_Patrol#AI_A2A_PATROL
--- # AI_A2A_CAP class, extends @{AI_CAP#AI_PATROL_ZONE}
--
-- The AI_A2A_CAP class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
--
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
--
-- The AI_A2A_CAP is assigned a @{Group} and this must be done before the AI_A2A_CAP process can be started using the **Start** event.
--
-- ![Process](..\Presentations\AI_CAP\Dia4.JPG)
--
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
--
-- ![Process](..\Presentations\AI_CAP\Dia5.JPG)
--
-- This cycle will continue.
--
-- ![Process](..\Presentations\AI_CAP\Dia6.JPG)
--
-- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event.
--
-- ![Process](..\Presentations\AI_CAP\Dia9.JPG)
--
-- When enemies are detected, the AI will automatically engage the enemy.
--
-- ![Process](..\Presentations\AI_CAP\Dia10.JPG)
--
-- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
--
-- ![Process](..\Presentations\AI_CAP\Dia13.JPG)
--
-- ## 1. AI_A2A_CAP constructor
--
-- * @{#AI_A2A_CAP.New}(): Creates a new AI_A2A_CAP object.
--
-- ## 2. AI_A2A_CAP is a FSM
--
-- ![Process](..\Presentations\AI_CAP\Dia2.JPG)
--
-- ### 2.1 AI_A2A_CAP States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Engaging** ( Group ): The AI is engaging the bogeys.
-- * **Returning** ( Group ): The AI is returning to Base..
--
-- ### 2.2 AI_A2A_CAP Events
--
-- * **@{AI_Patrol#AI_PATROL_ZONE.Start}**: Start the process.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Route}**: Route the AI to a new random 3D point within the Patrol Zone.
-- * **@{#AI_A2A_CAP.Engage}**: Let the AI engage the bogeys.
-- * **@{#AI_A2A_CAP.Abort}**: Aborts the engagement and return patrolling in the patrol zone.
-- * **@{AI_Patrol#AI_PATROL_ZONE.RTB}**: Route the AI to the home base.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detect}**: The AI is detecting targets.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detected}**: The AI has detected new targets.
-- * **@{#AI_A2A_CAP.Destroy}**: The AI has destroyed a bogey @{Unit}.
-- * **@{#AI_A2A_CAP.Destroyed}**: The AI has destroyed all bogeys @{Unit}s assigned in the CAS task.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 3. Set the Range of Engagement
--
-- ![Range](..\Presentations\AI_CAP\Dia11.JPG)
--
-- An optional range can be set in meters,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- The range can be beyond or smaller than the range of the Patrol Zone.
-- The range is applied at the position of the AI.
-- Use the method @{AI_CAP#AI_A2A_CAP.SetEngageRange}() to define that range.
--
-- ## 4. Set the Zone of Engagement
--
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
--
-- An optional @{Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI_Cap#AI_A2A_CAP.SetEngageZone}() to define that Zone.
--
-- ===
--
-- @field #AI_A2A_CAP
AI_A2A_CAP = {
ClassName = "AI_A2A_CAP",
}
--- Creates a new AI_A2A_CAP object
-- @param #AI_A2A_CAP self
-- @param Wrapper.Group#GROUP AIGroup
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed EngageMinSpeed The minimum speed of the @{Controllable} in km/h when engaging a target.
-- @param Dcs.DCSTypes#Speed EngageMaxSpeed The maximum speed of the @{Controllable} in km/h when engaging a target.
-- @param Dcs.DCSTypes#AltitudeType PatrolAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO
-- @return #AI_A2A_CAP
function AI_A2A_CAP:New( AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageMinSpeed, EngageMaxSpeed, PatrolAltType )
-- Inherits from BASE
local self = BASE:Inherit( self, AI_A2A_PATROL:New( AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType ) ) -- #AI_A2A_CAP
self.Accomplished = false
self.Engaging = false
self.EngageMinSpeed = EngageMinSpeed
self.EngageMaxSpeed = EngageMaxSpeed
self:AddTransition( { "Patrolling", "Engaging", "Returning" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_CAP.
--- OnBefore Transition Handler for Event Engage.
-- @function [parent=#AI_A2A_CAP] OnBeforeEngage
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Engage.
-- @function [parent=#AI_A2A_CAP] OnAfterEngage
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Engage.
-- @function [parent=#AI_A2A_CAP] Engage
-- @param #AI_A2A_CAP self
--- Asynchronous Event Trigger for Event Engage.
-- @function [parent=#AI_A2A_CAP] __Engage
-- @param #AI_A2A_CAP self
-- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Engaging.
-- @function [parent=#AI_A2A_CAP] OnLeaveEngaging
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Engaging.
-- @function [parent=#AI_A2A_CAP] OnEnterEngaging
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_CAP.
--- OnBefore Transition Handler for Event Fired.
-- @function [parent=#AI_A2A_CAP] OnBeforeFired
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Fired.
-- @function [parent=#AI_A2A_CAP] OnAfterFired
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Fired.
-- @function [parent=#AI_A2A_CAP] Fired
-- @param #AI_A2A_CAP self
--- Asynchronous Event Trigger for Event Fired.
-- @function [parent=#AI_A2A_CAP] __Fired
-- @param #AI_A2A_CAP self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Destroy", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_CAP.
--- OnBefore Transition Handler for Event Destroy.
-- @function [parent=#AI_A2A_CAP] OnBeforeDestroy
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Destroy.
-- @function [parent=#AI_A2A_CAP] OnAfterDestroy
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_A2A_CAP] Destroy
-- @param #AI_A2A_CAP self
--- Asynchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_A2A_CAP] __Destroy
-- @param #AI_A2A_CAP self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_CAP.
--- OnBefore Transition Handler for Event Abort.
-- @function [parent=#AI_A2A_CAP] OnBeforeAbort
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Abort.
-- @function [parent=#AI_A2A_CAP] OnAfterAbort
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Abort.
-- @function [parent=#AI_A2A_CAP] Abort
-- @param #AI_A2A_CAP self
--- Asynchronous Event Trigger for Event Abort.
-- @function [parent=#AI_A2A_CAP] __Abort
-- @param #AI_A2A_CAP self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_CAP.
--- OnBefore Transition Handler for Event Accomplish.
-- @function [parent=#AI_A2A_CAP] OnBeforeAccomplish
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Accomplish.
-- @function [parent=#AI_A2A_CAP] OnAfterAccomplish
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_A2A_CAP] Accomplish
-- @param #AI_A2A_CAP self
--- Asynchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_A2A_CAP] __Accomplish
-- @param #AI_A2A_CAP self
-- @param #number Delay The delay in seconds.
return self
end
--- Set the Engage Zone which defines where the AI will engage bogies.
-- @param #AI_A2A_CAP self
-- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAP.
-- @return #AI_A2A_CAP self
function AI_A2A_CAP:SetEngageZone( EngageZone )
self:F2()
if EngageZone then
self.EngageZone = EngageZone
else
self.EngageZone = nil
end
end
--- Set the Engage Range when the AI will engage with airborne enemies.
-- @param #AI_A2A_CAP self
-- @param #number EngageRange The Engage Range.
-- @return #AI_A2A_CAP self
function AI_A2A_CAP:SetEngageRange( EngageRange )
self:F2()
if EngageRange then
self.EngageRange = EngageRange
else
self.EngageRange = nil
end
end
--- onafter State Transition for Event Patrol.
-- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE AIGroup The AI Group managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_CAP:onafterPatrol( AIGroup, From, Event, To )
-- Call the parent Start event handler
self:GetParent(self).onafterPatrol( self, AIGroup, From, Event, To )
self:HandleEvent( EVENTS.Dead )
end
-- todo: need to fix this global function
--- @param Wrapper.Group#GROUP AIGroup
function AI_A2A_CAP.AttackRoute( AIGroup )
local EngageZone = AIGroup:GetState( AIGroup, "AI_A2A_CAP" ) -- AI.AI_Cap#AI_A2A_CAP
EngageZone:__Engage( 0.5 )
end
--- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE AIGroup The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_CAP:onbeforeEngage( AIGroup, From, Event, To )
if self.Accomplished == true then
return false
end
end
--- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE AIGroup The AI Group managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_CAP:onafterAbort( AIGroup, From, Event, To )
AIGroup:ClearTasks()
self:__Route( 0.5 )
end
--- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE AIGroup The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_CAP:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
self:F( { AIGroup, From, Event, To, AttackSetUnit} )
self.AttackSetUnit = AttackSetUnit or self.AttackSetUnit -- Core.Set#SET_UNIT
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
if FirstAttackUnit then
if AIGroup:IsAlive() then
local EngageRoute = {}
--- Calculate the target route point.
local CurrentCoord = AIGroup:GetCoordinate()
local ToTargetCoord = self.AttackSetUnit:GetFirst():GetCoordinate()
local ToTargetSpeed = math.random( self.EngageMinSpeed, self.EngageMaxSpeed )
local ToInterceptAngle = CurrentCoord:GetAngleDegrees( CurrentCoord:GetDirectionVec3( ToTargetCoord ) )
--- Create a route point of type air.
local ToPatrolRoutePoint = CurrentCoord:Translate( 5000, ToInterceptAngle ):RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed,
true
)
self:F( { Angle = ToInterceptAngle, ToTargetSpeed = ToTargetSpeed } )
self:T2( { self.MinSpeed, self.MaxSpeed, ToTargetSpeed } )
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
AIGroup:OptionROEOpenFire()
AIGroup:OptionROTPassiveDefense()
local AttackTasks = {}
for AttackUnitID, AttackUnit in pairs( self.AttackSetUnit:GetSet() ) do
local AttackUnit = AttackUnit -- Wrapper.Unit#UNIT
self:T( { "Attacking Unit:", AttackUnit:GetName(), AttackUnit:IsAlive(), AttackUnit:IsAir() } )
if AttackUnit:IsAlive() and AttackUnit:IsAir() then
AttackTasks[#AttackTasks+1] = AIGroup:TaskAttackUnit( AttackUnit )
end
end
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
self.Controllable:WayPointInitialize( EngageRoute )
if #AttackTasks == 0 then
self:E("No targets found -> Going back to Patrolling")
self:__Abort( 0.5 )
else
AttackTasks[#AttackTasks+1] = AIGroup:TaskFunction( 1, #AttackTasks, "AI_A2A_CAP.AttackRoute" )
AttackTasks[#AttackTasks+1] = AIGroup:TaskOrbitCircle( 4000, self.PatrolMinSpeed )
EngageRoute[1].task = AIGroup:TaskCombo( AttackTasks )
--- Do a trick, link the NewEngageRoute function of the object to the AIControllable in a temporary variable ...
AIGroup:SetState( AIGroup, "AI_A2A_CAP", self )
end
--- NOW ROUTE THE GROUP!
AIGroup:WayPointExecute( 1, 0 )
end
else
self:E("No targets found -> Going back to Patrolling")
self:__Abort( 0.5 )
end
end
--- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_CAP:onafterAccomplish( Controllable, From, Event, To )
self.Accomplished = true
self:SetDetectionOff()
end
--- @param #AI_A2A_CAP self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Core.Event#EVENTDATA EventData
function AI_A2A_CAP:onafterDestroy( Controllable, From, Event, To, EventData )
if EventData.IniUnit then
self.AttackUnits[EventData.IniUnit] = nil
end
end
--- @param #AI_A2A_CAP self
-- @param Core.Event#EVENTDATA EventData
function AI_A2A_CAP:OnEventDead( EventData )
self:F( { "EventDead", EventData } )
if EventData.IniDCSUnit then
if self.AttackUnits and self.AttackUnits[EventData.IniUnit] then
self:__Destroy( 1, EventData )
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,462 @@
--- **AI** -- **Execute Ground Controlled Interception (GCI).**
--
-- ![Banner Image](..\Presentations\AI_GCI\Dia1.JPG)
--
-- ===
--
-- AI A2A_INTEREPT class makes AI Groups execute an Intercept.
--
-- There are the following types of GCI classes defined:
--
-- * @{#AI_A2A_GCI}: Perform a GCI in a zone.
--
-- ====
--
-- ### Author: **Sven Van de Velde (FlightControl)**
--
-- ### Contributions:
--
-- ====
--
-- @module AI_A2A_GCI
--BASE:TraceClass("AI_A2A_GCI")
--- @type AI_A2A_GCI
-- @extends AI.AI_A2A#AI_A2A
--- # AI_A2A_GCI class, extends @{AI_A2A#AI_A2A}
--
-- The AI_A2A_GCI class implements the core functions to intercept intruders. The Engage function will intercept intruders.
--
-- ![Process](..\Presentations\AI_GCI\Dia3.JPG)
--
-- The AI_A2A_GCI is assigned a @{Group} and this must be done before the AI_A2A_GCI process can be started using the **Start** event.
--
-- ![Process](..\Presentations\AI_GCI\Dia4.JPG)
--
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
--
-- ![Process](..\Presentations\AI_GCI\Dia5.JPG)
--
-- This cycle will continue.
--
-- ![Process](..\Presentations\AI_GCI\Dia6.JPG)
--
-- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event.
--
-- ![Process](..\Presentations\AI_GCI\Dia9.JPG)
--
-- When enemies are detected, the AI will automatically engage the enemy.
--
-- ![Process](..\Presentations\AI_GCI\Dia10.JPG)
--
-- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
--
-- ![Process](..\Presentations\AI_GCI\Dia13.JPG)
--
-- ## 1. AI_A2A_GCI constructor
--
-- * @{#AI_A2A_GCI.New}(): Creates a new AI_A2A_GCI object.
--
-- ## 2. AI_A2A_GCI is a FSM
--
-- ![Process](..\Presentations\AI_GCI\Dia2.JPG)
--
-- ### 2.1 AI_A2A_GCI States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Engaging** ( Group ): The AI is engaging the bogeys.
-- * **Returning** ( Group ): The AI is returning to Base..
--
-- ### 2.2 AI_A2A_GCI Events
--
-- * **@{AI_Patrol#AI_PATROL_ZONE.Start}**: Start the process.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Route}**: Route the AI to a new random 3D point within the Patrol Zone.
-- * **@{#AI_A2A_GCI.Engage}**: Let the AI engage the bogeys.
-- * **@{#AI_A2A_GCI.Abort}**: Aborts the engagement and return patrolling in the patrol zone.
-- * **@{AI_Patrol#AI_PATROL_ZONE.RTB}**: Route the AI to the home base.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detect}**: The AI is detecting targets.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detected}**: The AI has detected new targets.
-- * **@{#AI_A2A_GCI.Destroy}**: The AI has destroyed a bogey @{Unit}.
-- * **@{#AI_A2A_GCI.Destroyed}**: The AI has destroyed all bogeys @{Unit}s assigned in the CAS task.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 3. Set the Range of Engagement
--
-- ![Range](..\Presentations\AI_GCI\Dia11.JPG)
--
-- An optional range can be set in meters,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- The range can be beyond or smaller than the range of the Patrol Zone.
-- The range is applied at the position of the AI.
-- Use the method @{AI_GCI#AI_A2A_GCI.SetEngageRange}() to define that range.
--
-- ## 4. Set the Zone of Engagement
--
-- ![Zone](..\Presentations\AI_GCI\Dia12.JPG)
--
-- An optional @{Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI_Cap#AI_A2A_GCI.SetEngageZone}() to define that Zone.
--
-- ===
--
-- @field #AI_A2A_GCI
AI_A2A_GCI = {
ClassName = "AI_A2A_GCI",
}
--- Creates a new AI_A2A_GCI object
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup
-- @return #AI_A2A_GCI
function AI_A2A_GCI:New( AIGroup, EngageMinSpeed, EngageMaxSpeed )
-- Inherits from BASE
local self = BASE:Inherit( self, AI_A2A:New( AIGroup ) ) -- #AI_A2A_GCI
self.Accomplished = false
self.Engaging = false
self.EngageMinSpeed = EngageMinSpeed
self.EngageMaxSpeed = EngageMaxSpeed
self.PatrolMinSpeed = EngageMinSpeed
self.PatrolMaxSpeed = EngageMaxSpeed
self.PatrolAltType = "RADIO"
self:AddTransition( { "Started", "Engaging", "Returning" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_GCI.
--- OnBefore Transition Handler for Event Engage.
-- @function [parent=#AI_A2A_GCI] OnBeforeEngage
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Engage.
-- @function [parent=#AI_A2A_GCI] OnAfterEngage
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Engage.
-- @function [parent=#AI_A2A_GCI] Engage
-- @param #AI_A2A_GCI self
--- Asynchronous Event Trigger for Event Engage.
-- @function [parent=#AI_A2A_GCI] __Engage
-- @param #AI_A2A_GCI self
-- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Engaging.
-- @function [parent=#AI_A2A_GCI] OnLeaveEngaging
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Engaging.
-- @function [parent=#AI_A2A_GCI] OnEnterEngaging
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_GCI.
--- OnBefore Transition Handler for Event Fired.
-- @function [parent=#AI_A2A_GCI] OnBeforeFired
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Fired.
-- @function [parent=#AI_A2A_GCI] OnAfterFired
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Fired.
-- @function [parent=#AI_A2A_GCI] Fired
-- @param #AI_A2A_GCI self
--- Asynchronous Event Trigger for Event Fired.
-- @function [parent=#AI_A2A_GCI] __Fired
-- @param #AI_A2A_GCI self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Destroy", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_GCI.
--- OnBefore Transition Handler for Event Destroy.
-- @function [parent=#AI_A2A_GCI] OnBeforeDestroy
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Destroy.
-- @function [parent=#AI_A2A_GCI] OnAfterDestroy
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_A2A_GCI] Destroy
-- @param #AI_A2A_GCI self
--- Asynchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_A2A_GCI] __Destroy
-- @param #AI_A2A_GCI self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_GCI.
--- OnBefore Transition Handler for Event Abort.
-- @function [parent=#AI_A2A_GCI] OnBeforeAbort
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Abort.
-- @function [parent=#AI_A2A_GCI] OnAfterAbort
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Abort.
-- @function [parent=#AI_A2A_GCI] Abort
-- @param #AI_A2A_GCI self
--- Asynchronous Event Trigger for Event Abort.
-- @function [parent=#AI_A2A_GCI] __Abort
-- @param #AI_A2A_GCI self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_GCI.
--- OnBefore Transition Handler for Event Accomplish.
-- @function [parent=#AI_A2A_GCI] OnBeforeAccomplish
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Accomplish.
-- @function [parent=#AI_A2A_GCI] OnAfterAccomplish
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_A2A_GCI] Accomplish
-- @param #AI_A2A_GCI self
--- Asynchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_A2A_GCI] __Accomplish
-- @param #AI_A2A_GCI self
-- @param #number Delay The delay in seconds.
return self
end
--- onafter State Transition for Event Patrol.
-- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AI Group managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_GCI:onafterEngage( AIGroup, From, Event, To )
self:HandleEvent( EVENTS.Dead )
end
-- todo: need to fix this global function
--- @param Wrapper.Group#GROUP AIControllable
function AI_A2A_GCI.InterceptRoute( AIControllable )
AIControllable:T( "NewEngageRoute" )
local EngageZone = AIControllable:GetState( AIControllable, "EngageZone" ) -- AI.AI_Cap#AI_A2A_GCI
EngageZone:__Engage( 0.5 )
end
--- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_GCI:onbeforeEngage( AIGroup, From, Event, To )
if self.Accomplished == true then
return false
end
end
--- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AI Group managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_GCI:onafterAbort( AIGroup, From, Event, To )
AIGroup:ClearTasks()
self:Return()
self:__RTB( 0.5 )
end
--- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_GCI:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
self:F( { AIGroup, From, Event, To, AttackSetUnit} )
self.AttackSetUnit = AttackSetUnit or self.AttackSetUnit -- Core.Set#SET_UNIT
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
if FirstAttackUnit then
if AIGroup:IsAlive() then
local EngageRoute = {}
--- Calculate the target route point.
local CurrentCoord = AIGroup:GetCoordinate()
local ToTargetCoord = self.AttackSetUnit:GetFirst():GetCoordinate()
self:SetTargetDistance( ToTargetCoord ) -- For RTB status check
local ToTargetSpeed = math.random( self.EngageMinSpeed, self.EngageMaxSpeed )
local ToInterceptAngle = CurrentCoord:GetAngleDegrees( CurrentCoord:GetDirectionVec3( ToTargetCoord ) )
--- Create a route point of type air.
local ToPatrolRoutePoint = CurrentCoord:Translate( 5000, ToInterceptAngle ):RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed,
true
)
self:F( { Angle = ToInterceptAngle, ToTargetSpeed = ToTargetSpeed } )
self:T2( { self.EngageMinSpeed, self.EngageMaxSpeed, ToTargetSpeed } )
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
AIGroup:OptionROEOpenFire()
AIGroup:OptionROTPassiveDefense()
local AttackTasks = {}
for AttackUnitID, AttackUnit in pairs( self.AttackSetUnit:GetSet() ) do
local AttackUnit = AttackUnit -- Wrapper.Unit#UNIT
self:T( { "Intercepting Unit:", AttackUnit:GetName(), AttackUnit:IsAlive(), AttackUnit:IsAir() } )
if AttackUnit:IsAlive() and AttackUnit:IsAir() then
AttackTasks[#AttackTasks+1] = AIGroup:TaskAttackUnit( AttackUnit )
end
end
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
AIGroup:WayPointInitialize( EngageRoute )
if #AttackTasks == 0 then
self:E("No targets found -> Going RTB")
self:Return()
self:__RTB( 0.5 )
else
AttackTasks[#AttackTasks+1] = AIGroup:TaskFunction( 1, #AttackTasks, "AI_A2A_GCI.InterceptRoute" )
AttackTasks[#AttackTasks+1] = AIGroup:TaskOrbitCircle( 4000, self.EngageMinSpeed )
EngageRoute[1].task = AIGroup:TaskCombo( AttackTasks )
--- Do a trick, link the NewEngageRoute function of the object to the AIControllable in a temporary variable ...
AIGroup:SetState( AIGroup, "EngageZone", self )
end
--- NOW ROUTE THE GROUP!
AIGroup:WayPointExecute( 1, 0 )
end
else
self:E("No targets found -> Going RTB")
self:Return()
self:__RTB( 0.5 )
end
end
--- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_GCI:onafterAccomplish( AIGroup, From, Event, To )
self.Accomplished = true
self:SetDetectionOff()
end
--- @param #AI_A2A_GCI self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Core.Event#EVENTDATA EventData
function AI_A2A_GCI:onafterDestroy( AIGroup, From, Event, To, EventData )
if EventData.IniUnit then
self.AttackUnits[EventData.IniUnit] = nil
end
end
--- @param #AI_A2A_GCI self
-- @param Core.Event#EVENTDATA EventData
function AI_A2A_GCI:OnEventDead( EventData )
self:F( { "EventDead", EventData } )
if EventData.IniDCSUnit then
if self.AttackUnits and self.AttackUnits[EventData.IniUnit] then
self:__Destroy( 1, EventData )
end
end
end

View File

@ -0,0 +1,381 @@
--- **AI** -- **Air Patrolling or Staging.**
--
-- ![Banner Image](..\Presentations\AI_PATROL\Dia1.JPG)
--
-- ===
--
-- AI PATROL classes makes AI Controllables execute an Patrol.
--
-- There are the following types of PATROL classes defined:
--
-- * @{#AI_A2A_PATROL}: Perform a PATROL in a zone.
--
-- ====
--
-- # Demo Missions
--
-- ### [AI_PATROL Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/PAT%20-%20Patrolling)
--
-- ### [AI_PATROL Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/PAT%20-%20Patrolling)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [AI_PATROL YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl35HvYZKA6G22WMt7iI3zky)
--
-- ====
--
-- ### Author: **Sven Van de Velde (FlightControl)**
-- ### Contributions:
--
-- * **[Dutch_Baron](https://forums.eagle.ru/member.php?u=112075)**: Working together with James has resulted in the creation of the AI_BALANCER class. James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Testing and API concept review.
--
-- ====
--
-- @module AI_A2A_Patrol
--- @type AI_A2A_PATROL
-- @extends AI.AI_A2A#AI_A2A
--- # AI_A2A_PATROL class, extends @{Fsm#FSM_CONTROLLABLE}
--
-- The AI_A2A_PATROL class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}.
--
-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG)
--
-- The AI_A2A_PATROL is assigned a @{Group} and this must be done before the AI_A2A_PATROL process can be started using the **Start** event.
--
-- ![Process](..\Presentations\AI_PATROL\Dia4.JPG)
--
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
--
-- ![Process](..\Presentations\AI_PATROL\Dia5.JPG)
--
-- This cycle will continue.
--
-- ![Process](..\Presentations\AI_PATROL\Dia6.JPG)
--
-- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event.
--
-- ![Process](..\Presentations\AI_PATROL\Dia9.JPG)
--
---- Note that the enemy is not engaged! To model enemy engagement, either tailor the **Detected** event, or
-- use derived AI_ classes to model AI offensive or defensive behaviour.
--
-- ![Process](..\Presentations\AI_PATROL\Dia10.JPG)
--
-- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
--
-- ![Process](..\Presentations\AI_PATROL\Dia11.JPG)
--
-- ## 1. AI_A2A_PATROL constructor
--
-- * @{#AI_A2A_PATROL.New}(): Creates a new AI_A2A_PATROL object.
--
-- ## 2. AI_A2A_PATROL is a FSM
--
-- ![Process](..\Presentations\AI_PATROL\Dia2.JPG)
--
-- ### 2.1. AI_A2A_PATROL States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Returning** ( Group ): The AI is returning to Base.
-- * **Stopped** ( Group ): The process is stopped.
-- * **Crashed** ( Group ): The AI has crashed or is dead.
--
-- ### 2.2. AI_A2A_PATROL Events
--
-- * **Start** ( Group ): Start the process.
-- * **Stop** ( Group ): Stop the process.
-- * **Route** ( Group ): Route the AI to a new random 3D point within the Patrol Zone.
-- * **RTB** ( Group ): Route the AI to the home base.
-- * **Detect** ( Group ): The AI is detecting targets.
-- * **Detected** ( Group ): The AI has detected new targets.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 3. Set or Get the AI controllable
--
-- * @{#AI_A2A_PATROL.SetControllable}(): Set the AIControllable.
-- * @{#AI_A2A_PATROL.GetControllable}(): Get the AIControllable.
--
-- ## 4. Set the Speed and Altitude boundaries of the AI controllable
--
-- * @{#AI_A2A_PATROL.SetSpeed}(): Set the patrol speed boundaries of the AI, for the next patrol.
-- * @{#AI_A2A_PATROL.SetAltitude}(): Set altitude boundaries of the AI, for the next patrol.
--
-- ## 5. Manage the detection process of the AI controllable
--
-- The detection process of the AI controllable can be manipulated.
-- Detection requires an amount of CPU power, which has an impact on your mission performance.
-- Only put detection on when absolutely necessary, and the frequency of the detection can also be set.
--
-- * @{#AI_A2A_PATROL.SetDetectionOn}(): Set the detection on. The AI will detect for targets.
-- * @{#AI_A2A_PATROL.SetDetectionOff}(): Set the detection off, the AI will not detect for targets. The existing target list will NOT be erased.
--
-- The detection frequency can be set with @{#AI_A2A_PATROL.SetDetectionInterval}( seconds ), where the amount of seconds specify how much seconds will be waited before the next detection.
-- Use the method @{#AI_A2A_PATROL.GetDetectedUnits}() to obtain a list of the @{Unit}s detected by the AI.
--
-- The detection can be filtered to potential targets in a specific zone.
-- Use the method @{#AI_A2A_PATROL.SetDetectionZone}() to set the zone where targets need to be detected.
-- Note that when the zone is too far away, or the AI is not heading towards the zone, or the AI is too high, no targets may be detected
-- according the weather conditions.
--
-- ## 6. Manage the "out of fuel" in the AI_A2A_PATROL
--
-- When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
-- When the fuel treshold is reached, the AI will continue for a given time its patrol task in orbit,
-- while a new AI is targetted to the AI_A2A_PATROL.
-- Once the time is finished, the old AI will return to the base.
-- Use the method @{#AI_A2A_PATROL.ManageFuel}() to have this proces in place.
--
-- ## 7. Manage "damage" behaviour of the AI in the AI_A2A_PATROL
--
-- When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on.
-- Therefore, when the damage treshold is reached, the AI will return immediately to the home base (RTB).
-- Use the method @{#AI_A2A_PATROL.ManageDamage}() to have this proces in place.
--
-- ===
--
-- @field #AI_A2A_PATROL
AI_A2A_PATROL = {
ClassName = "AI_A2A_PATROL",
}
--- Creates a new AI_A2A_PATROL object
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Group#GROUP AIGroup
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#AltitudeType PatrolAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO
-- @return #AI_A2A_PATROL self
-- @usage
-- -- Define a new AI_A2A_PATROL Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
-- PatrolZone = ZONE:New( 'PatrolZone' )
-- PatrolSpawn = SPAWN:New( 'Patrol Group' )
-- PatrolArea = AI_A2A_PATROL:New( PatrolZone, 3000, 6000, 600, 900 )
function AI_A2A_PATROL:New( AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
-- Inherits from BASE
local self = BASE:Inherit( self, AI_A2A:New( AIGroup ) ) -- #AI_A2A_PATROL
self.PatrolZone = PatrolZone
self.PatrolFloorAltitude = PatrolFloorAltitude
self.PatrolCeilingAltitude = PatrolCeilingAltitude
self.PatrolMinSpeed = PatrolMinSpeed
self.PatrolMaxSpeed = PatrolMaxSpeed
-- defafult PatrolAltType to "RADIO" if not specified
self.PatrolAltType = PatrolAltType or "RADIO"
self:AddTransition( "Started", "Patrol", "Patrolling" )
--- OnBefore Transition Handler for Event Patrol.
-- @function [parent=#AI_A2A_PATROL] OnBeforePatrol
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Patrol.
-- @function [parent=#AI_A2A_PATROL] OnAfterPatrol
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Patrol.
-- @function [parent=#AI_A2A_PATROL] Patrol
-- @param #AI_A2A_PATROL self
--- Asynchronous Event Trigger for Event Patrol.
-- @function [parent=#AI_A2A_PATROL] __Patrol
-- @param #AI_A2A_PATROL self
-- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Patrolling.
-- @function [parent=#AI_A2A_PATROL] OnLeavePatrolling
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Patrolling.
-- @function [parent=#AI_A2A_PATROL] OnEnterPatrolling
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
self:AddTransition( "Patrolling", "Route", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_PATROL.
--- OnBefore Transition Handler for Event Route.
-- @function [parent=#AI_A2A_PATROL] OnBeforeRoute
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Route.
-- @function [parent=#AI_A2A_PATROL] OnAfterRoute
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Route.
-- @function [parent=#AI_A2A_PATROL] Route
-- @param #AI_A2A_PATROL self
--- Asynchronous Event Trigger for Event Route.
-- @function [parent=#AI_A2A_PATROL] __Route
-- @param #AI_A2A_PATROL self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_PATROL.
return self
end
--- Sets (modifies) the minimum and maximum speed of the patrol.
-- @param #AI_A2A_PATROL self
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @return #AI_A2A_PATROL self
function AI_A2A_PATROL:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
self.PatrolMinSpeed = PatrolMinSpeed
self.PatrolMaxSpeed = PatrolMaxSpeed
end
--- Sets the floor and ceiling altitude of the patrol.
-- @param #AI_A2A_PATROL self
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @return #AI_A2A_PATROL self
function AI_A2A_PATROL:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
self.PatrolFloorAltitude = PatrolFloorAltitude
self.PatrolCeilingAltitude = PatrolCeilingAltitude
end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings.
-- @param #AI_A2A_PATROL self
-- @return #AI_A2A_PATROL self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_PATROL:onafterPatrol( Controllable, From, Event, To )
self:F2()
self:ClearTargetDistance()
self:__Route( 1 )
self.Controllable:OnReSpawn(
function( PatrolGroup )
self:E( "ReSpawn" )
self:__Reset( 1 )
self:__Route( 5 )
end
)
end
--- @param Wrapper.Group#GROUP AIGroup
-- This statis method is called from the route path within the last task at the last waaypoint of the Controllable.
-- Note that this method is required, as triggers the next route when patrolling for the Controllable.
function AI_A2A_PATROL.PatrolRoute( AIGroup )
local _AI_A2A_Patrol = AIGroup:GetState( AIGroup, "AI_A2A_PATROL" ) -- #AI_A2A_PATROL
_AI_A2A_Patrol:Route()
end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings.
-- @param #AI_A2A_PATROL self
-- @param Wrapper.Group#GROUP AIGroup The AIGroup managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_A2A_PATROL:onafterRoute( AIGroup, From, Event, To )
self:F2()
-- When RTB, don't allow anymore the routing.
if From == "RTB" then
return
end
if AIGroup:IsAlive() then
local PatrolRoute = {}
--- Calculate the target route point.
local CurrentCoord = AIGroup:GetCoordinate()
local ToTargetCoord = self.PatrolZone:GetRandomPointVec2()
self:SetTargetDistance( ToTargetCoord ) -- For RTB status check
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
--- Create a route point of type air.
local ToPatrolRoutePoint = ToTargetCoord:RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed,
true
)
PatrolRoute[#PatrolRoute+1] = ToPatrolRoutePoint
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
AIGroup:WayPointInitialize( PatrolRoute )
local Tasks = {}
Tasks[#Tasks+1] = AIGroup:TaskFunction( 1, 1, "AI_A2A_PATROL.PatrolRoute" )
PatrolRoute[1].task = AIGroup:TaskCombo( Tasks )
--- Do a trick, link the NewPatrolRoute function of the PATROLGROUP object to the AIControllable in a temporary variable ...
AIGroup:SetState( AIGroup, "AI_A2A_PATROL", self )
--- NOW ROUTE THE GROUP!
AIGroup:WayPointExecute( 1, 2 )
end
end

View File

@ -38,6 +38,7 @@
--
-- @module AI_Patrol
--- AI_PATROL_ZONE class
-- @type AI_PATROL_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.

View File

@ -0,0 +1,565 @@
--- **AI** -- **Execute Combat Air Patrol (CAP).**
--
-- ![Banner Image](..\Presentations\AI_CAP\Dia1.JPG)
--
-- ===
--
-- AI CAP classes makes AI Controllables execute a Combat Air Patrol.
--
-- There are the following types of CAP classes defined:
--
-- * @{#AI_CAP_ZONE}: Perform a CAP in a zone.
--
-- ====
--
-- # Demo Missions
--
-- ### [AI_CAP Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/CAP%20-%20Combat%20Air%20Patrol)
--
-- ### [AI_CAP Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/CAP%20-%20Combat%20Air%20Patrol)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [AI_CAP YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl1YCyPxJgoZn-CfhwyeW65L)
--
-- ====
--
-- ### Author: **Sven Van de Velde (FlightControl)**
--
-- ### Contributions:
--
-- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing.
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing.
-- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision.
-- * **[Whisper](http://forums.eagle.ru/member.php?u=3829): Testing.
-- * **[Delta99](https://forums.eagle.ru/member.php?u=125166): Testing.
--
-- ====
--
-- @module AI_Cap
--- @type AI_CAP_ZONE
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed.
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- # AI_CAP_ZONE class, extends @{AI_CAP#AI_PATROL_ZONE}
--
-- The AI_CAP_ZONE class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
--
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
--
-- The AI_CAP_ZONE is assigned a @{Group} and this must be done before the AI_CAP_ZONE process can be started using the **Start** event.
--
-- ![Process](..\Presentations\AI_CAP\Dia4.JPG)
--
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
--
-- ![Process](..\Presentations\AI_CAP\Dia5.JPG)
--
-- This cycle will continue.
--
-- ![Process](..\Presentations\AI_CAP\Dia6.JPG)
--
-- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event.
--
-- ![Process](..\Presentations\AI_CAP\Dia9.JPG)
--
-- When enemies are detected, the AI will automatically engage the enemy.
--
-- ![Process](..\Presentations\AI_CAP\Dia10.JPG)
--
-- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
--
-- ![Process](..\Presentations\AI_CAP\Dia13.JPG)
--
-- ## 1. AI_CAP_ZONE constructor
--
-- * @{#AI_CAP_ZONE.New}(): Creates a new AI_CAP_ZONE object.
--
-- ## 2. AI_CAP_ZONE is a FSM
--
-- ![Process](..\Presentations\AI_CAP\Dia2.JPG)
--
-- ### 2.1 AI_CAP_ZONE States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Engaging** ( Group ): The AI is engaging the bogeys.
-- * **Returning** ( Group ): The AI is returning to Base..
--
-- ### 2.2 AI_CAP_ZONE Events
--
-- * **@{AI_Patrol#AI_PATROL_ZONE.Start}**: Start the process.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Route}**: Route the AI to a new random 3D point within the Patrol Zone.
-- * **@{#AI_CAP_ZONE.Engage}**: Let the AI engage the bogeys.
-- * **@{#AI_CAP_ZONE.Abort}**: Aborts the engagement and return patrolling in the patrol zone.
-- * **@{AI_Patrol#AI_PATROL_ZONE.RTB}**: Route the AI to the home base.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detect}**: The AI is detecting targets.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Detected}**: The AI has detected new targets.
-- * **@{#AI_CAP_ZONE.Destroy}**: The AI has destroyed a bogey @{Unit}.
-- * **@{#AI_CAP_ZONE.Destroyed}**: The AI has destroyed all bogeys @{Unit}s assigned in the CAS task.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 3. Set the Range of Engagement
--
-- ![Range](..\Presentations\AI_CAP\Dia11.JPG)
--
-- An optional range can be set in meters,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- The range can be beyond or smaller than the range of the Patrol Zone.
-- The range is applied at the position of the AI.
-- Use the method @{AI_CAP#AI_CAP_ZONE.SetEngageRange}() to define that range.
--
-- ## 4. Set the Zone of Engagement
--
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
--
-- An optional @{Zone} can be set,
-- that will define when the AI will engage with the detected airborne enemy targets.
-- Use the method @{AI_Cap#AI_CAP_ZONE.SetEngageZone}() to define that Zone.
--
-- ===
--
-- @field #AI_CAP_ZONE
AI_CAP_ZONE = {
ClassName = "AI_CAP_ZONE",
}
--- Creates a new AI_CAP_ZONE object
-- @param #AI_CAP_ZONE self
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @param Dcs.DCSTypes#AltitudeType PatrolAltType The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO
-- @return #AI_CAP_ZONE self
function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType )
-- Inherits from BASE
local self = BASE:Inherit( self, AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType ) ) -- #AI_CAP_ZONE
self.Accomplished = false
self.Engaging = false
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Engage.
-- @function [parent=#AI_CAP_ZONE] OnBeforeEngage
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Engage.
-- @function [parent=#AI_CAP_ZONE] OnAfterEngage
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Engage.
-- @function [parent=#AI_CAP_ZONE] Engage
-- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Engage.
-- @function [parent=#AI_CAP_ZONE] __Engage
-- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds.
--- OnLeave Transition Handler for State Engaging.
-- @function [parent=#AI_CAP_ZONE] OnLeaveEngaging
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter Transition Handler for State Engaging.
-- @function [parent=#AI_CAP_ZONE] OnEnterEngaging
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Fired.
-- @function [parent=#AI_CAP_ZONE] OnBeforeFired
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Fired.
-- @function [parent=#AI_CAP_ZONE] OnAfterFired
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Fired.
-- @function [parent=#AI_CAP_ZONE] Fired
-- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Fired.
-- @function [parent=#AI_CAP_ZONE] __Fired
-- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds.
self:AddTransition( "*", "Destroy", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] OnBeforeDestroy
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] OnAfterDestroy
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] Destroy
-- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Destroy.
-- @function [parent=#AI_CAP_ZONE] __Destroy
-- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Abort.
-- @function [parent=#AI_CAP_ZONE] OnBeforeAbort
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Abort.
-- @function [parent=#AI_CAP_ZONE] OnAfterAbort
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Abort.
-- @function [parent=#AI_CAP_ZONE] Abort
-- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Abort.
-- @function [parent=#AI_CAP_ZONE] __Abort
-- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds.
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
--- OnBefore Transition Handler for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] OnBeforeAccomplish
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter Transition Handler for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] OnAfterAccomplish
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Synchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] Accomplish
-- @param #AI_CAP_ZONE self
--- Asynchronous Event Trigger for Event Accomplish.
-- @function [parent=#AI_CAP_ZONE] __Accomplish
-- @param #AI_CAP_ZONE self
-- @param #number Delay The delay in seconds.
return self
end
--- Set the Engage Zone which defines where the AI will engage bogies.
-- @param #AI_CAP_ZONE self
-- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAP.
-- @return #AI_CAP_ZONE self
function AI_CAP_ZONE:SetEngageZone( EngageZone )
self:F2()
if EngageZone then
self.EngageZone = EngageZone
else
self.EngageZone = nil
end
end
--- Set the Engage Range when the AI will engage with airborne enemies.
-- @param #AI_CAP_ZONE self
-- @param #number EngageRange The Engage Range.
-- @return #AI_CAP_ZONE self
function AI_CAP_ZONE:SetEngageRange( EngageRange )
self:F2()
if EngageRange then
self.EngageRange = EngageRange
else
self.EngageRange = nil
end
end
--- onafter State Transition for Event Start.
-- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
-- Call the parent Start event handler
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
self:HandleEvent( EVENTS.Dead )
end
-- todo: need to fix this global function
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
function _NewEngageCapRoute( AIControllable )
AIControllable:T( "NewEngageRoute" )
local EngageZone = AIControllable:GetState( AIControllable, "EngageZone" ) -- AI.AI_Cap#AI_CAP_ZONE
EngageZone:__Engage( 1 )
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onbeforeEngage( Controllable, From, Event, To )
if self.Accomplished == true then
return false
end
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
if From ~= "Engaging" then
local Engage = false
for DetectedUnit, Detected in pairs( self.DetectedUnits ) do
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
self:T( DetectedUnit )
if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then
Engage = true
break
end
end
if Engage == true then
self:E( 'Detected -> Engaging' )
self:__Engage( 1 )
end
end
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onafterAbort( Controllable, From, Event, To )
Controllable:ClearTasks()
self:__Route( 1 )
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
if Controllable:IsAlive() then
local EngageRoute = {}
--- Calculate the current route point.
local CurrentVec2 = self.Controllable:GetVec2()
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
local ToEngageZoneSpeed = self.PatrolMaxSpeed
local CurrentRoutePoint = CurrentPointVec3:RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToEngageZoneSpeed,
true
)
EngageRoute[#EngageRoute+1] = CurrentRoutePoint
--- Find a random 2D point in PatrolZone.
local ToTargetVec2 = self.PatrolZone:GetRandomVec2()
self:T2( ToTargetVec2 )
--- Define Speed and Altitude.
local ToTargetAltitude = math.random( self.EngageFloorAltitude, self.EngageCeilingAltitude )
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } )
--- Obtain a 3D @{Point} from the 2D point + altitude.
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
--- Create a route point of type air.
local ToPatrolRoutePoint = ToTargetPointVec3:RoutePointAir(
self.PatrolAltType,
POINT_VEC3.RoutePointType.TurningPoint,
POINT_VEC3.RoutePointAction.TurningPoint,
ToTargetSpeed,
true
)
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
Controllable:OptionROEOpenFire()
Controllable:OptionROTPassiveDefense()
local AttackTasks = {}
for DetectedUnit, Detected in pairs( self.DetectedUnits ) do
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
self:T( { DetectedUnit, DetectedUnit:IsAlive(), DetectedUnit:IsAir() } )
if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then
if self.EngageZone then
if DetectedUnit:IsInZone( self.EngageZone ) then
self:E( {"Within Zone and Engaging ", DetectedUnit } )
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
end
else
if self.EngageRange then
if DetectedUnit:GetPointVec3():Get2DDistance(Controllable:GetPointVec3() ) <= self.EngageRange then
self:E( {"Within Range and Engaging", DetectedUnit } )
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
end
else
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
end
end
else
self.DetectedUnits[DetectedUnit] = nil
end
end
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
self.Controllable:WayPointInitialize( EngageRoute )
if #AttackTasks == 0 then
self:E("No targets found -> Going back to Patrolling")
self:__Abort( 1 )
self:__Route( 1 )
self:SetDetectionActivated()
else
EngageRoute[1].task = Controllable:TaskCombo( AttackTasks )
--- Do a trick, link the NewEngageRoute function of the object to the AIControllable in a temporary variable ...
self.Controllable:SetState( self.Controllable, "EngageZone", self )
self.Controllable:WayPointFunction( #EngageRoute, 1, "_NewEngageCapRoute" )
self:SetDetectionDeactivated()
end
--- NOW ROUTE THE GROUP!
self.Controllable:WayPointExecute( 1, 2 )
end
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
self.Accomplished = true
self:SetDetectionOff()
end
--- @param #AI_CAP_ZONE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @param Core.Event#EVENTDATA EventData
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
if EventData.IniUnit then
self.DetectedUnits[EventData.IniUnit] = nil
end
end
--- @param #AI_CAP_ZONE self
-- @param Core.Event#EVENTDATA EventData
function AI_CAP_ZONE:OnEventDead( EventData )
self:F( { "EventDead", EventData } )
if EventData.IniDCSUnit then
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
self:__Destroy( 1, EventData )
end
end
end

View File

@ -703,7 +703,7 @@ end
--- Set tracing for a class
-- @param #BASE self
-- @param #string Class
function BASE:TraceClass( Class )
function --BASE:TraceClass( Class )
_TraceClass[Class] = true
_TraceClassMethod[Class] = {}
self:E( "Tracing class " .. Class )
@ -713,7 +713,7 @@ end
-- @param #BASE self
-- @param #string Class
-- @param #string Method
function BASE:TraceClassMethod( Class, Method )
function --BASE:TraceClassMethod( Class, Method )
if not _TraceClassMethod[Class] then
_TraceClassMethod[Class] = {}
_TraceClassMethod[Class].Method = {}

View File

@ -983,7 +983,7 @@ function EVENT:onEvent( Event )
-- There is an EventFunction defined, so call the EventFunction.
if Event.IniObjectCategory ~= 3 then
self:E( { "Calling EventFunction for Class ", EventClass:GetClassNameAndID(), EventPriority } )
self:F2( { "Calling EventFunction for Class ", EventClass:GetClassNameAndID(), EventPriority } )
end
local Result, Value = xpcall(
function()
@ -997,7 +997,7 @@ function EVENT:onEvent( Event )
-- Now call the default event function.
if Event.IniObjectCategory ~= 3 then
self:E( { "Calling " .. EventMeta.Event .. " for Class ", EventClass:GetClassNameAndID(), EventPriority } )
self:F2( { "Calling " .. EventMeta.Event .. " for Class ", EventClass:GetClassNameAndID(), EventPriority } )
end
local Result, Value = xpcall(

View File

@ -396,7 +396,7 @@ do -- FSM
Transition.Event = Event
Transition.To = To
self:T( Transition )
self:T2( Transition )
self._Transitions[Transition] = Transition
self:_eventmap( self.Events, Transition )
@ -534,7 +534,7 @@ do -- FSM
local __Event = "__" .. EventStructure.Event
self[Event] = self[Event] or self:_create_transition(Event)
self[__Event] = self[__Event] or self:_delayed_transition(Event)
self:T( "Added methods: " .. Event .. ", " .. __Event )
self:T2( "Added methods: " .. Event .. ", " .. __Event )
Events[Event] = self.Events[Event] or { map = {} }
self:_add_to_map( Events[Event].map, EventStructure )
@ -569,7 +569,7 @@ do -- FSM
return errmsg
end
if self[handler] then
self:T( "Calling " .. handler )
self:T2( "Calling " .. handler )
self._EventSchedules[EventName] = nil
local Result, Value = xpcall( function() return self[handler]( self, unpack( params ) ) end, ErrorHandler )
return Value

View File

@ -87,7 +87,7 @@ function MESSAGE:New( MessageText, MessageDuration, MessageCategory )
self.MessageDuration = MessageDuration or 5
self.MessageTime = timer.getTime()
self.MessageText = MessageText
self.MessageText = MessageText:gsub("^\n","",1):gsub("\n$","",1)
self.MessageSent = false
self.MessageGroup = false

View File

@ -138,12 +138,13 @@ do -- COORDINATE
ClassName = "COORDINATE",
}
--- COORDINATE constructor.
-- @param #COORDINATE self
-- @param Dcs.DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
-- @param Dcs.DCSTypes#Distance y The y coordinate of the Vec3 point, pointing to the Right.
-- @param Dcs.DCSTypes#Distance z The z coordinate of the Vec3 point, pointing to the Right.
-- @return Core.Point#COORDINATE
-- @return #COORDINATE
function COORDINATE:New( x, y, z )
local self = BASE:Inherit( self, BASE:New() ) -- #COORDINATE
@ -177,7 +178,7 @@ do -- COORDINATE
--- Create a new COORDINATE object from Vec3 coordinates.
-- @param #COORDINATE self
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
-- @return Core.Point#COORDINATE
-- @return #COORDINATE
function COORDINATE:NewFromVec3( Vec3 )
local self = self:New( Vec3.x, Vec3.y, Vec3.z ) -- #COORDINATE

View File

@ -62,7 +62,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
-- Initialize the ObjectSchedulers array, which is a weakly coupled table.
-- If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.
self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } ) -- or {}
self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } )
if Scheduler.MasterObject then
self.ObjectSchedulers[self.CallID] = Scheduler
@ -101,13 +101,13 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
Scheduler = self.PersistentSchedulers[CallID]
end
self:T3( { Scheduler = Scheduler } )
--self:T3( { Scheduler = Scheduler } )
if Scheduler then
local Schedule = self.Schedule[Scheduler][CallID]
self:T3( { Schedule = Schedule } )
--self:T3( { Schedule = Schedule } )
local ScheduleObject = Scheduler.SchedulerObject
--local ScheduleObjectName = Scheduler.SchedulerObject:GetNameAndClassID()
@ -145,7 +145,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
( Randomize * Repeat / 2 )
) +
0.01
self:T3( { Repeat = CallID, CurrentTime, ScheduleTime, ScheduleArguments } )
--self:T3( { Repeat = CallID, CurrentTime, ScheduleTime, ScheduleArguments } )
return ScheduleTime -- returns the next time the function needs to be called.
else
self:Stop( Scheduler, CallID )
@ -154,7 +154,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
self:Stop( Scheduler, CallID )
end
else
self:E( "Scheduled obscolete call for CallID: " .. CallID )
self:E( "Scheduled obsolete call for CallID: " .. CallID )
end
return nil

View File

@ -84,11 +84,6 @@ function SET_BASE:New( Database )
self.TimeInterval = 0.001
self.Set = {}
self.List = {}
self.List.__index = self.List
self.List = setmetatable( { Count = 0 }, self.List )
self.Index = {}
self.CallScheduler = SCHEDULER:New( self )
@ -126,24 +121,8 @@ end
function SET_BASE:Add( ObjectName, Object )
self:F( ObjectName )
local t = { _ = Object }
if self.List.last then
self.List.last._next = t
t._prev = self.List.last
self.List.last = t
else
-- this is the first node
self.List.first = t
self.List.last = t
end
self.List.Count = self.List.Count + 1
self.Set[ObjectName] = Object
table.insert( self.Index, ObjectName )
end
--- Adds a @{Base#BASE} object in the @{Set#SET_BASE}, using the Object Name as the index.
@ -166,43 +145,19 @@ end
-- @param #string ObjectName
function SET_BASE:Remove( ObjectName )
local t = self.Set[ObjectName]
local Object = self.Set[ObjectName]
self:F3( { ObjectName, t } )
self:F3( { ObjectName, Object } )
if t then
if t._next then
if t._prev then
t._next._prev = t._prev
t._prev._next = t._next
else
-- this was the first node
t._next._prev = nil
self.List._first = t._next
end
elseif t._prev then
-- this was the last node
t._prev._next = nil
self.List._last = t._prev
else
-- this was the only node
self.List._first = nil
self.List._last = nil
end
t._next = nil
t._prev = nil
self.List.Count = self.List.Count - 1
if Object then
for Index, Key in ipairs( self.Index ) do
if Key == ObjectName then
table.remove( self.Index, Index )
self.Set[ObjectName] = nil
break
end
end
self.Set[ObjectName] = nil
end
end
@ -214,19 +169,16 @@ end
function SET_BASE:Get( ObjectName )
self:F( ObjectName )
local t = self.Set[ObjectName]
self:T3( { ObjectName, t } )
return t
local Object = self.Set[ObjectName]
self:T3( { ObjectName, Object } )
return Object
end
--- Gets the first object from the @{Set#SET_BASE} and derived classes.
-- @param #SET_BASE self
-- @return Core.Base#BASE
function SET_BASE:GetFirst()
self:F()
local ObjectName = self.Index[1]
local FirstObject = self.Set[ObjectName]
@ -238,7 +190,6 @@ end
-- @param #SET_BASE self
-- @return Core.Base#BASE
function SET_BASE:GetLast()
self:F()
local ObjectName = self.Index[#self.Index]
local LastObject = self.Set[ObjectName]
@ -250,12 +201,9 @@ end
-- @param #SET_BASE self
-- @return Core.Base#BASE
function SET_BASE:GetRandom()
self:F()
local RandomItem = self.Set[self.Index[math.random(#self.Index)]]
self:T3( { RandomItem } )
return RandomItem
end
@ -265,7 +213,7 @@ end
-- @return #number Count
function SET_BASE:Count()
return #self.Index or 0
return self.Index and #self.Index or 0
end
@ -603,6 +551,20 @@ function SET_BASE:IsIncludeObject( Object )
return true
end
--- Gets a string with all the object names.
-- @param #SET_BASE self
-- @return #string A string with the names of the objects.
function SET_BASE:GetObjectNames()
self:F3()
local ObjectNames = ""
for ObjectName, Object in pairs( self.Set ) do
ObjectNames = ObjectNames .. ObjectName .. ", "
end
return ObjectNames
end
--- Flushes the current SET_BASE contents in the log ... (for debugging reasons).
-- @param #SET_BASE self
-- @return #string A string with the names of the objects.

View File

@ -37,6 +37,10 @@
--
-- @module Detection
----BASE:TraceClass("DETECTION_BASE")
----BASE:TraceClass("DETECTION_AREAS")
----BASE:TraceClass("DETECTION_UNITS")
----BASE:TraceClass("DETECTION_TYPES")
do -- DETECTION_BASE
@ -607,7 +611,7 @@ do -- DETECTION_BASE
if self.AcceptZones then
for AcceptZoneID, AcceptZone in pairs( self.AcceptZones ) do
local AcceptZone = AcceptZone -- Core.Zone#ZONE_BASE
if AcceptZone:IsPointVec2InZone( DetectedObjectVec2 ) == false then
if AcceptZone:IsVec2InZone( DetectedObjectVec2 ) == false then
DetectionAccepted = false
end
end
@ -755,6 +759,25 @@ do -- DETECTION_BASE
return self
end
--- Forget a Unit from a DetectionItem
-- @param #DETECTION_BASE self
-- @param #string UnitName The UnitName that needs to be forgotten from the DetectionItem Sets.
-- @return #DETECTION_BASE
function DETECTION_BASE:ForgetDetectedUnit( UnitName )
self:F2()
local DetectedItems = self:GetDetectedItems()
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
local DetectedSet = self:GetDetectedSet( DetectedItemIndex )
if DetectedSet then
DetectedSet:RemoveUnitsByName( UnitName )
end
end
return self
end
--- Make a DetectionSet table. This function will be overridden in the derived clsses.
-- @param #DETECTION_BASE self
@ -1144,6 +1167,7 @@ do -- DETECTION_BASE
local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
local DetectedSet = ReportGroupData.DetectedItem.Set
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
local CenterCoord = DetectedUnit:GetCoordinate()
local ReportSetGroup = ReportGroupData.ReportSetGroup
local EnemyCoalition = DetectedUnit:GetCoalition()
@ -1154,12 +1178,14 @@ do -- DETECTION_BASE
local EnemyUnitName = DetectedUnit:GetName()
local FoundUnitInReportSetGroup = ReportSetGroup:FindGroup( FoundUnitGroupName ) ~= nil
self:T3( { "Friendlies search:", FoundUnitName, FoundUnitCoalition, EnemyUnitName, EnemyCoalition, FoundUnitInReportSetGroup } )
self:F( { "Friendlies search:", FoundUnitName, FoundUnitCoalition, EnemyUnitName, EnemyCoalition, FoundUnitInReportSetGroup } )
if FoundUnitCoalition ~= EnemyCoalition and FoundUnitInReportSetGroup == false then
DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {}
DetectedItem.FriendliesNearBy[FoundUnitName] = UNIT:Find( FoundDCSUnit )
return false
local FriendlyUnit = UNIT:Find( FoundDCSUnit )
local Distance = CenterCoord:Get2DDistance( FriendlyUnit:GetCoordinate() )
DetectedItem.FriendliesNearBy[Distance] = FriendlyUnit
return true
end
return true

View File

@ -37,6 +37,7 @@
--
-- @module Spawn
----BASE:TraceClass("SPAWN")
--- SPAWN Class
@ -264,6 +265,14 @@ SPAWN = {
}
--- Enumerator for spawns at airbases
-- @type SPAWN.Takeoff
-- @extends Wrapper.Group#GROUP.Takeoff
--- @field #SPAWN.Takeoff Takeoff
SPAWN.Takeoff = GROUP.Takeoff
--- @type SPAWN.SpawnZoneTable
-- @list <Core.Zone#ZONE_BASE> SpawnZone
@ -299,6 +308,7 @@ function SPAWN:New( SpawnTemplatePrefix )
self.SpawnUnControlled = false
self.SpawnInitKeepUnitNames = false -- Overwrite unit names by default with group name.
self.DelayOnOff = false -- No intial delay when spawning the first group.
self.Grouping = nil -- No grouping
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else
@ -343,6 +353,7 @@ function SPAWN:NewWithAlias( SpawnTemplatePrefix, SpawnAliasPrefix )
self.SpawnUnControlled = false
self.SpawnInitKeepUnitNames = false -- Overwrite unit names by default with group name.
self.DelayOnOff = false -- No intial delay when spawning the first group.
self.Grouping = nil
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else
@ -509,6 +520,20 @@ function SPAWN:InitRandomizeTemplate( SpawnTemplatePrefixTable )
return self
end
--- When spawning a new group, make the grouping of the units according the InitGrouping setting.
-- @param #SPAWN self
-- @param #number Grouping Indicates the maximum amount of units in the group.
-- @return #SPAWN
function SPAWN:InitGrouping( Grouping ) -- R2.2
self:F( { self.SpawnTemplatePrefix, Grouping } )
self.SpawnGrouping = Grouping
return self
end
--TODO: Add example.
--- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
-- @param #SPAWN self
@ -957,6 +982,64 @@ function SPAWN:OnSpawnGroup( SpawnCallBackFunction, ... )
return self
end
--- Will spawn a group at an airbase.
-- This method is mostly advisable to be used if you want to simulate spawning units at an airbase.
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
-- You can use the returned group to further define the route to be followed.
-- @param #SPAWN self
-- @param Wrapper.Airbase#AIRBASE Airbase The @{Airbase} where to spawn the group.
-- @param #SPAWN.Takeoff Takeoff (optional) The location and takeoff method. Default is Hot.
-- @return Wrapper.Group#GROUP that was spawned.
-- @return #nil Nothing was spawned.
function SPAWN:SpawnAtAirbase( Airbase, Takeoff ) -- R2.2
self:F( { self.SpawnTemplatePrefix, Airbase } )
local PointVec3 = Airbase:GetPointVec3()
self:T2(PointVec3)
Takeoff = Takeoff or SPAWN.Takeoff.Hot
if self:_GetSpawnIndex( self.SpawnIndex + 1 ) then
local SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate
if SpawnTemplate then
self:T( { "Current point of ", self.SpawnTemplatePrefix, Airbase } )
-- Translate the position of the Group Template to the Vec3.
for UnitID = 1, #SpawnTemplate.units do
self:T( 'Before Translation SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
local UnitTemplate = SpawnTemplate.units[UnitID]
local SX = UnitTemplate.x
local SY = UnitTemplate.y
local BX = SpawnTemplate.route.points[1].x
local BY = SpawnTemplate.route.points[1].y
local TX = PointVec3.x + ( SX - BX )
local TY = PointVec3.z + ( SY - BY )
SpawnTemplate.units[UnitID].x = TX
SpawnTemplate.units[UnitID].y = TY
SpawnTemplate.units[UnitID].alt = PointVec3.y
self:T( 'After Translation SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
end
SpawnTemplate.route.points[1].x = PointVec3.x
SpawnTemplate.route.points[1].y = PointVec3.z
SpawnTemplate.route.points[1].alt = Airbase.y
SpawnTemplate.route.points[1].type = GROUPTEMPLATE.Takeoff[Takeoff]
SpawnTemplate.route.points[1].airdromeId = Airbase:GetID()
SpawnTemplate.x = PointVec3.x
SpawnTemplate.y = PointVec3.z
return self:SpawnWithIndex( self.SpawnIndex )
end
end
return nil
end
--- Will spawn a group from a Vec3 in 3D space.
-- This method is mostly advisable to be used if you want to simulate spawning units in the air, like helicopters or airplanes.
@ -1112,6 +1195,19 @@ function SPAWN:InitUnControlled( UnControlled )
end
--- Get the Coordinate of the Group that is Late Activated as the template for the SPAWN object.
-- @param #SPAWN self
-- @return Core.Point#COORDINATE The Coordinate
function SPAWN:GetCoordinate()
local LateGroup = GROUP:FindByName( self.SpawnTemplatePrefix )
if LateGroup then
return LateGroup:GetCoordinate()
end
return nil
end
--- Will return the SpawnGroupName either with with a specific count number or without any count.
-- @param #SPAWN self
@ -1370,7 +1466,7 @@ end
-- @param #string SpawnTemplatePrefix
-- @param #number SpawnIndex
-- @return #SPAWN self
function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex ) --R2.2
self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix } )
local SpawnTemplate = self:_GetTemplate( SpawnTemplatePrefix )
@ -1385,6 +1481,23 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
SpawnTemplate.visible = false
end
if self.SpawnGrouping then
local UnitAmount = #SpawnTemplate.units
self:F( { UnitAmount = UnitAmount, SpawnGrouping = self.SpawnGrouping } )
if UnitAmount > self.SpawnGrouping then
for UnitID = self.SpawnGrouping + 1, UnitAmount do
SpawnTemplate.units[UnitID] = nil
end
else
if UnitAmount < self.SpawnGrouping then
for UnitID = UnitAmount + 1, self.SpawnGrouping do
SpawnTemplate.units[UnitID] = UTILS.DeepCopy( SpawnTemplate.units[1] )
SpawnTemplate.units[UnitID].unitId = nil
end
end
end
end
if self.SpawnInitKeepUnitNames == false then
for UnitID = 1, #SpawnTemplate.units do
SpawnTemplate.units[UnitID].name = string.format( SpawnTemplate.name .. '-%02d', UnitID )

View File

@ -70,7 +70,60 @@ do -- DETECTION MANAGER
self:SetStartState( "Stopped" )
self:AddTransition( "Stopped", "Start", "Started" )
--- Start Handler OnBefore for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] OnBeforeStart
-- @param #DETECTION_MANAGER self
-- @param #string From
-- @param #string Event
-- @param #string To
-- @return #boolean
--- Start Handler OnAfter for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] OnAfterStart
-- @param #DETECTION_MANAGER self
-- @param #string From
-- @param #string Event
-- @param #string To
--- Start Trigger for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] Start
-- @param #DETECTION_MANAGER self
--- Start Asynchronous Trigger for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] __Start
-- @param #DETECTION_MANAGER self
-- @param #number Delay
self:AddTransition( "Started", "Stop", "Stopped" )
--- Stop Handler OnBefore for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] OnBeforeStop
-- @param #DETECTION_MANAGER self
-- @param #string From
-- @param #string Event
-- @param #string To
-- @return #boolean
--- Stop Handler OnAfter for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] OnAfterStop
-- @param #DETECTION_MANAGER self
-- @param #string From
-- @param #string Event
-- @param #string To
--- Stop Trigger for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] Stop
-- @param #DETECTION_MANAGER self
--- Stop Asynchronous Trigger for DETECTION_MANAGER
-- @function [parent=#DETECTION_MANAGER] __Stop
-- @param #DETECTION_MANAGER self
-- @param #number Delay
self:AddTransition( "Started", "Report", "Started" )
self:SetReportInterval( 30 )

View File

@ -303,3 +303,27 @@ function UTILS.DoString( s )
return false, err
end
end
-- Here is a customized version of pairs, which I called spairs because it iterates over the table in a sorted order.
function UTILS.spairs( t, order )
-- collect the keys
local keys = {}
for k in pairs(t) do keys[#keys+1] = k end
-- if order function given, sort by it by passing the table and keys a, b,
-- otherwise just sort the keys
if order then
table.sort(keys, function(a,b) return order(t, a, b) end)
else
table.sort(keys)
end
-- return the iterator function
local i = 0
return function()
i = i + 1
if keys[i] then
return keys[i], t[keys[i]]
end
end
end

View File

@ -47,7 +47,7 @@
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method @{DCSWrapper.Airbase#Airbase.getName}()
-- is implemented in the AIRBASE class as @{#AIRBASE.GetName}().
--
-- @field #AIRBASE
-- @field #AIRBASE AIRBASE
AIRBASE = {
ClassName="AIRBASE",
CategoryName = {
@ -57,6 +57,31 @@ AIRBASE = {
},
}
--- @field Caucasus
AIRBASE.Caucasus = {
["Gelendzhik"] = "Gelendzhik",
["Krasnodar_Pashkovsky"] = "Krasnodar-Pashkovsky",
["Sukhumi_Babushara"] = "Sukhumi-Babushara",
["Gudauta"] = "Gudauta",
["Batumi"] = "Batumi",
["Senaki_Kolkhi"] = "Senaki-Kolkhi",
["Kobuleti"] = "Kobuleti",
["Kutaisi"] = "Kutaisi",
["Tbilisi_Lochini"] = "Tbilisi-Lochini",
["Soganlug"] = "Soganlug",
["Vaziani"] = "Vaziani",
["Anapa_Vityazevo"] = "Anapa-Vityazevo",
["Krasnodar_Center"] = "Krasnodar-Center",
["Novorossiysk"] = "Novorossiysk",
["Krymsk"] = "Krymsk",
["Maykop_Khanskaya"] = "Maykop-Khanskaya",
["Sochi_Adler"] = "Sochi-Adler",
["Mineralnye_Vody"] = "Mineralnye Vody",
["Nalchik"] = "Nalchik",
["Mozdok"] = "Mozdok",
["Beslan"] = "Beslan",
}
-- Registration.
--- Create a new AIRBASE from DCSAirbase.

View File

@ -152,7 +152,7 @@ CONTROLLABLE = {
-- @param Dcs.DCSWrapper.Controllable#Controllable ControllableName The DCS Controllable name
-- @return #CONTROLLABLE self
function CONTROLLABLE:New( ControllableName )
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) )
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) ) -- #CONTROLLABLE
self:F2( ControllableName )
self.ControllableName = ControllableName
@ -166,12 +166,10 @@ end
-- @param #CONTROLLABLE self
-- @return Dcs.DCSController#Controller
function CONTROLLABLE:_GetController()
self:F2( { self.ControllableName } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local ControllableController = DCSControllable:getController()
self:T3( ControllableController )
return ControllableController
end
@ -230,6 +228,36 @@ function CONTROLLABLE:GetLife()
return nil
end
--- Returns the initial health.
-- @param #CONTROLLABLE self
-- @return #number The controllable health value (unit or group average).
-- @return #nil The controllable is not existing or alive.
function CONTROLLABLE:GetLife0()
self:F2( self.ControllableName )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local UnitLife = 0
local Units = self:GetUnits()
if #Units == 1 then
local Unit = Units[1] -- Wrapper.Unit#UNIT
UnitLife = Unit:GetLife0()
else
local UnitLifeTotal = 0
for UnitID, Unit in pairs( Units ) do
local Unit = Unit -- Wrapper.Unit#UNIT
UnitLifeTotal = UnitLifeTotal + Unit:GetLife0()
end
UnitLife = UnitLifeTotal / #Units
end
return UnitLife
end
return nil
end
-- Tasks
@ -300,14 +328,13 @@ end
-- @param #CONTROLLABLE self
-- @return Wrapper.Controllable#CONTROLLABLE self
function CONTROLLABLE:SetTask( DCSTask, WaitTime )
self:F2( { DCSTask } )
self:F2( { DCSTask = DCSTask } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
self:T3( Controller )
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
-- Therefore we schedule the functions to set the mission and options for the Controllable.
@ -325,6 +352,24 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
return nil
end
--- Checking the Task Queue of the controllable. Returns false if no task is on the queue. true if there is a task.
-- @param #CONTROLLABLE self
-- @return Wrapper.Controllable#CONTROLLABLE self
function CONTROLLABLE:HasTask() --R2.2
local HasTaskResult = false
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
HasTaskResult = Controller:hasTask()
end
return HasTaskResult
end
--- Return a condition section for a controlled task.
-- @param #CONTROLLABLE self
@ -389,7 +434,7 @@ function CONTROLLABLE:TaskCombo( DCSTasks )
}
for TaskID, Task in ipairs( DCSTasks ) do
self:E( Task )
self:T( Task )
end
self:T3( { DCSTaskCombo } )
@ -588,7 +633,7 @@ function CONTROLLABLE:TaskAttackUnit( AttackUnit, GroupAttack, WeaponExpend, Att
}
}
self:E( DCSTask )
self:T3( DCSTask )
return DCSTask
end
@ -2183,6 +2228,57 @@ function CONTROLLABLE:OptionROTVertical()
return nil
end
--- Set RTB on bingo fuel.
-- @param #CONTROLLABLE self
-- @param #boolean RTB true if RTB on bingo fuel (default), false if no RTB on bingo fuel.
-- Warning! When you switch this option off, the airborne group will continue to fly until all fuel has been consumed, and will crash.
-- @return #CONTROLLABLE self
function CONTROLLABLE:OptionRTBBingoFuel( RTB ) --R2.2
self:F2( { self.ControllableName } )
RTB = RTB or true
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
if self:IsAir() then
Controller:setOption( AI.Option.Air.id.RTB_ON_BINGO, RTB )
end
return self
end
return nil
end
--- Set RTB on ammo.
-- @param #CONTROLLABLE self
-- @param #boolean WeaponsFlag Weapons.flag enumerator.
-- @return #CONTROLLABLE self
function CONTROLLABLE:OptionRTBAmmo( WeaponsFlag )
self:F2( { self.ControllableName } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
if self:IsAir() then
Controller:setOption( AI.Option.GROUND.id.RTB_ON_OUT_OF_AMMO, WeaponsFlag )
end
return self
end
return nil
end
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
-- Use the method @{Controllable#CONTROLLABLE:WayPointFunction} to define the hook functions for specific waypoints.
-- Use the method @{Controllable@CONTROLLABLE:WayPointExecute) to start the execution of the new mission plan.
@ -2250,7 +2346,7 @@ function CONTROLLABLE:TaskFunction( WayPoint, WayPointIndex, FunctionString, Fun
), WayPointIndex
)
self:T3( DCSTask )
self:T( DCSTask )
return DCSTask

View File

@ -91,6 +91,25 @@ GROUP = {
ClassName = "GROUP",
}
--- Enumerator for location at airbases
-- @type GROUP.Takeoff
GROUP.Takeoff = {
Air = 1,
Runway = 2,
Hot = 3,
Cold = 4,
}
GROUPTEMPLATE = {}
GROUPTEMPLATE.Takeoff = {
[GROUP.Takeoff.Air] = "Turning Point",
[GROUP.Takeoff.Runway] = "TakeOff",
[GROUP.Takeoff.Hot] = "TakeOffParkingHot",
[GROUP.Takeoff.Cold] = "TakeOffParking",
}
--- Create a new GROUP from a DCSGroup
-- @param #GROUP self
-- @param Dcs.DCSWrapper.Group#Group GroupName The DCS Group name

View File

@ -31,7 +31,18 @@
--
-- The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:
--
-- * @{Positionable#POSITIONABLE.New}(): Create a POSITIONABLE instance.
-- * @{#POSITIONABLE.New}(): Create a POSITIONABLE instance.
--
-- ## Get the current speed
--
-- There are 3 methods that can be used to determine the speed.
-- Use @{#POSITIONABLE.GetVelocityKMH}() to retrieve the current speed in km/h. Use @{#POSITIONABLE.GetVelocityMPS}() to retrieve the speed in meters per second.
-- The method @{#POSITIONABLE.GetVelocity}() returns the speed vector (a Vec3).
--
-- ## Get the current altitude
--
-- Altitude can be retrieved using the method @{#POSITIONABLE.GetHeight}() and returns the current altitude in meters from the orthonormal plane.
--
--
-- @field #POSITIONABLE
POSITIONABLE = {
@ -371,6 +382,25 @@ function POSITIONABLE:GetVelocityKMH()
return nil
end
--- Returns the POSITIONABLE velocity in meters per second.
-- @param Wrapper.Positionable#POSITIONABLE self
-- @return #number The velocity in meters per second.
-- @return #nil The POSITIONABLE is not existing or alive.
function POSITIONABLE:GetVelocityMPS()
self:F2( self.PositionableName )
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
local VelocityVec3 = self:GetVelocity()
local Velocity = ( VelocityVec3.x ^ 2 + VelocityVec3.y ^ 2 + VelocityVec3.z ^ 2 ) ^ 0.5 -- in meters / sec
self:T3( Velocity )
return Velocity
end
return nil
end
--- Returns the message text with the callsign embedded (if there is one).
-- @param #POSITIONABLE self

View File

@ -41,6 +41,11 @@ Functional/Detection.lua
Functional/Designate.lua
AI/AI_Balancer.lua
AI/AI_A2A.lua
AI/AI_A2A_Patrol.lua
AI/AI_A2A_Cap.lua
AI/AI_A2A_Gci.lua
AI/AI_A2A_Dispatcher.lua
AI/AI_Patrol.lua
AI/AI_Cap.lua
AI/AI_Cas.lua

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170522_1100' )
env.info( 'Moose Generation Timestamp: 20170612_0516' )
local base = _G
@ -60,6 +60,11 @@ __Moose.Include( 'Functional/AirbasePolice.lua' )
__Moose.Include( 'Functional/Detection.lua' )
__Moose.Include( 'Functional/Designate.lua' )
__Moose.Include( 'AI/AI_Balancer.lua' )
__Moose.Include( 'AI/AI_A2A.lua' )
__Moose.Include( 'AI/AI_A2A_Patrol.lua' )
__Moose.Include( 'AI/AI_A2A_Cap.lua' )
__Moose.Include( 'AI/AI_A2A_Gci.lua' )
__Moose.Include( 'AI/AI_A2A_Dispatcher.lua' )
__Moose.Include( 'AI/AI_Patrol.lua' )
__Moose.Include( 'AI/AI_Cap.lua' )
__Moose.Include( 'AI/AI_Cas.lua' )

View File

@ -39,3 +39,5 @@
@K=function, @M=Designate, @N=OnAfterStatus, @P=DESIGNATE , @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua, @C=15822,
@K=function, @M=Designate, @N=Status, @P=DESIGNATE , @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua, @C=16043,
@K=function, @M=Designate, @N=__Status, @P=DESIGNATE , @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua, @C=16166,
@K=function, @M=AI_A2A_Dispatcher, @N=onafterHome, @P=Fsm, @F=../../../MOOSE/Moose Development/Moose\AI\AI_A2A_Dispatcher.lua, @C=65028,
@K=function, @M=AI_A2A_Dispatcher, @N=onafterHome, @P=Fsm, @F=../../../MOOSE/Moose Development/Moose\AI\AI_A2A_Dispatcher.lua, @C=69237,

1 @K=function @M=Task_A2A @N=onafterRouteToRendezVous @P=Fsm @F=../../../MOOSE/Moose Development/Moose\Tasking\Task_A2A.lua @C=4242
39 @K=function @M=Designate @N=OnAfterStatus @P=DESIGNATE @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua @C=15822
40 @K=function @M=Designate @N=Status @P=DESIGNATE @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua @C=16043
41 @K=function @M=Designate @N=__Status @P=DESIGNATE @F=../../../MOOSE/Moose Development/Moose\Functional\Designate.lua @C=16166
42 @K=function @M=AI_A2A_Dispatcher @N=onafterHome @P=Fsm @F=../../../MOOSE/Moose Development/Moose\AI\AI_A2A_Dispatcher.lua @C=65028
43 @K=function @M=AI_A2A_Dispatcher @N=onafterHome @P=Fsm @F=../../../MOOSE/Moose Development/Moose\AI\AI_A2A_Dispatcher.lua @C=69237

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li>AI_Bai</li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li>AI_Balancer</li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li>AI_Cap</li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -921,9 +926,6 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p> This table contains the targets detected during patrol.</p>
</dd>
</dl>
<dl class="function">

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -131,6 +136,12 @@
<h2><a id="#(AIRBASE)">Type <code>AIRBASE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(AIRBASE).Caucasus">AIRBASE.Caucasus</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AIRBASE).Find">AIRBASE:Find(DCSAirbase)</a></td>
<td class="summary">
<p>Finds a AIRBASE from the _DATABASE using a DCSAirbase object.</p>
@ -218,6 +229,20 @@ is implemented in the AIRBASE class as <a href="##(AIRBASE).GetName">AIRBASE.Get
<dl class="function">
<dt>
<em></em>
<a id="#(AIRBASE).Caucasus" >
<strong>AIRBASE.Caucasus</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AIRBASE).Find" >
<strong>AIRBASE:Find(DCSAirbase)</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -3054,6 +3059,7 @@ The range till cargo will board.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(CARGO_UNIT).RunCount" >
<strong>CARGO_UNIT.RunCount</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -236,6 +241,12 @@
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).GetLife">CONTROLLABLE:GetLife()</a></td>
<td class="summary">
<p>Returns the health.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).GetLife0">CONTROLLABLE:GetLife0()</a></td>
<td class="summary">
<p>Returns the initial health.</p>
</td>
</tr>
<tr>
@ -260,6 +271,12 @@
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).GetWayPoints">CONTROLLABLE:GetWayPoints()</a></td>
<td class="summary">
<p>Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).HasTask">CONTROLLABLE:HasTask()</a></td>
<td class="summary">
<p>Checking the Task Queue of the controllable.</p>
</td>
</tr>
<tr>
@ -374,6 +391,18 @@
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).OptionROTVerticalPossible">CONTROLLABLE:OptionROTVerticalPossible()</a></td>
<td class="summary">
<p>Can the CONTROLLABLE evade on fire using vertical manoeuvres?</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).OptionRTBAmmo">CONTROLLABLE:OptionRTBAmmo(WeaponsFlag)</a></td>
<td class="summary">
<p>Set RTB on ammo.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).OptionRTBBingoFuel">CONTROLLABLE:OptionRTBBingoFuel(RTB)</a></td>
<td class="summary">
<p>Set RTB on bingo fuel.</p>
</td>
</tr>
<tr>
@ -560,12 +589,24 @@
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRoute">CONTROLLABLE:TaskRoute(Points)</a></td>
<td class="summary">
<p>Return a Misson task to follow a given route defined by Points.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRouteToVec2">CONTROLLABLE:TaskRouteToVec2(Vec2, Speed, Formation)</a></td>
<td class="summary">
<p>(GROUND) Route the controllable to a given Vec2.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRouteToZone">CONTROLLABLE:TaskRouteToZone(Zone, Randomize, Speed, Formation)</a></td>
<td class="summary">
<p>(AIR + GROUND) Route the controllable to a given zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskScheduler">CONTROLLABLE.TaskScheduler</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -602,6 +643,22 @@
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE)._GetController">CONTROLLABLE:_GetController()</a></td>
<td class="summary">
<p>Get the controller for the CONTROLLABLE.</p>
</td>
</tr>
</table>
<h2><a id="#(Vec2)">Type <code>Vec2</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(Vec2).x">Vec2.x</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(Vec2).y">Vec2.y</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -1446,6 +1503,34 @@ The controllable is not existing or alive. </p>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).GetLife0" >
<strong>CONTROLLABLE:GetLife0()</strong>
</a>
</dt>
<dd>
<p>Returns the initial health.</p>
<h3>Return values</h3>
<ol>
<li>
<p><em>#number:</em>
The controllable health value (unit or group average).</p>
</li>
<li>
<p><em>#nil:</em>
The controllable is not existing or alive. </p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).GetTaskMission" >
<strong>CONTROLLABLE:GetTaskMission()</strong>
</a>
@ -1519,6 +1604,27 @@ WayPoints If WayPoints is given, then return the WayPoints structure.</p>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).HasTask" >
<strong>CONTROLLABLE:HasTask()</strong>
</a>
</dt>
<dd>
<p>Checking the Task Queue of the controllable.</p>
<p>Returns false if no task is on the queue. true if there is a task.</p>
<h3>Return value</h3>
<p><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).IsAirPlane" >
<strong>CONTROLLABLE:IsAirPlane()</strong>
</a>
@ -1898,6 +2004,61 @@ self</p>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).OptionRTBAmmo" >
<strong>CONTROLLABLE:OptionRTBAmmo(WeaponsFlag)</strong>
</a>
</dt>
<dd>
<p>Set RTB on ammo.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean WeaponsFlag </em></code>:
Weapons.flag enumerator.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).OptionRTBBingoFuel" >
<strong>CONTROLLABLE:OptionRTBBingoFuel(RTB)</strong>
</a>
</dt>
<dd>
<p>Set RTB on bingo fuel.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean RTB </em></code>:
true if RTB on bingo fuel (default), false if no RTB on bingo fuel.
Warning! When you switch this option off, the airborne group will continue to fly until all fuel has been consumed, and will crash.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
@ -3092,6 +3253,44 @@ A table of route points.</p>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).TaskRouteToVec2" >
<strong>CONTROLLABLE:TaskRouteToVec2(Vec2, Speed, Formation)</strong>
</a>
</dt>
<dd>
<p>(GROUND) Route the controllable to a given Vec2.</p>
<p>A speed can be given in km/h.
A given formation can be given.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="##(Vec2)">#Vec2</a> Vec2 </em></code>:
The Vec2 where to route to.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed.</p>
</li>
<li>
<p><code><em><a href="Base.html##(FORMATION)">Base#FORMATION</a> Formation </em></code>:
The formation string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).TaskRouteToZone" >
<strong>CONTROLLABLE:TaskRouteToZone(Zone, Randomize, Speed, Formation)</strong>
</a>
@ -3132,6 +3331,20 @@ The formation string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(CONTROLLABLE).TaskScheduler" >
<strong>CONTROLLABLE.TaskScheduler</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -3315,6 +3528,37 @@ If WayPoints is given, then use the route.</p>
<h2><a id="#(DCSStopCondition)" >Type <code>DCSStopCondition</code></a></h2>
<h2><a id="#(Vec2)" >Type <code>Vec2</code></a></h2>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em></em>
<a id="#(Vec2).x" >
<strong>Vec2.x</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(Vec2).y" >
<strong>Vec2.y</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(list)" >Type <code>list</code></a></h2>
</div>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -895,6 +900,7 @@ function below will use the range 1-7 just in case</p>
<dl class="function">
<dt>
<em></em>
<a id="#(DESIGNATE).LaserCodes" >
<strong>DESIGNATE.LaserCodes</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -530,6 +535,12 @@ The different values of Unit.Category can be:</p>
</ul>
<p>Multiple Unit.Category entries can be given as a table and then these will be evaluated as an OR expression.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).ForgetDetectedUnit">DETECTION_BASE:ForgetDetectedUnit(UnitName)</a></td>
<td class="summary">
<p>Forget a Unit from a DetectionItem</p>
</td>
</tr>
<tr>
@ -2389,7 +2400,6 @@ The index of the DetectedItem.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong>
</a>
@ -2547,7 +2557,7 @@ The index of the DetectedItem.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectionInterval" >
<strong>DETECTION_BASE.DetectionInterval</strong>
</a>
@ -2682,6 +2692,33 @@ cs.DCSUnit#Unit> FilterCategories The Categories entries</p>
<p><em><a href="##(DETECTION_BASE)">#DETECTION_BASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_BASE).ForgetDetectedUnit" >
<strong>DETECTION_BASE:ForgetDetectedUnit(UnitName)</strong>
</a>
</dt>
<dd>
<p>Forget a Unit from a DetectionItem</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string UnitName </em></code>:
The UnitName that needs to be forgotten from the DetectionItem Sets.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DETECTION_BASE)">#DETECTION_BASE</a>:</em></p>
</dd>
</dl>
<dl class="function">

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -179,6 +184,30 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).New">DETECTION_MANAGER:New(SetGroup, Detection)</a></td>
<td class="summary">
<p>FAC constructor.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).OnAfterStart">DETECTION_MANAGER:OnAfterStart(From, Event, To)</a></td>
<td class="summary">
<p>Start Handler OnAfter for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).OnAfterStop">DETECTION_MANAGER:OnAfterStop(From, Event, To)</a></td>
<td class="summary">
<p>Stop Handler OnAfter for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).OnBeforeStart">DETECTION_MANAGER:OnBeforeStart(From, Event, To)</a></td>
<td class="summary">
<p>Start Handler OnBefore for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).OnBeforeStop">DETECTION_MANAGER:OnBeforeStop(From, Event, To)</a></td>
<td class="summary">
<p>Stop Handler OnBefore for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
@ -203,6 +232,18 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).SetReportInterval">DETECTION_MANAGER:SetReportInterval(ReportInterval)</a></td>
<td class="summary">
<p>Set the reporting time interval.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).Start">DETECTION_MANAGER:Start()</a></td>
<td class="summary">
<p>Start Trigger for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).Stop">DETECTION_MANAGER:Stop()</a></td>
<td class="summary">
<p>Stop Trigger for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
@ -215,6 +256,18 @@ If an ad-hoc report is requested, use the method <a href="DetectionManager.html#
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER)._ReportInterval">DETECTION_MANAGER._ReportInterval</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).__Start">DETECTION_MANAGER:__Start(Delay)</a></td>
<td class="summary">
<p>Start Asynchronous Trigger for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_MANAGER).__Stop">DETECTION_MANAGER:__Stop(Delay)</a></td>
<td class="summary">
<p>Stop Asynchronous Trigger for DETECTION_MANAGER</p>
</td>
</tr>
<tr>
@ -382,6 +435,140 @@ ReportDisplayTime The display time in seconds when a report needs to be done.</p
<p><em><a href="##(DETECTION_MANAGER)">#DETECTION_MANAGER</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).OnAfterStart" >
<strong>DETECTION_MANAGER:OnAfterStart(From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Start Handler OnAfter for DETECTION_MANAGER</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).OnAfterStop" >
<strong>DETECTION_MANAGER:OnAfterStop(From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Stop Handler OnAfter for DETECTION_MANAGER</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).OnBeforeStart" >
<strong>DETECTION_MANAGER:OnBeforeStart(From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Start Handler OnBefore for DETECTION_MANAGER</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).OnBeforeStop" >
<strong>DETECTION_MANAGER:OnBeforeStop(From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Stop Handler OnBefore for DETECTION_MANAGER</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
@ -476,6 +663,32 @@ The interval in seconds when a report needs to be done.</p>
<p><em><a href="##(DETECTION_MANAGER)">#DETECTION_MANAGER</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).Start" >
<strong>DETECTION_MANAGER:Start()</strong>
</a>
</dt>
<dd>
<p>Start Trigger for DETECTION_MANAGER</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).Stop" >
<strong>DETECTION_MANAGER:Stop()</strong>
</a>
</dt>
<dd>
<p>Stop Trigger for DETECTION_MANAGER</p>
</dd>
</dl>
<dl class="function">
@ -504,6 +717,48 @@ self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).__Start" >
<strong>DETECTION_MANAGER:__Start(Delay)</strong>
</a>
</dt>
<dd>
<p>Start Asynchronous Trigger for DETECTION_MANAGER</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_MANAGER).__Stop" >
<strong>DETECTION_MANAGER:__Stop(Delay)</strong>
</a>
</dt>
<dd>
<p>Stop Asynchronous Trigger for DETECTION_MANAGER</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -1599,7 +1604,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<em>#string</em>
<a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong>
</a>
@ -1898,7 +1903,6 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -140,6 +145,12 @@
<h1>GROUP class, extends <a href="Controllable.html##(CONTROLLABLE)">Controllable#CONTROLLABLE</a></h1>
<p>For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _<a href="DATABASE.html">DATABASE</a> object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#GROUPTEMPLATE">GROUPTEMPLATE</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -493,12 +504,46 @@
<td class="name" nowrap="nowrap"><a href="##(GROUP).SetTemplateCountry">GROUP:SetTemplateCountry(CountryID, Template)</a></td>
<td class="summary">
<p>Sets the CountryID of the group in a Template.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP).Takeoff">GROUP.Takeoff</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP).UnHandleEvent">GROUP:UnHandleEvent(Event)</a></td>
<td class="summary">
<p>UnSubscribe to a DCS event.</p>
</td>
</tr>
</table>
<h2><a id="#(GROUP.Takeoff)">Type <code>GROUP.Takeoff</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP.Takeoff).Air">GROUP.Takeoff.Air</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP.Takeoff).Cold">GROUP.Takeoff.Cold</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP.Takeoff).Hot">GROUP.Takeoff.Hot</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(GROUP.Takeoff).Runway">GROUP.Takeoff.Runway</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -579,6 +624,20 @@ Use the following Zone validation methods on the group:</p>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="GROUPTEMPLATE" >
<strong>GROUPTEMPLATE</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Group)" >Type <code>Group</code></a></h2>
@ -1985,6 +2044,20 @@ The country ID.</p>
<p><em>#table:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(GROUP.Takeoff)">#GROUP.Takeoff</a></em>
<a id="#(GROUP).Takeoff" >
<strong>GROUP.Takeoff</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -2011,6 +2084,68 @@ The country ID.</p>
<p><em><a href="##(GROUP)">#GROUP</a>:</em></p>
</dd>
</dl>
<h2><a id="#(GROUP.Takeoff)" >Type <code>GROUP.Takeoff</code></a></h2>
<p>Enumerator for location at airbases</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(GROUP.Takeoff).Air" >
<strong>GROUP.Takeoff.Air</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(GROUP.Takeoff).Cold" >
<strong>GROUP.Takeoff.Cold</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(GROUP.Takeoff).Hot" >
<strong>GROUP.Takeoff.Hot</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(GROUP.Takeoff).Runway" >
<strong>GROUP.Takeoff.Runway</strong>
</a>
</dt>
<dd>
</dd>
</dl>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -1684,7 +1689,7 @@ The z coordinate of the Vec3 point, pointing to the Right.</p>
</ul>
<h3>Return value</h3>
<p><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>:</em></p>
<p><em><a href="##(COORDINATE)">#COORDINATE</a>:</em></p>
</dd>
@ -1744,7 +1749,7 @@ The Vec3 point.</p>
</ul>
<h3>Return value</h3>
<p><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>:</em></p>
<p><em><a href="##(COORDINATE)">#COORDINATE</a>:</em></p>
</dd>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -252,6 +257,12 @@
<td class="name" nowrap="nowrap"><a href="##(POSITIONABLE).GetVelocityKMH">POSITIONABLE:GetVelocityKMH()</a></td>
<td class="summary">
<p>Returns the POSITIONABLE velocity in km/h.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POSITIONABLE).GetVelocityMPS">POSITIONABLE:GetVelocityMPS()</a></td>
<td class="summary">
<p>Returns the POSITIONABLE velocity in meters per second.</p>
</td>
</tr>
<tr>
@ -388,9 +399,20 @@
<p>The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:</p>
<ul>
<li><a href="Positionable.html##(POSITIONABLE).New">Positionable#POSITIONABLE.New</a>(): Create a POSITIONABLE instance.</li>
<li><a href="##(POSITIONABLE).New">POSITIONABLE.New</a>(): Create a POSITIONABLE instance.</li>
</ul>
<h2>Get the current speed</h2>
<p>There are 3 methods that can be used to determine the speed.
Use <a href="##(POSITIONABLE).GetVelocityKMH">POSITIONABLE.GetVelocityKMH</a>() to retrieve the current speed in km/h. Use <a href="##(POSITIONABLE).GetVelocityMPS">POSITIONABLE.GetVelocityMPS</a>() to retrieve the speed in meters per second.
The method <a href="##(POSITIONABLE).GetVelocity">POSITIONABLE.GetVelocity</a>() returns the speed vector (a Vec3).</p>
<h2>Get the current altitude</h2>
<p>Altitude can be retrieved using the method <a href="##(POSITIONABLE).GetHeight">POSITIONABLE.GetHeight</a>() and returns the current altitude in meters from the orthonormal plane.</p>
</dd>
</dl>
@ -946,6 +968,34 @@ The POSITIONABLE is not existing or alive. </p>
<dl class="function">
<dt>
<a id="#(POSITIONABLE).GetVelocityMPS" >
<strong>POSITIONABLE:GetVelocityMPS()</strong>
</a>
</dt>
<dd>
<p>Returns the POSITIONABLE velocity in meters per second.</p>
<h3>Return values</h3>
<ol>
<li>
<p><em>#number:</em>
The velocity in meters per second.</p>
</li>
<li>
<p><em>#nil:</em>
The POSITIONABLE is not existing or alive. </p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(POSITIONABLE).InAir" >
<strong>POSITIONABLE:InAir()</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -368,7 +373,8 @@ Nothing of this code should be modified without testing it thoroughly.</p>
<p> or {}</p>
<p> Initialize the ObjectSchedulers array, which is a weakly coupled table.
If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.</p>
</dd>
</dl>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -412,6 +417,12 @@
<td class="name" nowrap="nowrap"><a href="##(SET_BASE).GetLast">SET_BASE:GetLast()</a></td>
<td class="summary">
<p>Gets the last object from the <a href="Set.html##(SET_BASE)">Set#SET_BASE</a> and derived classes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET_BASE).GetObjectNames">SET_BASE:GetObjectNames()</a></td>
<td class="summary">
<p>Gets a string with all the object names.</p>
</td>
</tr>
<tr>
@ -2159,6 +2170,24 @@ self</p>
<p><em><a href="Core.Base.html##(BASE)">Core.Base#BASE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET_BASE).GetObjectNames" >
<strong>SET_BASE:GetObjectNames()</strong>
</a>
</dt>
<dd>
<p>Gets a string with all the object names.</p>
<h3>Return value</h3>
<p><em>#string:</em>
A string with the names of the objects.</p>
</dd>
</dl>
<dl class="function">

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -185,6 +190,12 @@
<td class="name" nowrap="nowrap"><a href="##(SPAWN).DelayOnOff">SPAWN.DelayOnOff</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetCoordinate">SPAWN:GetCoordinate()</a></td>
<td class="summary">
<p>Get the Coordinate of the Group that is Late Activated as the template for the SPAWN object.</p>
</td>
</tr>
<tr>
@ -215,6 +226,12 @@
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetSpawnIndexFromGroup">SPAWN:GetSpawnIndexFromGroup(SpawnGroup)</a></td>
<td class="summary">
<p>Get the index from a given group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Grouping">SPAWN.Grouping</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -263,6 +280,12 @@
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitDelayOnOff">SPAWN:InitDelayOnOff(DelayOnOff)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitGrouping">SPAWN:InitGrouping(Grouping)</a></td>
<td class="summary">
<p>When spawning a new group, make the grouping of the units according the InitGrouping setting.</p>
</td>
</tr>
<tr>
@ -397,6 +420,12 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnAliasPrefix">SPAWN.SpawnAliasPrefix</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnAtAirbase">SPAWN:SpawnAtAirbase(Airbase, Takeoff)</a></td>
<td class="summary">
<p>Will spawn a group at an airbase.</p>
</td>
</tr>
<tr>
@ -457,6 +486,12 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnGroupName">SPAWN:SpawnGroupName(SpawnIndex)</a></td>
<td class="summary">
<p>Will return the SpawnGroupName either with with a specific count number or without any count.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnGrouping">SPAWN.SpawnGrouping</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -655,6 +690,12 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnZoneTable">SPAWN.SpawnZoneTable</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Takeoff">SPAWN.Takeoff</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -781,6 +822,16 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(SPAWN.Takeoff)">Type <code>SPAWN.Takeoff</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN.Takeoff).type">SPAWN.Takeoff.type</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -1128,6 +1179,24 @@ can be used to switch off the initial delay. Because there is no delay by defaul
<dl class="function">
<dt>
<a id="#(SPAWN).GetCoordinate" >
<strong>SPAWN:GetCoordinate()</strong>
</a>
</dt>
<dd>
<p>Get the Coordinate of the Group that is Late Activated as the template for the SPAWN object.</p>
<h3>Return value</h3>
<p><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>:</em>
The Coordinate</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetFirstAliveGroup" >
<strong>SPAWN:GetFirstAliveGroup()</strong>
</a>
@ -1299,6 +1368,22 @@ end</code></pre>
<dl class="function">
<dt>
<a id="#(SPAWN).Grouping" >
<strong>SPAWN.Grouping</strong>
</a>
</dt>
<dd>
<p> No grouping</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitAIOff" >
<strong>SPAWN:InitAIOff()</strong>
</a>
@ -1502,6 +1587,33 @@ The SPAWN object</p>
<dl class="function">
<dt>
<a id="#(SPAWN).InitGrouping" >
<strong>SPAWN:InitGrouping(Grouping)</strong>
</a>
</dt>
<dd>
<p>When spawning a new group, make the grouping of the units according the InitGrouping setting.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Grouping </em></code>:
Indicates the maximum amount of units in the group. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitKeepUnitNames" >
<strong>SPAWN:InitKeepUnitNames()</strong>
</a>
@ -2082,6 +2194,9 @@ The group that was spawned. You can use this group for further actions.</p>
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
</dd>
</dl>
<dl class="function">
@ -2145,6 +2260,54 @@ The group that was spawned. You can use this group for further actions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnAtAirbase" >
<strong>SPAWN:SpawnAtAirbase(Airbase, Takeoff)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group at an airbase.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning units at an airbase.
Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
You can use the returned group to further define the route to be followed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> Airbase </em></code>:
The <a href="Airbase.html">Airbase</a> where to spawn the group.</p>
</li>
<li>
<p><code><em><a href="##(SPAWN.Takeoff)">#SPAWN.Takeoff</a> Takeoff </em></code>:
(optional) The location and takeoff method. Default is Hot.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
@ -2436,6 +2599,20 @@ Is the number of the Group that is to be spawned.</p>
<p><em>#string:</em>
SpawnGroupName</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnGrouping" >
<strong>SPAWN.SpawnGrouping</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -2552,6 +2729,9 @@ when nothing was spawned.</p>
<p> Overwrite unit names by default with group name.</p>
</dd>
</dl>
<dl class="function">
@ -2566,6 +2746,9 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd>
</dl>
<dl class="function">
@ -2601,7 +2784,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong>
</a>
@ -2618,7 +2801,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a>
@ -2946,7 +3129,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function">
<dt>
<em></em>
<em>#boolean</em>
<a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong>
</a>
@ -2970,7 +3153,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
</dd>
</dl>
@ -3016,6 +3199,20 @@ The group that was spawned. You can use this group for further actions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(SPAWN.Takeoff)">#SPAWN.Takeoff</a></em>
<a id="#(SPAWN).Takeoff" >
<strong>SPAWN.Takeoff</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -3541,6 +3738,25 @@ True = Continue Scheduler</p>
<h2><a id="#(SPAWN.SpawnZoneTable)" >Type <code>SPAWN.SpawnZoneTable</code></a></h2>
<h2><a id="#(SPAWN.Takeoff)" >Type <code>SPAWN.Takeoff</code></a></h2>
<p>Enumerator for spawns at airbases</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(SPAWN.Takeoff).type" >
<strong>SPAWN.Takeoff.type</strong>
</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
@ -760,7 +765,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).ScheduleID" >
<strong>SPOT.ScheduleID</strong>
</a>
@ -774,7 +778,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).SpotIR" >
<strong>SPOT.SpotIR</strong>
</a>
@ -788,7 +791,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).SpotLaser" >
<strong>SPOT.SpotLaser</strong>
</a>
@ -802,7 +804,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).Target" >
<strong>SPOT.Target</strong>
</a>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

View File

@ -17,6 +17,11 @@
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>

Some files were not shown because too many files have changed in this diff Show More