Banner Image

Module AI.AI_Air_Engage

AI -- Models the process of air to ground engagement for airplanes and helicopters.

This is a class used in the AI_A2G_Dispatcher.


Author: FlightControl


Global(s)

Global AI_AIR_ENGAGE

Implements the core functions to intercept intruders.

#AI_AIR_ENGAGE AI_AIR_ENGAGE

Implements the core functions to intercept intruders.

Use the Engage trigger to intercept intruders.

Process

The AI_AIR_ENGAGE is assigned a Wrapper.Group and this must be done before the AI_AIR_ENGAGE process can be started using the Start event.

Process

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

This cycle will continue.

Process

During the patrol, the AI will detect enemy targets, which are reported through the Detected event.

Process

When enemies are detected, the AI will automatically engage the enemy.

Process

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

1. AI_AIR_ENGAGE constructor

3. Set the Range of Engagement

Range

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.AI_GCI#AI_AIR_ENGAGE.SetEngageRange() to define that range.

4. Set the Zone of Engagement

Zone

An optional Zone can be set, that will define when the AI will engage with the detected airborne enemy targets. Use the method AI.AI_Cap#AI_AIR_ENGAGE.SetEngageZone() to define that Zone.


Type(s)

Fields and Methods inherited from AI_AIR_ENGAGE Description

AI_AIR_ENGAGE:Abort()

Synchronous Event Trigger for Event Abort.

AI_AIR_ENGAGE:Accomplish()

Synchronous Event Trigger for Event Accomplish.

AI_AIR_ENGAGE.Accomplished

AI_AIR_ENGAGE.AttackSetUnit

AI_AIR_ENGAGE:Destroy()

Synchronous Event Trigger for Event Destroy.

AI_AIR_ENGAGE:Engage()

Synchronous Event Trigger for Event Engage.

AI_AIR_ENGAGE.EngageAltType

AI_AIR_ENGAGE.EngageCeilingAltitude

AI_AIR_ENGAGE.EngageFloorAltitude

AI_AIR_ENGAGE.EngageMaxSpeed

AI_AIR_ENGAGE.EngageMinSpeed

AI_AIR_ENGAGE:EngageRoute()

Synchronous Event Trigger for Event EngageRoute.

AI_AIR_ENGAGE.Engaging

AI_AIR_ENGAGE:Fired()

Synchronous Event Trigger for Event Fired.

AI_AIR_ENGAGE:New(AI_Air, AIGroup, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType)

Creates a new AI_AIR_ENGAGE object

AI_AIR_ENGAGE:OnAfterAbort(AIGroup, From, Event, To)

OnAfter Transition Handler for Event Abort.

AI_AIR_ENGAGE:OnAfterAccomplish(AIGroup, From, Event, To)

OnAfter Transition Handler for Event Accomplish.

AI_AIR_ENGAGE:OnAfterDestroy(AIGroup, From, Event, To)

OnAfter Transition Handler for Event Destroy.

AI_AIR_ENGAGE:OnAfterEngage(AIGroup, From, Event, To)

OnAfter Transition Handler for Event Engage.

AI_AIR_ENGAGE:OnAfterEngageRoute(AIGroup, From, Event, To)

OnAfter Transition Handler for Event EngageRoute.

AI_AIR_ENGAGE:OnAfterFired(AIGroup, From, Event, To)

OnAfter Transition Handler for Event Fired.

AI_AIR_ENGAGE:OnBeforeAbort(AIGroup, From, Event, To)

OnBefore Transition Handler for Event Abort.

AI_AIR_ENGAGE:OnBeforeAccomplish(AIGroup, From, Event, To)

OnBefore Transition Handler for Event Accomplish.

AI_AIR_ENGAGE:OnBeforeDestroy(AIGroup, From, Event, To)

OnBefore Transition Handler for Event Destroy.

AI_AIR_ENGAGE:OnBeforeEngage(AIGroup, From, Event, To)

OnBefore Transition Handler for Event Engage.

AI_AIR_ENGAGE:OnBeforeEngageRoute(AIGroup, From, Event, To)

OnBefore Transition Handler for Event EngageRoute.

AI_AIR_ENGAGE:OnBeforeFired(AIGroup, From, Event, To)

OnBefore Transition Handler for Event Fired.

AI_AIR_ENGAGE:OnEnterEngaging(AIGroup, From, Event, To)

OnEnter Transition Handler for State Engaging.

AI_AIR_ENGAGE:OnEventDead(EventData)

AI_AIR_ENGAGE:OnLeaveEngaging(AIGroup, From, Event, To)

OnLeave Transition Handler for State Engaging.

AI_AIR_ENGAGE.Resume(AIEngage, Fsm)

AI_AIR_ENGAGE:__Abort(Delay)

Asynchronous Event Trigger for Event Abort.

AI_AIR_ENGAGE:__Accomplish(Delay)

Asynchronous Event Trigger for Event Accomplish.

AI_AIR_ENGAGE:__Destroy(Delay)

Asynchronous Event Trigger for Event Destroy.

AI_AIR_ENGAGE:__Engage(Delay)

Asynchronous Event Trigger for Event Engage.

