Module AI_A2A_Cap
AI -- Execute Combat Air Patrol (CAP).
AI CAP classes makes AI Groups execute a Combat Air Patrol.
There are the following types of CAP classes defined:
- #AIA2ACAP: Perform a CAP in a zone.
Author: Sven Van de Velde (FlightControl)
Contributions:
- Quax: Concept, Advice & Testing.
- Pikey: Concept, Advice & Testing.
- Gunterlund: Test case revision.
- **Whisper: Testing.
- **Delta99: Testing.
Global(s)
| AI_A2A_CAP |
AIA2ACAP class, extends AICAP#AIPATROL_ZONEThe AIA2ACAP class implements the core functions to patrol a Zone by an AI Group or Group and automatically engage any airborne enemies that are within a certain range or within a certain zone. |
Type AI_A2A_CAP
Global(s)
- #AI_A2A_CAP AI_A2A_CAP
-
AIA2ACAP class, extends AICAP#AIPATROL_ZONE
The AIA2ACAP class implements the core functions to patrol a Zone by an AI Group or Group and automatically engage any airborne enemies that are within a certain range or within a certain zone.
The AIA2ACAP is assigned a Group and this must be done before the AIA2ACAP process can be started using the Start event.
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.
This cycle will continue.
During the patrol, the AI will detect enemy targets, which are reported through the Detected event.
When enemies are detected, the AI will automatically engage the enemy.
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.
1. AIA2ACAP constructor
- AIA2ACAP.New(): Creates a new AIA2ACAP object.
2. AIA2ACAP is a FSM
2.1 AIA2ACAP 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 AIA2ACAP Events
- **AIPatrol#AIPATROL_ZONE.Start**: Start the process.
- **AIPatrol#AIPATROL_ZONE.Route**: Route the AI to a new random 3D point within the Patrol Zone.
- **AIA2ACAP.Engage**: Let the AI engage the bogeys.
- **AIA2ACAP.Abort**: Aborts the engagement and return patrolling in the patrol zone.
- **AIPatrol#AIPATROL_ZONE.RTB**: Route the AI to the home base.
- **AIPatrol#AIPATROL_ZONE.Detect**: The AI is detecting targets.
- **AIPatrol#AIPATROL_ZONE.Detected**: The AI has detected new targets.
- **AIA2ACAP.Destroy**: The AI has destroyed a bogey Unit.
- **AIA2ACAP.Destroyed**: The AI has destroyed all bogeys Units 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
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 AICAP#AIA2A_CAP.SetEngageRange() to define that range.
4. Set the Zone of Engagement
An optional Zone can be set, that will define when the AI will engage with the detected airborne enemy targets. Use the method AICap#AIA2A_CAP.SetEngageZone() to define that Zone.
Type AI_A2A_Cap
Type AI_A2A
Type AI_A2A_CAP
Field(s)
- AI_A2A_CAP:Abort()
-
Synchronous Event Trigger for Event Abort.
- AI_A2A_CAP:Accomplish()
-
Synchronous Event Trigger for Event Accomplish.
- #boolean AI_A2A_CAP.Accomplished
- AI_A2A_CAP.AttackRoute(AICap, Fsm)
-
Parameters
-
Wrapper.Group#GROUP AICap: -
Fsm:
-
- AI_A2A_CAP:Destroy()
-
Synchronous Event Trigger for Event Destroy.
- AI_A2A_CAP:Engage()
-
Synchronous Event Trigger for Event Engage.
- #boolean AI_A2A_CAP.Engaging
- AI_A2A_CAP:Fired()
-
Synchronous Event Trigger for Event Fired.
- AI_A2A_CAP:New(AICap, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageMinSpeed, EngageMaxSpeed, PatrolAltType)
-
Creates a new AIA2ACAP object
Parameters
-
Wrapper.Group#GROUP AICap: -
Core.Zone#ZONE_BASE PatrolZone: The Zone where the patrol needs to be executed. -
Dcs.DCSTypes#Altitude PatrolFloorAltitude: The lowest altitude in meters where to execute the patrol. -
Dcs.DCSTypes#Altitude PatrolCeilingAltitude: The highest altitude in meters where to execute the patrol. -
Dcs.DCSTypes#Speed PatrolMinSpeed: The minimum speed of the Group in km/h. -
Dcs.DCSTypes#Speed PatrolMaxSpeed: The maximum speed of the Group in km/h. -
Dcs.DCSTypes#Speed EngageMinSpeed: The minimum speed of the Group in km/h when engaging a target. -
Dcs.DCSTypes#Speed EngageMaxSpeed: The maximum speed of the Group in km/h when engaging a target. -
Dcs.DCSTypes#AltitudeType PatrolAltType: The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO
Return value
-
- AI_A2A_CAP:OnAfterAbort(AICap, From, Event, To)
-
OnAfter Transition Handler for Event Abort.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnAfterAccomplish(AICap, From, Event, To)
-
OnAfter Transition Handler for Event Accomplish.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnAfterDestroy(AICap, From, Event, To)
-
OnAfter Transition Handler for Event Destroy.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnAfterEngage(AICap, From, Event, To)
-
OnAfter Transition Handler for Event Engage.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnAfterFired(AICap, From, Event, To)
-
OnAfter Transition Handler for Event Fired.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnBeforeAbort(AICap, From, Event, To)
-
OnBefore Transition Handler for Event Abort.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP:OnBeforeAccomplish(AICap, From, Event, To)
-
OnBefore Transition Handler for Event Accomplish.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP:OnBeforeDestroy(AICap, From, Event, To)
-
OnBefore Transition Handler for Event Destroy.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP:OnBeforeEngage(AICap, From, Event, To)
-
OnBefore Transition Handler for Event Engage.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP:OnBeforeFired(AICap, From, Event, To)
-
OnBefore Transition Handler for Event Fired.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP:OnEnterEngaging(AICap, From, Event, To)
-
OnEnter Transition Handler for State Engaging.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:OnEventDead(EventData)
-
Parameter
-
Core.Event#EVENTDATA EventData:
-
- AI_A2A_CAP:OnLeaveEngaging(AICap, From, Event, To)
-
OnLeave Transition Handler for State Engaging.
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
Return value
#boolean: Return false to cancel Transition.
-
- AI_A2A_CAP.Resume(AICap)
-
Parameter
-
Wrapper.Group#GROUP AICap:
-
- AI_A2A_CAP:SetEngageRange(EngageRange)
-
Set the Engage Range when the AI will engage with airborne enemies.
Parameter
-
#number EngageRange: The Engage Range.
Return value
#AIA2ACAP: self
-
- AI_A2A_CAP:SetEngageZone(EngageZone)
-
Set the Engage Zone which defines where the AI will engage bogies.
Parameter
-
Core.Zone#ZONE EngageZone: The zone where the AI is performing CAP.
Return value
#AIA2ACAP: self
-
- AI_A2A_CAP:__Abort(Delay)
-
Asynchronous Event Trigger for Event Abort.
Parameter
-
#number Delay: The delay in seconds.
-
- AI_A2A_CAP:__Accomplish(Delay)
-
Asynchronous Event Trigger for Event Accomplish.
Parameter
-
#number Delay: The delay in seconds.
-
- AI_A2A_CAP:__Destroy(Delay)
-
Asynchronous Event Trigger for Event Destroy.
Parameter
-
#number Delay: The delay in seconds.
-
- AI_A2A_CAP:__Engage(Delay)
-
Asynchronous Event Trigger for Event Engage.
Parameter
-
#number Delay: The delay in seconds.
-
- AI_A2A_CAP:__Fired(Delay)
-
Asynchronous Event Trigger for Event Fired.
Parameter
-
#number Delay: The delay in seconds.
-
- AI_A2A_CAP:onafterAbort(AICap, From, Event, To)
-
Parameters
-
Wrapper.Group#GROUP AICap: The AI Group managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:onafterAccomplish(AICap, From, Event, To)
-
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:onafterDestroy(AICap, From, Event, To, EventData)
-
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string. -
Core.Event#EVENTDATA EventData:
-
- AI_A2A_CAP:onafterEngage(AICap, From, Event, To, AttackSetUnit)
-
Parameters
-
Wrapper.Group#GROUP AICap: The AICap Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string. -
AttackSetUnit:
-
- AI_A2A_CAP:onafterPatrol(AICap, From, Event, To)
-
onafter State Transition for Event Patrol.
Parameters
-
Wrapper.Group#GROUP AICap: The AI Group managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:onafterStart(AICap, From, Event, To)
-
onafter State Transition for Event Patrol.
Parameters
-
Wrapper.Group#GROUP AICap: The AI Group managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-
- AI_A2A_CAP:onbeforeEngage(AICap, From, Event, To)
-
Parameters
-
Wrapper.Group#GROUP AICap: The Group Object managed by the FSM. -
#string From: The From State string. -
#string Event: The Event string. -
#string To: The To State string.
-