Module Ops.EasyGCICAP
Easy CAP/GCI Class, based on OPS classes
Documentation
https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Ops.EasyGCICAP.html
Date: September 2023
Last Update: July 2024
- Ops - Easy GCI & CAP Manager
Main Features:
- Automatically create and manage A2A CAP/GCI defenses using an AirWing and Squadrons for one coalition
- Easy set-up
- Add additional AirWings on other airbases
- Each wing can have more than one Squadron - tasking to Squadrons is done on a random basis per AirWing
- Create borders and zones of engagement
- Detection can be ground based and/or via AWACS
AUTHOR: applevangelist
Global(s)
Global EASYGCICAP |
*“Airspeed, altitude, and brains. |
*“Airspeed, altitude, and brains.
Two are always needed to successfully complete the flight.”* -- Unknown.
The EasyGCICAP Concept
The idea of this class is partially to make the OPS classes easier operational for an A2A CAP/GCI defense network, and to replace the legacy AI_A2A_Dispatcher system - not to it's full extent, but make a basic system work very quickly.
Setup
Basic understanding
The basics are, there is one and only one AirWing per airbase. Each AirWing has at least one Squadron, who will do both CAP and GCI tasks. Squadrons will be randomly chosen for the task at hand. Each AirWing has at least one CAP Point that it manages. CAP Points will be covered by the AirWing automatically as long as airframes are available. Detected intruders will be assigned to one AirWing based on proximity (that is, if you have more than one).
Assignment of tasks for intruders
Either a CAP Plane or a newly spawned GCI plane will take care of the intruders. Standard overhead is 0.75, i.e. a group of 3 intrudes will be managed by 2 planes from the assigned AirWing. There is an maximum missions limitation per AirWing, so we do not spam the skies.
Basic set-up code
Prerequisites
You have to put a STATIC WAREHOUSE object on the airbase with the UNIT name according to the name of the airbase. Do not put any other static type or it creates a conflict with the airbase name! E.g. for Kuitaisi this has to have the unit name Kutaisi. This object symbolizes the AirWing HQ. Next put a late activated template group for your CAP/GCI Squadron on the map. Last, put a zone on the map for the CAP operations, let's name it "Blue Zone 1". Size of the zone plays no role. Put an EW radar system on the map and name it aptly, like "Blue EWR".
Code it
-- Set up a basic system for the blue side, we'll reside on Kutaisi, and use GROUP objects with "Blue EWR" in the name as EW Radar Systems.
local mywing = EASYGCICAP:New("Blue CAP Operations",AIRBASE.Caucasus.Kutaisi,"blue","Blue EWR")
-- Add a CAP patrol point belonging to our airbase, we'll be at 30k ft doing 400 kn, initial direction 90 degrees (East), leg 20NM
mywing:AddPatrolPointCAP(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone 1"):GetCoordinate(),30000,400,90,20)
-- Add a Squadron with template "Blue Sq1 M2000c", 20 airframes, skill good, Modex starting with 102 and skin "Vendee Jeanne"
mywing:AddSquadron("Blue Sq1 M2000c","CAP Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.GOOD,102,"ec1.5_Vendee_Jeanne_clean")
-- Add a couple of zones
-- We'll defend our border
mywing:AddAcceptZone(ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) ))
-- We'll attack intruders also here
mywing:AddAcceptZone(ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" )))
-- We'll leave the reds alone on their turf
mywing:AddRejectZone(ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) ))
-- Optional - Draw the borders on the map so we see what's going on
-- Set up borders on map
local BlueBorder = ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) )
BlueBorder:DrawZone(-1,{0,0,1},1,FillColor,FillAlpha,1,true)
local BlueNoGoZone = ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" ))
BlueNoGoZone:DrawZone(-1,{1,1,0},1,FillColor,FillAlpha,2,true)
local BlueNoGoZone2 = ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) )
BlueNoGoZone2:DrawZone(-1,{1,0,0},1,FillColor,FillAlpha,4,true)
Add a second airwing with squads and own CAP point (optional)
-- Set this up at Sukhumi
mywing:AddAirwing(AIRBASE.Caucasus.Sukhumi_Babushara,"Blue CAP Sukhumi")
-- CAP Point "Blue Zone 2"
mywing:AddPatrolPointCAP(AIRBASE.Caucasus.Sukhumi_Babushara,ZONE:FindByName("Blue Zone 2"):GetCoordinate(),30000,400,90,20)
-- This one has two squadrons to choose from
mywing:AddSquadron("Blue Sq3 F16","CAP Sukhumi II",AIRBASE.Caucasus.Sukhumi_Babushara,20,AI.Skill.GOOD,402,"JASDF 6th TFS 43-8526 Skull Riders")
mywing:AddSquadron("Blue Sq2 F15","CAP Sukhumi I",AIRBASE.Caucasus.Sukhumi_Babushara,20,AI.Skill.GOOD,202,"390th Fighter SQN")
Add a tanker (optional)
-- **Note** If you need different tanker types, i.e. Boom and Drogue, set them up at different AirWings!
-- Add a tanker point
mywing:AddPatrolPointTanker(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone Tanker"):GetCoordinate(),20000,280,270,50)
-- Add a tanker squad - Radio 251 AM, TACAN 51Y
mywing:AddTankerSquadron("Blue Tanker","Tanker Ops Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.EXCELLENT,602,nil,251,radio.modulation.AM,51)
Add an AWACS (optional)
-- Add an AWACS point
mywing:AddPatrolPointAwacs(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone AWACS"):GetCoordinate(),25000,300,270,50)
-- Add an AWACS squad - Radio 251 AM, TACAN 51Y
mywing:AddAWACSSquadron("Blue AWACS","AWACS Ops Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.AVERAGE,702,nil,271,radio.modulation.AM)
Fine-Tuning
Change Defaults
- EASYGCICAP.SetDefaultResurrection: Set how many seconds the AirWing stays inoperable after the AirWing STATIC HQ ist destroyed, default 900 secs.
- EASYGCICAP.SetDefaultCAPSpeed: Set how many knots the CAP flights should do (will be altitude corrected), default 300 kn.
- EASYGCICAP.SetDefaultCAPAlt: Set at which altitude (ASL) the CAP planes will fly, default 25,000 ft.
- EASYGCICAP.SetDefaultCAPDirection: Set the initial direction from the CAP point the planes will fly in degrees, default is 90°.
- EASYGCICAP.SetDefaultCAPLeg: Set the length of the CAP leg, default is 15 NM.
- EASYGCICAP.SetDefaultCAPGrouping: Set how many planes will be spawned per mission (CVAP/GCI), defaults to 2.
- EASYGCICAP.SetDefaultMissionRange: Set how many NM the planes can go from the home base, defaults to 100.
- EASYGCICAP.SetDefaultNumberAlert5Standby: Set how many planes will be spawned on cold standby (Alert5), default 2.
- EASYGCICAP.SetDefaultEngageRange: Set max engage range for CAP flights if they detect intruders, defaults to 50.
- EASYGCICAP.SetMaxAliveMissions: Set max parallel missions can be done (CAP+GCI+Alert5+Tanker+AWACS), defaults to 8.
- EASYGCICAP.SetDefaultRepeatOnFailure: Set max repeats on failure for intercepting/killing intruders, defaults to 3.
- EASYGCICAP.SetTankerAndAWACSInvisible: Set Tanker and AWACS to be invisible to enemy AI eyes. Is set to
true
by default.
Debug and Monitor
mywing.debug = true -- log information
mywing.Monitor = true -- show some statistics on screen
Type(s)
Fields and Methods inherited from EASYGCICAP | Description |
---|---|
Add an AWACS Squadron to an Airwing of the manager |
|
Add a zone to the accepted zones set. |
|
Add an AirWing to the manager |
|
EASYGCICAP:AddPatrolPointAwacs(AirbaseName, Coordinate, Altitude, Speed, Heading, LegLength) |
Add an AWACS patrol point to a Wing |
EASYGCICAP:AddPatrolPointCAP(AirbaseName, Coordinate, Altitude, Speed, Heading, LegLength) |
Add a CAP patrol point to a Wing |
EASYGCICAP:AddPatrolPointRecon(AirbaseName, Coordinate, Altitude, Speed, Heading, LegLength) |
Add a RECON patrol point to a Wing |
EASYGCICAP:AddPatrolPointTanker(AirbaseName, Coordinate, Altitude, Speed, Heading, LegLength) |
Add a TANKER patrol point to a Wing |
EASYGCICAP:AddReconSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery) |
Add a Recon Squadron to an Airwing of the manager |
Add a zone to the rejected zones set. |
|
EASYGCICAP:AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery) |
Add a Squadron to an Airwing of the manager |
Add a Tanker Squadron to an Airwing of the manager |
|
Create a new GCICAP Manager |
|
Set CAP formation. |
|
Set CAP mission start to vary randomly between Start end End seconds. |
|
Set default CAP Altitude in feet |
|
Set default CAP lieg initial direction in degrees |
|
Set default grouping, i.e. |
|
Set default leg length in NM |
|
Set default CAP Speed in knots |
|
Set default despawning after holding (despawn in air close to AFB). |
|
Set default despawning after landing. |
|
Set default engage range for intruders detected by CAP flights in NM. |
|
Set default range planes can fly from their homebase in NM |
|
Set default number of airframes standing by for intercept tasks (visible on the airfield) |
|
Set default overhead for intercept calculations |
|
Add default repeat attempts if an Intruder intercepts fails. |
|
Add default time to resurrect Airwing building if destroyed |
|
Set Maximum of alive missions to stop airplanes spamming the map |
|
Set Tanker and AWACS to be invisible to enemy AI eyes |
|
(Internal) Add a AWACS Squadron to an Airwing of the manager |
|
(internal) Create and add another AirWing to the manager |
|
EASYGCICAP:_AddReconSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery) |
(Internal) Add a Recon Squadron to an Airwing of the manager |
(Internal) Add a Squadron to an Airwing of the manager |
|
(Internal) Add a Tanker Squadron to an Airwing of the manager |
|
Here, we'll decide if we need to launch an intercepting flight, and from where |
|
(Internal) Create actual AirWings from the list |
|
(Internal) Create actual Squadrons from the list |
|
(Internal) Set actual Awacs Points from the list |
|
(Internal) Set actual PatrolPoints from the list |
|
(Internal) Set actual PatrolPoints from the list |
|
(Internal) Set actual Tanker Points from the list |
|
(Internal) Start detection. |
|
EASYGCICAP:_TryAssignIntercept(ReadyFlightGroups, InterceptAuftrag, Group, WingSize) |
(Internal) Try to assign the intercept to a FlightGroup already in air and ready. |
(Internal) FSM Function onafterStart |
|
(Internal) FSM Function onafterStatus |
|
(Internal) FSM Function onafterStop |
|
(Internal) FSM Function onbeforeStatus |
|
EASYGCICAP class version. |
|
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
|
Adds a score for the FSM to be achieved. |
|
EASYGCICAP:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
Get current state. |
|
Returns the End states. |
|
Returns a table of the SubFSM rules defined within the FSM. |
|
Returns a table with the scores defined. |
|
Returns the start state of the FSM. |
|
Get current state. |
|
Returns a table with the Subs defined. |
|
Returns a table of the transition rules defined within the FSM. |
|
Check if FSM is in state. |
|
Load call backs. |
|
Creates a new FSM object. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
Call handler. |
|
Create transition. |
|
Delayed transition. |
|
Event map. |
|
Go sub. |
|
Handler. |
|
Is end state. |
|
Sub maps. |
|
Check if can do an event. |
|
Check if cannot do an event. |
|
Check if FSM is in state. |
|
Fields and Methods inherited from EASYGCICAP.CapPoint | Description |
---|---|
Fields and Methods inherited from EASYGCICAP.Squad | Description |
---|---|
Fields and Methods inherited from EASYGCICAP.Wing | Description |
---|---|
EASYGCICAP Class
Field(s)
Set some string id for output to DCS.log file.
EASYGCICAP class version.
Function(s)
Add an AWACS Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
#number Frequency
(optional) Radio Frequency to be used.
#number Modulation
(optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
Return value:
self
Add a zone to the accepted zones set.
Add an AirWing to the manager
Defined in:
EASYGCICAP
Parameters:
#string Airbasename
#string Alias
Return value:
self
Add an AWACS patrol point to a Wing
Defined in:
EASYGCICAP
Parameters:
#string AirbaseName
Name of the Wing's airbase
Core.Point#COORDINATE Coordinate
#number Altitude
Defaults to 25000 feet.
#number Speed
Defaults to 300 knots.
#number Heading
Defaults to 90 degrees (East).
#number LegLength
Defaults to 15 NM.
Return value:
self
Add a CAP patrol point to a Wing
Defined in:
EASYGCICAP
Parameters:
#string AirbaseName
Name of the Wing's airbase
Core.Point#COORDINATE Coordinate
#number Altitude
Defaults to 25000 feet ASL.
#number Speed
Defaults to 300 knots TAS.
#number Heading
Defaults to 90 degrees (East).
#number LegLength
Defaults to 15 NM.
Return value:
self
Add a RECON patrol point to a Wing
Defined in:
EASYGCICAP
Parameters:
#string AirbaseName
Name of the Wing's airbase
Core.Point#COORDINATE Coordinate
#number Altitude
Defaults to 25000 feet.
#number Speed
Defaults to 300 knots.
#number Heading
Defaults to 90 degrees (East).
#number LegLength
Defaults to 15 NM.
Return value:
self
Add a TANKER patrol point to a Wing
Defined in:
EASYGCICAP
Parameters:
#string AirbaseName
Name of the Wing's airbase
Core.Point#COORDINATE Coordinate
#number Altitude
Defaults to 25000 feet.
#number Speed
Defaults to 300 knots.
#number Heading
Defaults to 90 degrees (East).
#number LegLength
Defaults to 15 NM.
Return value:
self
Add a Recon Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
Return value:
self
Add a zone to the rejected zones set.
Add a Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
Return value:
self
Add a Tanker Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
#number Frequency
(optional) Radio Frequency to be used.
#number Modulation
(optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
#number TACAN
(optional) TACAN channel, e.g. 71, resulting in Channel 71Y
Return value:
self
Create a new GCICAP Manager
Defined in:
EASYGCICAP
Parameters:
#string Alias
A Name for this GCICAP
#string AirbaseName
Name of the Home Airbase
#string Coalition
Coalition, e.g. "blue" or "red"
#string EWRName
(Partial) group name of the EWR system of the coalition, e.g. "Red EWR"
Return value:
self
Set CAP formation.
Defined in:
EASYGCICAP
Parameter:
#number Formation
Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
Return value:
self
Set CAP mission start to vary randomly between Start end End seconds.
Set default CAP Altitude in feet
Defined in:
EASYGCICAP
Parameter:
#number Altitude
Altitude defaults to 25000
Return value:
self
Set default CAP lieg initial direction in degrees
Defined in:
EASYGCICAP
Parameter:
#number Direction
Direction defaults to 90 (East)
Return value:
self
Set default grouping, i.e.
how many airplanes per CAP point
Defined in:
EASYGCICAP
Parameter:
#number Grouping
Grouping defaults to 2
Return value:
self
Set default leg length in NM
Set default CAP Speed in knots
Defined in:
EASYGCICAP
Parameter:
#number Speed
Speed defaults to 300
Return value:
self
Set default despawning after holding (despawn in air close to AFB).
Set default despawning after landing.
Set default engage range for intruders detected by CAP flights in NM.
Set default range planes can fly from their homebase in NM
Defined in:
EASYGCICAP
Parameter:
#number Range
Range defaults to 100 NM
Return value:
self
Set default number of airframes standing by for intercept tasks (visible on the airfield)
Set default overhead for intercept calculations
Defined in:
EASYGCICAP
Parameter:
#number Overhead
The overhead to use.
Return value:
self
Usage:
Either a CAP Plane or a newly spawned GCI plane will take care of intruders. Standard overhead is 0.75, i.e. a group of 3 intrudes will
be managed by 2 planes from the assigned AirWing. There is an maximum missions limitation per AirWing, so we do not spam the skies.
Add default repeat attempts if an Intruder intercepts fails.
Defined in:
EASYGCICAP
Parameter:
#number Retries
Retries, defaults to 3
Return value:
self
Add default time to resurrect Airwing building if destroyed
Defined in:
EASYGCICAP
Parameter:
#number Seconds
Seconds, defaults to 900
Return value:
self
Set Maximum of alive missions to stop airplanes spamming the map
Defined in:
EASYGCICAP
Parameter:
#number Maxiumum
Maxmimum number of parallel missions allowed. Count is Cap-Missions + Intercept-Missions + Alert5-Missionsm default is 6
Return value:
self
Set Tanker and AWACS to be invisible to enemy AI eyes
Defined in:
EASYGCICAP
Parameter:
#boolean Switch
Set to true or false, by default this is set to true already
Return value:
self
(Internal) Add a AWACS Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
#number Frequency
(optional) Radio frequency of the AWACS
#number Modulation
(Optional) Radio modulation of the AWACS
Return value:
self
(internal) Create and add another AirWing to the manager
Defined in:
EASYGCICAP
Parameters:
#string Airbasename
#string Alias
Return value:
self
(Internal) Add a Recon Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
Return value:
self
(Internal) Add a Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
#number Frequency
(optional) Radio Frequency to be used.
#number Modulation
(optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
Return value:
self
(Internal) Add a Tanker Squadron to an Airwing of the manager
Defined in:
EASYGCICAP
Parameters:
#string TemplateName
Name of the group template.
#string SquadName
Squadron name - must be unique!
#string AirbaseName
Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
#number AirFrames
Number of available airframes, e.g. 20.
#string Skill
optional) Skill level, e.g. AI.Skill.AVERAGE
#string Modex
(optional) Modex to be used,e.g. 402.
#string Livery
(optional) Livery name to be used.
#number Frequency
(optional) Radio frequency of the Tanker
#number Modulation
(Optional) Radio modulation of the Tanker
#number TACAN
(Optional) TACAN Channel to be used, will always be an "Y" channel
Return value:
self
Here, we'll decide if we need to launch an intercepting flight, and from where
(Internal) Create actual AirWings from the list
(Internal) Create actual Squadrons from the list
(Internal) Set actual Awacs Points from the list
(Internal) Set actual PatrolPoints from the list
(Internal) Set actual PatrolPoints from the list
(Internal) Set actual Tanker Points from the list
(Internal) Start detection.
(Internal) Try to assign the intercept to a FlightGroup already in air and ready.
Defined in:
EASYGCICAP
Parameters:
#table ReadyFlightGroups
ReadyFlightGroups
Ops.Auftrag#AUFTRAG InterceptAuftrag
The Auftrag
Wrapper.Group#GROUP Group
The Target
#number WingSize
Calculated number of Flights
Return values:
#boolean:
assigned
#number:
leftover
(Internal) FSM Function onafterStart
Defined in:
EASYGCICAP
Parameters:
#string From
#string Event
#string To
Return value:
self
(Internal) FSM Function onafterStatus
Defined in:
EASYGCICAP
Parameters:
#string From
#string Event
#string To
Return value:
self
(Internal) FSM Function onafterStop
Defined in:
EASYGCICAP
Parameters:
#string From
#string Event
#string To
Return value:
self
(Internal) FSM Function onbeforeStatus
Defined in:
EASYGCICAP
Parameters:
#string From
#string Event
#string To
Return value:
self
Field(s)
Set some string id for output to DCS.log file.
EASYGCICAP class version.
Function(s)
Adds an End state.
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
Core.Fsm#FSM_PROCESS Process
An sub-process FSM.
#table ReturnEvents
A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.
Return value:
The SubFSM.
Adds a score for the FSM to be achieved.
Defined in:
Parameters:
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Adds a score for the FSM_PROCESS to be achieved.
Defined in:
Parameters:
#string From
is the From State of the main process.
#string Event
is the Event of the main process.
#string State
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
#string ScoreText
is a text describing the score that is given according the status.
#number Score
is a number providing the score of the status.
Return value:
#FSM:
self
Add a new transition rule to the FSM.
A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
#string To
The To state.
Get current state.
Returns the End states.
Returns a table of the SubFSM rules defined within the FSM.
Returns a table with the scores defined.
Returns the start state of the FSM.
Get current state.
Returns a table with the Subs defined.
Returns a table of the transition rules defined within the FSM.
Check if FSM is in state.
Defined in:
Parameter:
#string State
State name.
Return value:
#boolean:
If true, FSM is in this state.
Load call backs.
Sets the start state of the FSM.
Add to map.
Call handler.
Defined in:
Parameters:
#string step
Step "onafter", "onbefore", "onenter", "onleave".
#string trigger
Trigger.
#table params
Parameters.
#string EventName
Event name.
Return value:
Value.
Create transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Delayed transition.
Defined in:
Parameter:
#string EventName
Event name.
Return value:
#function:
Function.
Event map.
Go sub.
Defined in:
Parameters:
#string ParentFrom
Parent from state.
#string ParentEvent
Parent event name.
Return value:
#table:
Subs.
Handler.
Is end state.
Defined in:
Parameter:
#string Current
Current state name.
Return values:
#table:
FSM parent.
#string:
Event name.
Sub maps.
Check if can do an event.
Defined in:
Parameter:
#string e
Event name.
Return values:
#boolean:
If true, FSM can do the event.
#string:
To state.
Check if cannot do an event.
Defined in:
Parameter:
#string e
Event name.
Return value:
#boolean:
If true, FSM cannot do the event.
Check if FSM is in state.
Defined in:
Parameters:
#string State
State name.
state
Return value:
#boolean:
If true, FSM is in this state.
Internal CapPoint data type
Field(s)
Function(s)
Internal Squadron data type
Field(s)
Function(s)
Internal Wing data type