AI_AIR_ENGAGE:__EngageRoute(Delay)

Asynchronous Event Trigger for Event EngageRoute.

AI_AIR_ENGAGE:__Fired(Delay)

Asynchronous Event Trigger for Event Fired.

AI_AIR_ENGAGE.___Engage(AIControllable, AIGroup, Fsm, AttackSetUnit)

AI_AIR_ENGAGE.___EngageRoute(AIControllable, AIGroup, Fsm, AttackSetUnit)

AI_AIR_ENGAGE:onafterAbort(AIGroup, From, Event, To)

onafter event handler for Abort event.

AI_AIR_ENGAGE:onafterAccomplish(AIGroup, From, Event, To)

AI_AIR_ENGAGE:onafterDestroy(AIGroup, From, Event, To, EventData)

AI_AIR_ENGAGE:onafterEngage(AIGroup, From, Event, To)

onafter event handler for Engage event.

AI_AIR_ENGAGE:onafterEngageRoute(DefenderGroup, From, Event, To, AttackSetUnit)

AI_AIR_ENGAGE:onafterStart(AIGroup, From, Event, To)

onafter event handler for Start event.

AI_AIR_ENGAGE:onbeforeEngage(AIGroup, From, Event, To)

onbefore event handler for Engage event.

Field(s)

AI_AIR_ENGAGE.AttackSetUnit

Kept in memory in case of resume from refuel in air!

Function(s)

Synchronous Event Trigger for Event Abort.

Defined in:

AI_AIR_ENGAGE

Synchronous Event Trigger for Event Accomplish.

Defined in:

AI_AIR_ENGAGE

Synchronous Event Trigger for Event Destroy.

Defined in:

AI_AIR_ENGAGE

Synchronous Event Trigger for Event Engage.

Defined in:

AI_AIR_ENGAGE

Synchronous Event Trigger for Event EngageRoute.

Defined in:

AI_AIR_ENGAGE

Synchronous Event Trigger for Event Fired.

Defined in:

AI_AIR_ENGAGE

Creates a new AI_AIR_ENGAGE object

Defined in:

AI_AIR_ENGAGE

Parameters:

The AI_AIR FSM.

The AI group.

DCS#Speed EngageMinSpeed

(optional, default = 50% of max speed) The minimum speed of the Wrapper.Group in km/h when engaging a target.

DCS#Speed EngageMaxSpeed

(optional, default = 75% of max speed) The maximum speed of the Wrapper.Group in km/h when engaging a target.

DCS#Altitude EngageFloorAltitude

(optional, default = 1000m ) The lowest altitude in meters where to execute the engagement.

DCS#Altitude EngageCeilingAltitude

(optional, default = 1500m ) The highest altitude in meters where to execute the engagement.

DCS#AltitudeType EngageAltType

The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".

Return value:

OnAfter Transition Handler for Event Abort.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnAfter Transition Handler for Event Accomplish.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnAfter Transition Handler for Event Destroy.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnAfter Transition Handler for Event Engage.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnAfter Transition Handler for Event EngageRoute.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnAfter Transition Handler for Event Fired.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnBefore Transition Handler for Event Abort.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnBefore Transition Handler for Event Accomplish.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnBefore Transition Handler for Event Destroy.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnBefore Transition Handler for Event Engage.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnBefore Transition Handler for Event EngageRoute.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnBefore Transition Handler for Event Fired.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

OnEnter Transition Handler for State Engaging.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Defined in:

AI_AIR_ENGAGE

Parameter:

OnLeave Transition Handler for State Engaging.

Defined in:

AI_AIR_ENGAGE

Parameters:

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.

Defined in:

AI_AIR_ENGAGE

Parameters:

Fsm

Asynchronous Event Trigger for Event Abort.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Asynchronous Event Trigger for Event Accomplish.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Asynchronous Event Trigger for Event Destroy.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Asynchronous Event Trigger for Event Engage.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Asynchronous Event Trigger for Event EngageRoute.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Asynchronous Event Trigger for Event Fired.

Defined in:

AI_AIR_ENGAGE

Parameter:

#number Delay

The delay in seconds.

Defined in:

AI_AIR_ENGAGE

Parameters:

Wrapper.Group#GROUP AIControllable

AIGroup

Fsm

AttackSetUnit

Defined in:

AI_AIR_ENGAGE

Parameters:

Wrapper.Group#GROUP AIControllable

AIGroup

Fsm

AttackSetUnit

onafter event handler for Abort event.

Defined in:

AI_AIR_ENGAGE

Parameters:

The AI Group managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Defined in:

AI_AIR_ENGAGE

Parameters:

The Group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

onafter event handler for Engage event.

Defined in:

AI_AIR_ENGAGE

Parameters:

The AI Group managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Defined in:

AI_AIR_ENGAGE

Parameters:

Wrapper.Group#GROUP DefenderGroup

The GroupGroup managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

AttackSetUnit

onafter event handler for Start event.

Defined in:

AI_AIR_ENGAGE

Parameters:

The AI group managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

onbefore event handler for Engage event.

Defined in:

AI_AIR_ENGAGE

Parameters:

The group Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.