Module Ops.RecoveryTanker
Ops - Recovery tanker for carrier operations.
Tanker aircraft flying a racetrack pattern overhead an aircraft carrier.
Main Features:
- Regular pattern update with respect to carrier position.
- No restrictions regarding carrier waypoints and heading.
- Automatic respawning when tanker runs out of fuel for 24/7 operations.
- Tanker can be spawned cold or hot on the carrier or at any other airbase or directly in air.
- Automatic AA TACAN beacon setting.
- Multiple tankers at the same carrier.
- Multiple carriers due to object oriented approach.
- Finite State Machine (FSM) implementation, which allows the mission designer to hook into certain events.
Author: funkyfranky
Special thanks to HighwaymanEd for testing and suggesting improvements!
Global(s)
Global RECOVERYTANKER |
Recovery Tanker. |
Recovery Tanker.
Recovery Tanker
A recovery tanker acts as refueling unit flying overhead an aircraft carrier in order to supply incoming flights with gas if they go "Bingo on the Ball".
Simple Script
In the mission editor you have to set up a carrier unit, which will act as "mother". In the following, this unit will be named "USS Stennis".
Secondly, you need to define a recovery tanker group in the mission editor and set it to "LATE ACTIVATED". The name of the group we'll use is "Texaco".
The basic script is very simple and consists of only two lines:
TexacoStennis=RECOVERYTANKER:New(UNIT:FindByName("USS Stennis"), "Texaco")
TexacoStennis:Start()
The first line will create a new RECOVERYTANKER object and the second line starts the process.
With this setup, the tanker will be spawned on the USS Stennis with running engines. After it takes off, it will fly a position ~10 NM astern of the boat and from there start its pattern. This is a counter clockwise racetrack pattern at angels 6.
A TACAN beacon will be automatically activated at channel 1Y with morse code "TKR". See below how to change this setting.
Note that the Tanker entry in the F10 radio menu will appear once the tanker is on station and not before. If you spawn the tanker cold or hot on the carrier, this will take ~10 minutes.
Also note, that currently the only carrier capable aircraft in DCS is the S-3B Viking (tanker version). If you want to use another refueling aircraft, you need to activate air spawn or set a different land based airport of the map. This will be explained below.
The "downwind" leg of the pattern is normally used for refueling.
Once the tanker runs out of fuel itself, it will return to the carrier, respawn with full fuel and take up its pattern again.
Options and Fine Tuning
Several parameters can be customized by the mission designer via user API functions.
Takeoff Type
By default, the tanker is spawned with running engines on the carrier. The mission designer has set option to set the take off type via the RECOVERYTANKER.SetTakeoff function. Or via shortcuts
- RECOVERYTANKER.SetTakeoffHot(): Will set the takeoff to hot, which is also the default.
- RECOVERYTANKER.SetTakeoffCold(): Will set the takeoff type to cold, i.e. with engines off.
- RECOVERYTANKER.SetTakeoffAir(): Will set the takeoff type to air, i.e. the tanker will be spawned in air ~10 NM astern the carrier.
For example,
TexacoStennis=RECOVERYTANKER:New(UNIT:FindByName("USS Stennis"), "Texaco")
TexacoStennis:SetTakeoffAir()
TexacoStennis:Start()
will spawn the tanker several nautical miles astern the carrier. From there it will start its pattern.
Spawning in air is not as realistic but can be useful do avoid DCS bugs and shortcomings like aircraft crashing into each other on the flight deck.
Note that when spawning in air is set, the tanker will also not return to the boat, once it is out of fuel. Instead it will be respawned directly in air.
If only the first spawning should happen on the carrier, one use the RECOVERYTANKER.SetRespawnInAir() function to command that all subsequent spawning will happen in air.
If the tanker should not be respawned at all, one can set RECOVERYTANKER.SetRespawnOff().
Pattern Parameters
The racetrack pattern parameters can be fine tuned via the following functions:
- RECOVERYTANKER.SetAltitude(altitude), where altitude is the pattern altitude in feet. Default 6000 ft.
- RECOVERYTANKER.SetSpeed(speed), where speed is the pattern speed in knots. Default is 274 knots TAS which results in ~250 KIAS.
- RECOVERYTANKER.SetRacetrackDistances(distbow, diststern), where distbow and diststern are the distances ahead and astern the boat (default 10 and 4 NM), respectively. In principle, these number should be more like 8 and 6 NM but since the carrier is moving, we give translate the pattern points a bit forward.
Home Base
The home base is the airbase where the tanker is spawned (if not in air) and where it will go once it is running out of fuel. The default home base is the carrier itself. The home base can be changed via the RECOVERYTANKER.SetHomeBase(airbase) function, where airbase can be a MOOSE Wrapper.Airbase#AIRBASE object or simply the name of the airbase passed as string.
Note that only the S3B Viking is a refueling aircraft that is carrier capable. You can use other tanker aircraft types, e.g. the KC-130, but in this case you must either set an airport of the map as home base or activate spawning in air via RECOVERYTANKER.SetTakeoffAir.
TACAN
A TACAN beacon for the tanker can be activated via scripting, i.e. no need to do this within the mission editor.
The beacon is create with the RECOVERYTANKER.SetTACAN(channel, morse) function, where channel is the TACAN channel (a number), and morse a three letter string that is send as morse code to identify the tanker:
TexacoStennis:SetTACAN(10, "TKR")
will activate a TACAN beacon 10Y with more code "TKR".
If you do not set a TACAN beacon explicitly, it is automatically create on channel 1Y and morse code "TKR". The mode is always "Y" for AA TACAN stations since mode "X" does not work!
In order to completely disable the TACAN beacon, you can use the RECOVERYTANKER.SetTACANoff() function in your script.
Radio
The radio frequency on optionally modulation can be set via the RECOVERYTANKER.SetRadio(frequency, modulation) function. The first parameter denotes the radio frequency the tanker uses in MHz. The second parameter is optional and sets the modulation to either AM (default) or FM.
For example,
TexacoStennis:SetRadio(260)
will set the frequency of the tanker to 260 MHz AM.
Note that if this is not set, the tanker frequency will be automatically set to 251 MHz AM.
Pattern Update
The pattern of the tanker is updated if at least one of the two following conditions apply:
- The aircraft carrier changes its position by more than 5 NM (see RECOVERYTANKER.SetPatternUpdateDistance) and/or
- The aircraft carrier changes its heading by more than 5 degrees (see RECOVERYTANKER.SetPatternUpdateHeading)
Note that updating the pattern often leads to a more or less small disruption of the perfect racetrack pattern of the tanker. This is because a new waypoint and new racetrack points need to be set as DCS task. This is the reason why the pattern is not constantly updated but rather when the position or heading of the carrier changes significantly.
The maximum update frequency is set to 10 minutes. You can adjust this by RECOVERYTANKER.SetPatternUpdateInterval. Also the pattern will not be updated whilst the carrier is turning or the tanker is currently refueling another unit.
Callsign
The callsign of the tanker can be set via the RECOVERYTANKER.SetCallsign(callsignname, callsignnumber) function. Both parameters are numbers. The first parameter callsignname defines the name (1=Texaco, 2=Arco, 3=Shell). The second (optional) parameter specifies the first number and has to be between 1-9. Also see DCS_enum_callsigns and DCS_command_setCallsign.
TexacoStennis:SetCallsign(CALLSIGN.Tanker.Arco)
For convenience, MOOSE has a CALLSIGN enumerator introduced.
AWACS
You can use the class also to have an AWACS orbiting overhead the carrier. This requires to add the RECOVERYTANKER.SetAWACS(switch, eplrs) function to the script, which sets the enroute tasks AWACS as soon as the aircraft enters its pattern. Note that the EPLRS data link is enabled by default. To disable it, the second parameter eplrs must be set to false.
A simple script could look like this:
-- E-2D at USS Stennis spawning in air.
local awacsStennis=RECOVERYTANKER:New("USS Stennis", "E2D Group")
-- Custom settings:
awacsStennis:SetAWACS()
awacsStennis:SetCallsign(CALLSIGN.AWACS.Wizard, 1)
awacsStennis:SetTakeoffAir()
awacsStennis:SetAltitude(20000)
awacsStennis:SetRadio(262)
awacsStennis:SetTACAN(2, "WIZ")
-- Start AWACS.
awacsStennis:Start()
Finite State Machine
The implementation uses a Finite State Machine (FSM). This allows the mission designer to hook in to certain events.
- RECOVERYTANKER.Start: This event starts the FMS process and initialized parameters and spawns the tanker. DCS event handling is started.
- RECOVERYTANKER.Status: This event is called in regular intervals (~60 seconds) and checks the status of the tanker and carrier. It triggers other events if necessary.
- RECOVERYTANKER.PatternUpdate: This event commands the tanker to update its pattern
- RECOVERYTANKER.RTB: This events sends the tanker to its home base (usually the carrier). This is called once the tanker runs low on gas.
- RECOVERYTANKER.RefuelStart: This event is called when a tanker starts to refuel another unit.
- RECOVERYTANKER.RefuelStop: This event is called when a tanker stopped to refuel another unit.
- RECOVERYTANKER.Run: This event is called when the tanker resumes normal operations, e.g. after refueling stopped or tanker finished refueling.
- RECOVERYTANKER.Stop: This event stops the FSM by unhandling DCS events.
The mission designer can capture these events by RECOVERYTANKER.OnAfterEventname functions, e.g. RECOVERYTANKER.OnAfterPatternUpdate.
Debugging
In case you have problems, it is always a good idea to have a look at your DCS log file. You find it in your "Saved Games" folder, so for example in
C:\Users\<yourname>\Saved Games\DCS\Logs\dcs.log
All output concerning the #RECOVERYTANKER class should have the string "RECOVERYTANKER" in the corresponding line. Searching for lines that contain the string "error" or "nil" can also give you a hint what's wrong.
The verbosity of the output can be increased by adding the following lines to your script:
BASE:TraceOnOff(true)
BASE:TraceLevel(1)
BASE:TraceClass("RECOVERYTANKER")
To get even more output you can increase the trace level to 2 or even 3, c.f. Core.Base#BASE for more details.
Debug Mode
You have the option to enable the debug mode for this class via the RECOVERYTANKER.SetDebugModeON function. If enabled, text messages about the tanker status will be displayed on screen and marks of the pattern created on the F10 map.
Global _RECOVERYTANKERID |
Type(s)
Fields and Methods inherited from RECOVERYTANKER | Description |
---|---|
Name of the class. |
|
Debug mode. |
|
Pattern update when carrier changes its position by more than this distance (meters). |
|
Alias of tanker spawn group. |
|
Get unit name of the spawned tanker. |
|
Pattern update when carrier changes its heading by more than this number (degrees). |
|
Check if tanker is currently refueling another aircraft. |
|
Check if tanker has returned to base. |
|
Check if tanker is currently returning to base. |
|
Check if tanker is currently operating. |
|
Check if FMS was stopped. |
|
Create new RECOVERYTANKER object. |
|
On after "PatternEvent" event user function. |
|
On after "RTB" event user function. |
|
RECOVERYTANKER:OnAfterRefuelStart(From, Event, To, receiver) |
On after "RefuelStart" event user function. |
On after "RefuelStop" event user function. |
|
On after "Returned" event user function. |
|
On after "Start" event function. |
|
Event handler for engine shutdown of recovery tanker. |
|
Event handler for landing of recovery tanker. |
|
Triggers the FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position. |
|
Triggers the FSM event "RTB" that sends the tanker home. |
|
Radio frequency in MHz of the tanker. Default 251 MHz. |
|
Radio modulation "AM" or "FM". Default "AM". |
|
Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft. |
|
Triggers the FSM event "RefuelStop" when the tanker stops refueling another aircraft. |
|
Triggers the FSM event "Returned" after the tanker has landed. |
|
Triggers the FSM event "Run". |
|
Set that the group takes the role of an AWACS instead of a refueling tanker. |
|
Set orbit pattern altitude of the tanker. |
|
Set callsign of the tanker group. |
|
Deactivate debug mode. |
|
Activate debug mode. |
|
Set home airbase of the tanker. |
|
Set low fuel state of tanker. |
|
Set modex (tail number) of the tanker. |
|
Set pattern update distance threshold. |
|
Set pattern update heading threshold. |
|
Set minimum pattern update interval. |
|
Set race-track distances. |
|
Set radio frequency and optionally modulation of the tanker. |
|
Activate recovery by the AIRBOSS class. |
|
Tanker will be respawned in air, even it was initially spawned on the carrier. |
|
Disable respawning of tanker. |
|
Enable respawning of tanker. |
|
Set whether tanker shall be respawned or not. |
|
Set the speed the tanker flys in its orbit pattern. |
|
Set TACAN channel of tanker. |
|
Disable automatic TACAN activation. |
|
Set takeoff type. |
|
Set takeoff in air at the defined pattern altitude and ~10 NM astern the carrier. |
|
Set takeoff with engines off (cold). |
|
Set takeoff with engines running (hot). |
|
Set the tanker to have unlimited fuel. |
|
Use an uncontrolled aircraft already present in the mission rather than spawning a new tanker as initial recovery thanker. |
|
Triggers the FSM event "Start" that starts the recovery tanker. |
|
Triggers the FSM event "Status" that updates the tanker status. |
|
Triggers the FSM event "Stop" that stops the recovery tanker. |
|
TACAN channel. Default 1. |
|
TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations! |
|
TACAN morse code. Three letters identifying the TACAN station. Default "TKR". |
|
If true, TACAN is automatically activated. If false, TACAN is disabled. |
|
Last time the pattern was updated. |
|
Activate TACAN of tanker. |
|
Check if heading or position have changed significantly. |
|
Task function to |
|
Init waypoint after spawn. |
|
A unit crashed or died. |
|
Self made race track pattern. |
|
Event handler for refueling started. |
|
Event handler for refueling stopped. |
|
Triggers the delayed FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position. |
|
Triggers the FSM event "RTB" that sends the tanker home after a delay. |
|
Triggers the delayed FSM event "Returned" after the tanker has landed. |
|
Triggers delayed the FSM event "Run". |
|
Triggers the FSM event "Start" that starts the recovery tanker after a delay. |
|
Triggers the delayed FSM event "Status" that updates the tanker status. |
|
Triggers the FSM event "Stop" that stops the recovery tanker after a delay. |
|
The home airbase object of the tanker. Normally the aircraft carrier. |
|
Alias of the spawn group. |
|
Tanker orbit pattern altitude. |
|
If true, the groups gets the enroute task AWACS instead of tanker. |
|
Tanker TACAN beacon. |
|
Number for the callsign name. |
|
Number of the callsign name. |
|
The carrier the tanker is attached to. |
|
Carrier type. |
|
Minimum time interval in seconds before the next pattern update can happen. |
|
Race-track distance bow. distBow is >0. |
|
Race-track distance astern. distStern is <0. |
|
If true, enable data link, e.g. if used as AWACS. |
|
Log debug id text. |
|
Low fuel threshold in percent. |
|
Tail number of the tanker. |
|
On after "PatternUpdate" event. |
|
On after "RTB" event. |
|
On after Returned event. |
|
On after Start event. |
|
On after Status event. |
|
On after Stop event. |
|
Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly. |
|
Orientation of the carrier for checking if carrier is currently turning. |
|
Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern. |
|
If true, tanker will recover using the AIRBOSS marshal pattern. |
|
If true, tanker be respawned (default). If false, no respawning will happen. |
|
If true, tanker will always be respawned in air. This has no impact on the initial spawn setting. |
|
Tanker speed when flying pattern. |
|
Takeoff type (cold, hot, air). |
|
Tanker group. |
|
Name of the late activated tanker template group. |
|
Terminal type of used parking spots on airbases. |
|
Unique ID of this tanker. |
|
If true, use and uncontrolled tanker group already present in the mission. |
|
If true, the tanker will have unlimited fuel. |
|
Class version. |
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
RECOVERYTANKER:AddProcess(From, Event, Process, ReturnEvents) |
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. |
|
RECOVERYTANKER: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. |
|
RECOVERYTANKER:_call_handler(step, trigger, params, EventName) |
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. |
|
RECOVERYTANKER class.
Field(s)
Name of the class.
Debug mode.
Pattern update when carrier changes its position by more than this distance (meters).
Pattern update when carrier changes its heading by more than this number (degrees).
Radio frequency in MHz of the tanker. Default 251 MHz.
Radio modulation "AM" or "FM". Default "AM".
TACAN channel. Default 1.
TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations!
TACAN morse code. Three letters identifying the TACAN station. Default "TKR".
If true, TACAN is automatically activated. If false, TACAN is disabled.
Last time the pattern was updated.
The home airbase object of the tanker. Normally the aircraft carrier.
Alias of the spawn group.
Tanker orbit pattern altitude.
If true, the groups gets the enroute task AWACS instead of tanker.
Number for the callsign name.
Number of the callsign name.
Carrier type.
Minimum time interval in seconds before the next pattern update can happen.
Race-track distance bow. distBow is >0.
Race-track distance astern. distStern is <0.
If true, enable data link, e.g. if used as AWACS.
Log debug id text.
Low fuel threshold in percent.
Tail number of the tanker.
Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly.
Orientation of the carrier for checking if carrier is currently turning.
Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern.
If true, tanker will recover using the AIRBOSS marshal pattern.
If true, tanker be respawned (default). If false, no respawning will happen.
If true, tanker will always be respawned in air. This has no impact on the initial spawn setting.
Tanker speed when flying pattern.
Takeoff type (cold, hot, air).
Name of the late activated tanker template group.
Terminal type of used parking spots on airbases.
Unique ID of this tanker.
If true, use and uncontrolled tanker group already present in the mission.
If true, the tanker will have unlimited fuel.
Class version.
Function(s)
Alias of tanker spawn group.
Defined in:
RECOVERYTANKER
Return value:
#string:
Alias of the tanker.
Get unit name of the spawned tanker.
Defined in:
RECOVERYTANKER
Return value:
#string:
Name of the tanker unit or nil if it does not exist.
Check if tanker is currently refueling another aircraft.
Defined in:
RECOVERYTANKER
Return value:
#boolean:
If true, tanker is refueling.
Check if tanker has returned to base.
Defined in:
RECOVERYTANKER
Return value:
#boolean:
If true, tanker has returned to base.
Check if tanker is currently returning to base.
Defined in:
RECOVERYTANKER
Return value:
#boolean:
If true, tanker is returning to base.
Check if tanker is currently operating.
Defined in:
RECOVERYTANKER
Return value:
#boolean:
If true, tanker is operating.
Check if FMS was stopped.
Defined in:
RECOVERYTANKER
Return value:
#boolean:
If true, is stopped.
Create new RECOVERYTANKER object.
Defined in:
RECOVERYTANKER
Parameters:
Wrapper.Unit#UNIT carrierunit
Carrier unit.
#string tankergroupname
Name of the late activated tanker aircraft template group.
Return value:
RECOVERYTANKER object.
On after "PatternEvent" event user function.
Called when a the pattern of the tanker is updated.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "RTB" event user function.
Called when a the the tanker returns to its home base.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Airbase#AIRBASE airbase
The airbase where the tanker should return to.
On after "RefuelStart" event user function.
Called when a the the tanker started to refuel another unit.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT receiver
Unit receiving fuel from the tanker.
On after "RefuelStop" event user function.
Called when a the the tanker stopped to refuel another unit.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT receiver
Unit that received fuel from the tanker.
On after "Returned" event user function.
Called when a the the tanker has landed at an airbase.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Airbase#AIRBASE airbase
The airbase the tanker has landed.
On after "Start" event function.
Called when FSM is started.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Event handler for engine shutdown of recovery tanker.
Respawn tanker group once it landed because it was out of fuel.
Event handler for landing of recovery tanker.
Triggers the FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position.
Defined in:
RECOVERYTANKER
Triggers the FSM event "RTB" that sends the tanker home.
Defined in:
RECOVERYTANKER
Parameter:
Wrapper.Airbase#AIRBASE airbase
The airbase where the tanker should return to.
Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft.
Defined in:
RECOVERYTANKER
Parameter:
Wrapper.Unit#UNIT receiver
Unit receiving fuel from the tanker.
Triggers the FSM event "RefuelStop" when the tanker stops refueling another aircraft.
Defined in:
RECOVERYTANKER
Parameter:
Wrapper.Unit#UNIT receiver
Unit stoped receiving fuel from the tanker.
Triggers the FSM event "Returned" after the tanker has landed.
Defined in:
RECOVERYTANKER
Parameter:
Wrapper.Airbase#AIRBASE airbase
The airbase the tanker has landed.
Triggers the FSM event "Run".
Simply puts the group into "Running" state.
Defined in:
RECOVERYTANKER
Set that the group takes the role of an AWACS instead of a refueling tanker.
Defined in:
RECOVERYTANKER
Parameters:
#boolean switch
If true or nil, set role AWACS.
#boolean eplrs
If true or nil, enable EPLRS. If false, EPLRS will be off.
Return value:
self
Set orbit pattern altitude of the tanker.
Defined in:
RECOVERYTANKER
Parameter:
#number altitude
Tanker altitude in feet. Default 6000 ft.
Return value:
self
Set callsign of the tanker group.
Defined in:
RECOVERYTANKER
Parameters:
#number callsignname
Number
#number callsignnumber
Number
Return value:
self
Deactivate debug mode.
This is also the default setting.
Activate debug mode.
Marks of pattern on F10 map and debug messages displayed on screen.
Set home airbase of the tanker.
This is the airbase where the tanker will go when it is out of fuel.
Defined in:
RECOVERYTANKER
Parameters:
Wrapper.Airbase#AIRBASE airbase
The home airbase. Can be the airbase name or a Moose AIRBASE object.
#number terminaltype
(Optional) The terminal type of parking spots used for spawning at airbases. Default AIRBASE.TerminalType.OpenMedOrBig.
Return value:
self
Set low fuel state of tanker.
When fuel is below this threshold, the tanker will RTB or be respawned if takeoff type is in air.
Defined in:
RECOVERYTANKER
Parameter:
#number fuelthreshold
Low fuel threshold in percent. Default 10 % of max fuel.
Return value:
self
Set modex (tail number) of the tanker.
Defined in:
RECOVERYTANKER
Parameter:
#number modex
Tail number.
Return value:
self
Set pattern update distance threshold.
Tanker will update its pattern when the carrier changes its position by more than this distance.
Defined in:
RECOVERYTANKER
Parameter:
#number distancechange
Distance threshold in NM. Default 5 NM (=9.62 km).
Return value:
self
Set pattern update heading threshold.
Tanker will update its pattern when the carrier changes its heading by more than this value.
Defined in:
RECOVERYTANKER
Parameter:
#number headingchange
Heading threshold in degrees. Default 5 degrees.
Return value:
self
Set minimum pattern update interval.
After a pattern update this time interval has to pass before the next update is allowed.
Defined in:
RECOVERYTANKER
Parameter:
#number interval
Min interval in minutes. Default is 10 minutes.
Return value:
self
Set race-track distances.
Defined in:
RECOVERYTANKER
Parameters:
#number distbow
Distance [NM] in front of the carrier. Default 10 NM.
#number diststern
Distance [NM] behind the carrier. Default 4 NM.
Return value:
self
Set radio frequency and optionally modulation of the tanker.
Defined in:
RECOVERYTANKER
Parameters:
#number frequency
Radio frequency in MHz. Default 251 MHz.
#string modulation
Radio modulation, either "AM" or "FM". Default "AM".
Return value:
self
Activate recovery by the AIRBOSS class.
Tanker will get a Marshal stack and perform a CASE I, II or III recovery when RTB.
Defined in:
RECOVERYTANKER
Parameter:
#boolean switch
If true or nil, recovery is done by AIRBOSS.
Return value:
self
Tanker will be respawned in air, even it was initially spawned on the carrier.
So only the first spawn will be on the carrier while all subsequent spawns will happen in air. This allows for undisrupted operations and less problems on the carrier deck.
Disable respawning of tanker.
Enable respawning of tanker.
Note that this is the default behaviour.
Set whether tanker shall be respawned or not.
Defined in:
RECOVERYTANKER
Parameter:
#boolean switch
If true (or nil), tanker will be respawned. If false, tanker will not be respawned.
Return value:
self
Set the speed the tanker flys in its orbit pattern.
Defined in:
RECOVERYTANKER
Parameter:
#number speed
True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS.
Return value:
self
Set TACAN channel of tanker.
Note that mode is automatically set to "Y" for AA TACAN since only that works.
Defined in:
RECOVERYTANKER
Parameters:
#number channel
TACAN channel. Default 1.
#string morse
TACAN morse code identifier. Three letters. Default "TKR".
#string mode
TACAN mode, which can be either "Y" (default) or "X".
Return value:
self
Disable automatic TACAN activation.
Set takeoff type.
Defined in:
RECOVERYTANKER
Parameter:
#number takeofftype
Takeoff type.
Return value:
self
Set takeoff in air at the defined pattern altitude and ~10 NM astern the carrier.
Set takeoff with engines off (cold).
Set takeoff with engines running (hot).
Set the tanker to have unlimited fuel.
Defined in:
RECOVERYTANKER
Parameter:
#boolean OnOff
If true, the tanker will have unlimited fuel.
Return value:
self
Use an uncontrolled aircraft already present in the mission rather than spawning a new tanker as initial recovery thanker.
This can be useful when interfaced with, e.g., a MOOSE Functional.Warehouse#WAREHOUSE. The group name is the one specified in the RECOVERYTANKER.New function.
Triggers the FSM event "Start" that starts the recovery tanker.
Initializes parameters and starts event handlers.
Defined in:
RECOVERYTANKER
Triggers the FSM event "Status" that updates the tanker status.
Defined in:
RECOVERYTANKER
Triggers the FSM event "Stop" that stops the recovery tanker.
Event handlers are stopped.
Defined in:
RECOVERYTANKER
Activate TACAN of tanker.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
Check if heading or position have changed significantly.
Defined in:
RECOVERYTANKER
Parameter:
#number dt
Time since last update in seconds.
Return value:
#boolean:
If true, heading and/or position have changed more than 5 degrees or 10 km, respectively.
Init waypoint after spawn.
Tanker is first guided to a position astern the carrier and starts its racetrack pattern from there.
Defined in:
RECOVERYTANKER
Parameters:
#number dist
Distance [NM] of initial waypoint astern carrier. Default 8 NM.
#number delay
Delay before routing in seconds. Default 1 second.
A unit crashed or died.
Self made race track pattern.
Not working as desired, since tanker changes course too rapidly after each waypoint.
Defined in:
RECOVERYTANKER
Return value:
#table:
Table of pattern waypoints.
Event handler for refueling started.
Event handler for refueling stopped.
Triggers the delayed FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "RTB" that sends the tanker home after a delay.
Defined in:
RECOVERYTANKER
Parameters:
#number delay
Delay in seconds.
Wrapper.Airbase#AIRBASE airbase
The airbase where the tanker should return to.
Triggers the delayed FSM event "Returned" after the tanker has landed.
Defined in:
RECOVERYTANKER
Parameters:
#number delay
Delay in seconds.
Wrapper.Airbase#AIRBASE airbase
The airbase the tanker has landed.
Triggers delayed the FSM event "Run".
Simply puts the group into "Running" state.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Start" that starts the recovery tanker after a delay.
Initializes parameters and starts event handlers.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
Triggers the delayed FSM event "Status" that updates the tanker status.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Stop" that stops the recovery tanker after a delay.
Event handlers are stopped.
Defined in:
RECOVERYTANKER
Parameter:
#number delay
Delay in seconds.
On after "PatternUpdate" event.
Updates the racetrack pattern of the tanker wrt the carrier position.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "RTB" event.
Send tanker back to carrier.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Airbase#AIRBASE airbase
The airbase where the tanker should return to.
On after Returned event.
The tanker has landed.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Airbase#AIRBASE airbase
The base at which the tanker landed.
On after Start event.
Starts the warehouse. Addes event handlers and schedules status updates of reqests and queue.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after Status event.
Checks player status.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after Stop event.
Unhandle events and stop status updates.
Defined in:
RECOVERYTANKER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Field(s)
Name of the class.
Debug mode.
Pattern update when carrier changes its position by more than this distance (meters).
Pattern update when carrier changes its heading by more than this number (degrees).
Radio frequency in MHz of the tanker. Default 251 MHz.
Radio modulation "AM" or "FM". Default "AM".
TACAN channel. Default 1.
TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations!
TACAN morse code. Three letters identifying the TACAN station. Default "TKR".
If true, TACAN is automatically activated. If false, TACAN is disabled.
Last time the pattern was updated.
The home airbase object of the tanker. Normally the aircraft carrier.
Alias of the spawn group.
Tanker orbit pattern altitude.
If true, the groups gets the enroute task AWACS instead of tanker.
Number for the callsign name.
Number of the callsign name.
Carrier type.
Minimum time interval in seconds before the next pattern update can happen.
Race-track distance bow. distBow is >0.
Race-track distance astern. distStern is <0.
If true, enable data link, e.g. if used as AWACS.
Log debug id text.
Low fuel threshold in percent.
Tail number of the tanker.
Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly.
Orientation of the carrier for checking if carrier is currently turning.
Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern.
If true, tanker will recover using the AIRBOSS marshal pattern.
If true, tanker be respawned (default). If false, no respawning will happen.
If true, tanker will always be respawned in air. This has no impact on the initial spawn setting.
Tanker speed when flying pattern.
Takeoff type (cold, hot, air).
Name of the late activated tanker template group.
Terminal type of used parking spots on airbases.
Unique ID of this tanker.
If true, use and uncontrolled tanker group already present in the mission.
If true, the tanker will have unlimited fuel.
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.