Module AI.AI_A2A_Cap
AI - Models the process of Combat Air Patrol (CAP) for airplanes.
This is a class used in the AI.AI_A2A_Dispatcher.
Author: FlightControl
Global(s)
Global AI_A2A_CAP |
The AI_A2A_CAP class implements the core functions to patrol a Core.Zone by an AI Wrapper.Group or Wrapper.Group and automatically engage any airborne enemies that are within a certain range or within a certain zone. |
The AI_A2A_CAP class implements the core functions to patrol a Core.Zone by an AI Wrapper.Group or Wrapper.Group and automatically engage any airborne enemies that are within a certain range or within a certain zone.
The AI_A2A_CAP is assigned a Wrapper.Group and this must be done before the AI_A2A_CAP 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 threshold has been reached by the AI, or when the AI is commanded to RTB. When the fuel threshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
1. AI_A2A_CAP constructor
- AI_A2A_CAP.New(): Creates a new AI_A2A_CAP object.
2. AI_A2A_CAP is a FSM
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.AI_Patrol#AI_PATROL_ZONE.Start**: Start the process.
- **AI.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.AI_Patrol#AI_PATROL_ZONE.RTB**: Route the AI to the home base.
- **AI.AI_Patrol#AI_PATROL_ZONE.Detect**: The AI is detecting targets.
- **AI.AI_Patrol#AI_PATROL_ZONE.Detected**: The AI has detected new targets.
- **AI_A2A_CAP.Destroy**: The AI has destroyed a bogey Wrapper.Unit.
- **AI_A2A_CAP.Destroyed**: The AI has destroyed all bogeys Wrapper.Units assigned in the CAS task.
- Status ( Group ): The AI is checking status (fuel and damage). When the thresholds 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 AI_A2A_CAP.SetEngageRange() to define that range.
4. Set the Zone of Engagement
An optional Core.Zone can be set, that will define when the AI will engage with the detected airborne enemy targets. Use the method AI_A2A_CAP.SetEngageZone() to define that Zone.
Developer Note
Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated
Type(s)
Fields and Methods inherited from AI_A2A_CAP | Description |
---|---|
AI_A2A_CAP:CreateAttackUnitTasks(AttackSetUnit, DefenderGroup, EngageAltitude) |
Evaluate the attack and create an AttackUnitTask list. |
Creates a new AI_A2A_CAP object |
|
Creates a new AI_A2A_CAP object |
|
Set the Engage Range when the AI will engage with airborne enemies. |
|
Set the Engage Zone which defines where the AI will engage bogies. |
|
onafter State Transition for Event Patrol. |
Field(s)
Function(s)
Evaluate the attack and create an AttackUnitTask list.
Defined in:
AI_A2A_CAP
Parameters:
Core.Set#SET_UNIT AttackSetUnit
The set of units to attack.
Wrapper.Group#GROUP DefenderGroup
The group of defenders.
#number EngageAltitude
The altitude to engage the targets.
Return value:
self
Creates a new AI_A2A_CAP object
Defined in:
AI_A2A_CAP
Parameters:
Wrapper.Group#GROUP AICap
Core.Zone#ZONE_BASE PatrolZone
The Core.Zone where the patrol needs to be executed.
DCS#Altitude PatrolFloorAltitude
The lowest altitude in meters where to execute the patrol.
DCS#Altitude PatrolCeilingAltitude
The highest altitude in meters where to execute the patrol.
DCS#Speed PatrolMinSpeed
The minimum speed of the Wrapper.Group in km/h.
DCS#Speed PatrolMaxSpeed
The maximum speed of the Wrapper.Group in km/h.
DCS#Speed EngageMinSpeed
The minimum speed of the Wrapper.Group in km/h when engaging a target.
DCS#Speed EngageMaxSpeed
The maximum speed of the Wrapper.Group in km/h when engaging a target.
DCS#AltitudeType PatrolAltType
The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO
Return value:
Creates a new AI_A2A_CAP object
Defined in:
AI_A2A_CAP
Parameters:
Wrapper.Group#GROUP AICap
DCS#Speed EngageMinSpeed
The minimum speed of the Wrapper.Group in km/h when engaging a target.
DCS#Speed EngageMaxSpeed
The maximum speed of the Wrapper.Group in km/h when engaging a target.
DCS#Altitude EngageFloorAltitude
The lowest altitude in meters where to execute the engagement.
DCS#Altitude EngageCeilingAltitude
The highest altitude in meters where to execute the engagement.
DCS#AltitudeType EngageAltType
The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
Core.Zone#ZONE_BASE PatrolZone
The Core.Zone where the patrol needs to be executed.
DCS#Speed PatrolMinSpeed
The minimum speed of the Wrapper.Group in km/h.
DCS#Speed PatrolMaxSpeed
The maximum speed of the Wrapper.Group in km/h.
DCS#Altitude PatrolFloorAltitude
The lowest altitude in meters where to execute the patrol.
DCS#Altitude PatrolCeilingAltitude
The highest altitude in meters where to execute the patrol.
DCS#AltitudeType PatrolAltType
The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".
Return value:
Set the Engage Range when the AI will engage with airborne enemies.
Defined in:
AI_A2A_CAP
Parameter:
#number EngageRange
The Engage Range.
Return value:
self
Set the Engage Zone which defines where the AI will engage bogies.
Defined in:
AI_A2A_CAP
Parameter:
Core.Zone#ZONE EngageZone
The zone where the AI is performing CAP.
Return value:
self
onafter State Transition for Event Patrol.
Defined in:
AI_A2A_CAP
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.