Banner Image

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.

#RECOVERYTANKER RECOVERYTANKER

Recovery Tanker.


Banner Image

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.

Banner Image

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

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:

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

RECOVERYTANKER.ClassName

Name of the class.

RECOVERYTANKER.Debug

Debug mode.

RECOVERYTANKER.Dupdate

Pattern update when carrier changes its position by more than this distance (meters).

RECOVERYTANKER:GetAlias()

Alias of tanker spawn group.

RECOVERYTANKER:GetUnitName()

Get unit name of the spawned tanker.

RECOVERYTANKER.Hupdate

Pattern update when carrier changes its heading by more than this number (degrees).

RECOVERYTANKER:IsRefueling()

Check if tanker is currently refueling another aircraft.

RECOVERYTANKER:IsReturned()

Check if tanker has returned to base.

RECOVERYTANKER:IsReturning()

Check if tanker is currently returning to base.

RECOVERYTANKER:IsRunning()

Check if tanker is currently operating.

RECOVERYTANKER:IsStopped()

Check if FMS was stopped.

RECOVERYTANKER:New(carrierunit, tankergroupname)

Create new RECOVERYTANKER object.

RECOVERYTANKER:OnAfterPatternUpdate(From, Event, To)

On after "PatternEvent" event user function.

RECOVERYTANKER:OnAfterRTB(From, Event, To, airbase)

On after "RTB" event user function.

RECOVERYTANKER:OnAfterRefuelStart(From, Event, To, receiver)

On after "RefuelStart" event user function.

RECOVERYTANKER:OnAfterRefuelStop(From, Event, To, receiver)

On after "RefuelStop" event user function.

RECOVERYTANKER:OnAfterReturned(From, Event, To, airbase)

On after "Returned" event user function.

RECOVERYTANKER:OnAfterStart(From, Event, To)

On after "Start" event function.

RECOVERYTANKER:OnEventEngineShutdown(EventData)

Event handler for engine shutdown of recovery tanker.

RECOVERYTANKER:OnEventLand(EventData)

Event handler for landing of recovery tanker.

RECOVERYTANKER:PatternUpdate()

Triggers the FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position.

RECOVERYTANKER:RTB(airbase)

Triggers the FSM event "RTB" that sends the tanker home.

RECOVERYTANKER.RadioFreq

Radio frequency in MHz of the tanker. Default 251 MHz.

RECOVERYTANKER.RadioModu

Radio modulation "AM" or "FM". Default "AM".

RECOVERYTANKER:RefuelStart(receiver)

Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft.

RECOVERYTANKER:RefuelStop(receiver)

Triggers the FSM event "RefuelStop" when the tanker stops refueling another aircraft.

RECOVERYTANKER:Returned(airbase)

Triggers the FSM event "Returned" after the tanker has landed.

RECOVERYTANKER:Run()

Triggers the FSM event "Run".

RECOVERYTANKER:SetAWACS(switch, eplrs)

Set that the group takes the role of an AWACS instead of a refueling tanker.

RECOVERYTANKER:SetAltitude(altitude)

Set orbit pattern altitude of the tanker.

RECOVERYTANKER:SetCallsign(callsignname, callsignnumber)

Set callsign of the tanker group.

RECOVERYTANKER:SetDebugModeOFF()

Deactivate debug mode.

RECOVERYTANKER:SetDebugModeON()

Activate debug mode.

RECOVERYTANKER:SetHomeBase(airbase, terminaltype)

Set home airbase of the tanker.

RECOVERYTANKER:SetLowFuelThreshold(fuelthreshold)

Set low fuel state of tanker.

RECOVERYTANKER:SetModex(modex)

Set modex (tail number) of the tanker.

RECOVERYTANKER:SetPatternUpdateDistance(distancechange)

Set pattern update distance threshold.

RECOVERYTANKER:SetPatternUpdateHeading(headingchange)

Set pattern update heading threshold.

RECOVERYTANKER:SetPatternUpdateInterval(interval)

Set minimum pattern update interval.

RECOVERYTANKER:SetRacetrackDistances(distbow, diststern)

Set race-track distances.

RECOVERYTANKER:SetRadio(frequency, modulation)

Set radio frequency and optionally modulation of the tanker.

RECOVERYTANKER:SetRecoveryAirboss(switch)

Activate recovery by the AIRBOSS class.

RECOVERYTANKER:SetRespawnInAir()

Tanker will be respawned in air, even it was initially spawned on the carrier.

RECOVERYTANKER:SetRespawnOff()

Disable respawning of tanker.

RECOVERYTANKER:SetRespawnOn()

Enable respawning of tanker.

RECOVERYTANKER:SetRespawnOnOff(switch)

Set whether tanker shall be respawned or not.

RECOVERYTANKER:SetSpeed(speed)

Set the speed the tanker flys in its orbit pattern.

RECOVERYTANKER:SetTACAN(channel, morse, mode)

Set TACAN channel of tanker.

RECOVERYTANKER:SetTACANoff()

Disable automatic TACAN activation.

RECOVERYTANKER:SetTakeoff(takeofftype)

Set takeoff type.

RECOVERYTANKER:SetTakeoffAir()

Set takeoff in air at the defined pattern altitude and ~10 NM astern the carrier.

RECOVERYTANKER:SetTakeoffCold()

Set takeoff with engines off (cold).

RECOVERYTANKER:SetTakeoffHot()

Set takeoff with engines running (hot).

RECOVERYTANKER:SetUnlimitedFuel(OnOff)

Set the tanker to have unlimited fuel.

RECOVERYTANKER:SetUseUncontrolledAircraft()

Use an uncontrolled aircraft already present in the mission rather than spawning a new tanker as initial recovery thanker.

RECOVERYTANKER:Start()

Triggers the FSM event "Start" that starts the recovery tanker.

RECOVERYTANKER:Status()

Triggers the FSM event "Status" that updates the tanker status.

RECOVERYTANKER:Stop()

Triggers the FSM event "Stop" that stops the recovery tanker.

RECOVERYTANKER.TACANchannel

TACAN channel. Default 1.

RECOVERYTANKER.TACANmode

TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations!

RECOVERYTANKER.TACANmorse

TACAN morse code. Three letters identifying the TACAN station. Default "TKR".

RECOVERYTANKER.TACANon

If true, TACAN is automatically activated. If false, TACAN is disabled.

RECOVERYTANKER.Tupdate

Last time the pattern was updated.

RECOVERYTANKER:_ActivateTACAN(delay)

Activate TACAN of tanker.

RECOVERYTANKER:_CheckPatternUpdate(dt)

Check if heading or position have changed significantly.

RECOVERYTANKER:_InitPatternTaskFunction()

Task function to

RECOVERYTANKER:_InitRoute(dist, delay)

Init waypoint after spawn.

RECOVERYTANKER:_OnEventCrashOrDead(EventData)

A unit crashed or died.

RECOVERYTANKER:_Pattern()

Self made race track pattern.

RECOVERYTANKER:_RefuelingStart(EventData)

Event handler for refueling started.

RECOVERYTANKER:_RefuelingStop(EventData)

Event handler for refueling stopped.

RECOVERYTANKER:__PatternUpdate(delay)

Triggers the delayed FSM event "PatternUpdate" that updates the pattern of the tanker wrt to the carrier position.

RECOVERYTANKER:__RTB(delay, airbase)

Triggers the FSM event "RTB" that sends the tanker home after a delay.

RECOVERYTANKER:__Returned(delay, airbase)

Triggers the delayed FSM event "Returned" after the tanker has landed.

RECOVERYTANKER:__Run(delay)

Triggers delayed the FSM event "Run".

RECOVERYTANKER:__Start(delay)

Triggers the FSM event "Start" that starts the recovery tanker after a delay.

RECOVERYTANKER:__Status(delay)

Triggers the delayed FSM event "Status" that updates the tanker status.

RECOVERYTANKER:__Stop(delay)

Triggers the FSM event "Stop" that stops the recovery tanker after a delay.

RECOVERYTANKER.airbase

The home airbase object of the tanker. Normally the aircraft carrier.

RECOVERYTANKER.alias

Alias of the spawn group.

RECOVERYTANKER.altitude

Tanker orbit pattern altitude.

RECOVERYTANKER.awacs

If true, the groups gets the enroute task AWACS instead of tanker.

RECOVERYTANKER.beacon

Tanker TACAN beacon.

RECOVERYTANKER.callsignname

Number for the callsign name.

RECOVERYTANKER.callsignnumber

Number of the callsign name.

RECOVERYTANKER.carrier

The carrier the tanker is attached to.

RECOVERYTANKER.carriertype

Carrier type.

RECOVERYTANKER.dTupdate

Minimum time interval in seconds before the next pattern update can happen.

RECOVERYTANKER.distBow

Race-track distance bow. distBow is >0.

RECOVERYTANKER.distStern

Race-track distance astern. distStern is <0.

RECOVERYTANKER.eplrs

If true, enable data link, e.g. if used as AWACS.

RECOVERYTANKER.lid

Log debug id text.

RECOVERYTANKER.lowfuel

Low fuel threshold in percent.

RECOVERYTANKER.modex

Tail number of the tanker.

RECOVERYTANKER:onafterPatternUpdate(From, Event, To)

On after "PatternUpdate" event.

RECOVERYTANKER:onafterRTB(From, Event, To, airbase)

On after "RTB" event.

RECOVERYTANKER:onafterReturned(From, Event, To, airbase)

On after Returned event.

RECOVERYTANKER:onafterStart(From, Event, To)

On after Start event.

RECOVERYTANKER:onafterStatus(From, Event, To)

On after Status event.

RECOVERYTANKER:onafterStop(From, Event, To)

On after Stop event.

RECOVERYTANKER.orientation

Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly.

RECOVERYTANKER.orientlast

Orientation of the carrier for checking if carrier is currently turning.

RECOVERYTANKER.position

Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern.

RECOVERYTANKER.recovery

If true, tanker will recover using the AIRBOSS marshal pattern.

RECOVERYTANKER.respawn

If true, tanker be respawned (default). If false, no respawning will happen.

RECOVERYTANKER.respawninair

If true, tanker will always be respawned in air. This has no impact on the initial spawn setting.

RECOVERYTANKER.speed

Tanker speed when flying pattern.

RECOVERYTANKER.takeoff

Takeoff type (cold, hot, air).

RECOVERYTANKER.tanker

Tanker group.

RECOVERYTANKER.tankergroupname

Name of the late activated tanker template group.

RECOVERYTANKER.terminaltype

Terminal type of used parking spots on airbases.

RECOVERYTANKER.uid

Unique ID of this tanker.

RECOVERYTANKER.uncontrolledac

If true, use and uncontrolled tanker group already present in the mission.

RECOVERYTANKER.unlimitedfuel

If true, the tanker will have unlimited fuel.

RECOVERYTANKER.version

Class version.

Fields and Methods inherited from FSM Description

RECOVERYTANKER:AddEndState(State)

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.

RECOVERYTANKER:AddScore(State, ScoreText, Score)

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.

RECOVERYTANKER:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

RECOVERYTANKER.CallScheduler

RECOVERYTANKER.Events

RECOVERYTANKER:GetCurrentState()

Get current state.

RECOVERYTANKER:GetEndStates()

Returns the End states.

RECOVERYTANKER:GetProcess(From, Event)

RECOVERYTANKER:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

RECOVERYTANKER:GetScores()

Returns a table with the scores defined.

RECOVERYTANKER:GetStartState()

Returns the start state of the FSM.

RECOVERYTANKER:GetState()

Get current state.

RECOVERYTANKER:GetSubs()

Returns a table with the Subs defined.

RECOVERYTANKER:GetTransitions()

Returns a table of the transition rules defined within the FSM.

RECOVERYTANKER:Is(State)

Check if FSM is in state.

RECOVERYTANKER:LoadCallBacks(CallBackTable)

Load call backs.

RECOVERYTANKER:New()

Creates a new FSM object.

RECOVERYTANKER.Scores

RECOVERYTANKER:SetProcess(From, Event, Fsm)

RECOVERYTANKER:SetStartState(State)

Sets the start state of the FSM.

RECOVERYTANKER._EndStates

RECOVERYTANKER._EventSchedules

RECOVERYTANKER._Processes

RECOVERYTANKER._Scores

RECOVERYTANKER._StartState

RECOVERYTANKER._Transitions

RECOVERYTANKER:_add_to_map(Map, Event)

Add to map.

RECOVERYTANKER:_call_handler(step, trigger, params, EventName)

Call handler.

RECOVERYTANKER:_create_transition(EventName)

Create transition.

RECOVERYTANKER:_delayed_transition(EventName)

Delayed transition.

RECOVERYTANKER:_eventmap(Events, EventStructure)

Event map.

RECOVERYTANKER:_gosub(ParentFrom, ParentEvent)

Go sub.

RECOVERYTANKER:_handler(EventName, ...)

Handler.

RECOVERYTANKER:_isendstate(Current)

Is end state.

RECOVERYTANKER:_submap(subs, sub, name)

Sub maps.

RECOVERYTANKER:can(e)

Check if can do an event.

RECOVERYTANKER:cannot(e)

Check if cannot do an event.

RECOVERYTANKER.current

RECOVERYTANKER.endstates

RECOVERYTANKER:is(State, state)

Check if FSM is in state.

RECOVERYTANKER.options

RECOVERYTANKER.subs

RECOVERYTANKER class.

Field(s)

#string RECOVERYTANKER.ClassName

Name of the class.

#boolean RECOVERYTANKER.Debug

Debug mode.

#number RECOVERYTANKER.Dupdate

Pattern update when carrier changes its position by more than this distance (meters).

#number RECOVERYTANKER.Hupdate

Pattern update when carrier changes its heading by more than this number (degrees).

#number RECOVERYTANKER.RadioFreq

Radio frequency in MHz of the tanker. Default 251 MHz.

#string RECOVERYTANKER.RadioModu

Radio modulation "AM" or "FM". Default "AM".

#number RECOVERYTANKER.TACANchannel

TACAN channel. Default 1.

#string RECOVERYTANKER.TACANmode

TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations!

#string RECOVERYTANKER.TACANmorse

TACAN morse code. Three letters identifying the TACAN station. Default "TKR".

#boolean RECOVERYTANKER.TACANon

If true, TACAN is automatically activated. If false, TACAN is disabled.

#number RECOVERYTANKER.Tupdate

Last time the pattern was updated.

Wrapper.Airbase#AIRBASE RECOVERYTANKER.airbase

The home airbase object of the tanker. Normally the aircraft carrier.

#string RECOVERYTANKER.alias

Alias of the spawn group.

#number RECOVERYTANKER.altitude

Tanker orbit pattern altitude.

#boolean RECOVERYTANKER.awacs

If true, the groups gets the enroute task AWACS instead of tanker.

#number RECOVERYTANKER.callsignname

Number for the callsign name.

#number RECOVERYTANKER.callsignnumber

Number of the callsign name.

Wrapper.Unit#UNIT RECOVERYTANKER.carrier

The carrier the tanker is attached to.

#string RECOVERYTANKER.carriertype

Carrier type.

#number RECOVERYTANKER.dTupdate

Minimum time interval in seconds before the next pattern update can happen.

#number RECOVERYTANKER.distBow

Race-track distance bow. distBow is >0.

#number RECOVERYTANKER.distStern

Race-track distance astern. distStern is <0.

#boolean RECOVERYTANKER.eplrs

If true, enable data link, e.g. if used as AWACS.

#string RECOVERYTANKER.lid

Log debug id text.

#number RECOVERYTANKER.lowfuel

Low fuel threshold in percent.

#string RECOVERYTANKER.modex

Tail number of the tanker.

DCS#Vec3 RECOVERYTANKER.orientation

Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly.

DCS#Vec3 RECOVERYTANKER.orientlast

Orientation of the carrier for checking if carrier is currently turning.

Core.Point#COORDINATE RECOVERYTANKER.position

Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern.

#boolean RECOVERYTANKER.recovery

If true, tanker will recover using the AIRBOSS marshal pattern.

#boolean RECOVERYTANKER.respawn

If true, tanker be respawned (default). If false, no respawning will happen.

#boolean RECOVERYTANKER.respawninair

If true, tanker will always be respawned in air. This has no impact on the initial spawn setting.

#number RECOVERYTANKER.speed

Tanker speed when flying pattern.

#number RECOVERYTANKER.takeoff

Takeoff type (cold, hot, air).

#string RECOVERYTANKER.tankergroupname

Name of the late activated tanker template group.

#number RECOVERYTANKER.terminaltype

Terminal type of used parking spots on airbases.

#number RECOVERYTANKER.uid

Unique ID of this tanker.

#boolean RECOVERYTANKER.uncontrolledac

If true, use and uncontrolled tanker group already present in the mission.

#boolean RECOVERYTANKER.unlimitedfuel

If true, the tanker will have unlimited fuel.

#string RECOVERYTANKER.version

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.

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.

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.

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.

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.

Defined in:

RECOVERYTANKER

Parameter:

Event data.

Event handler for landing of recovery tanker.

Defined in:

RECOVERYTANKER

Parameter:

Event data.

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:

The airbase where the tanker should return to.

Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft.

Defined in:

RECOVERYTANKER

Parameter:

Unit receiving fuel from the tanker.

Triggers the FSM event "RefuelStop" when the tanker stops refueling another aircraft.

Defined in:

RECOVERYTANKER

Parameter:

Unit stoped receiving fuel from the tanker.

Triggers the FSM event "Returned" after the tanker has landed.

Defined in:

RECOVERYTANKER

Parameter:

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:

Set orbit pattern altitude of the tanker.

Defined in:

RECOVERYTANKER

Parameter:

#number altitude

Tanker altitude in feet. Default 6000 ft.

Return value:

Set callsign of the tanker group.

Defined in:

RECOVERYTANKER

Parameters:

#number callsignname

Number

#number callsignnumber

Number

Return value:

Deactivate debug mode.

This is also the default setting.

Defined in:

RECOVERYTANKER

Return value:

Activate debug mode.

Marks of pattern on F10 map and debug messages displayed on screen.

Defined in:

RECOVERYTANKER

Return value:

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:

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:

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:

Set modex (tail number) of the tanker.

Defined in:

RECOVERYTANKER

Parameter:

#number modex

Tail number.

Return value:

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:

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:

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:

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:

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:

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:

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.

Defined in:

RECOVERYTANKER

Return value:

Disable respawning of tanker.

Defined in:

RECOVERYTANKER

Return value:

Enable respawning of tanker.

Note that this is the default behaviour.

Defined in:

RECOVERYTANKER

Return value:

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:

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:

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:

Disable automatic TACAN activation.

Defined in:

RECOVERYTANKER

Return value:

Set takeoff type.

Defined in:

RECOVERYTANKER

Parameter:

#number takeofftype

Takeoff type.

Return value:

Set takeoff in air at the defined pattern altitude and ~10 NM astern the carrier.

Defined in:

RECOVERYTANKER

Return value:

Set takeoff with engines off (cold).

Defined in:

RECOVERYTANKER

Return value:

Set takeoff with engines running (hot).

Defined in:

RECOVERYTANKER

Return value:

Set the tanker to have unlimited fuel.

Defined in:

RECOVERYTANKER

Parameter:

#boolean OnOff

If true, the tanker will have unlimited fuel.

Return value:

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.

Defined in:

RECOVERYTANKER

Return value:

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.

Task function to

Defined in:

RECOVERYTANKER

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.

Defined in:

RECOVERYTANKER

Parameter:

Event data.

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.

Defined in:

RECOVERYTANKER

Parameter:

Event data.

Event handler for refueling stopped.

Defined in:

RECOVERYTANKER

Parameter:

Event data.

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.

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.

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.

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.

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)

#string RECOVERYTANKER.ClassName

Name of the class.

#boolean RECOVERYTANKER.Debug

Debug mode.

#number RECOVERYTANKER.Dupdate

Pattern update when carrier changes its position by more than this distance (meters).

#number RECOVERYTANKER.Hupdate

Pattern update when carrier changes its heading by more than this number (degrees).

#number RECOVERYTANKER.RadioFreq

Radio frequency in MHz of the tanker. Default 251 MHz.

#string RECOVERYTANKER.RadioModu

Radio modulation "AM" or "FM". Default "AM".

#number RECOVERYTANKER.TACANchannel

TACAN channel. Default 1.

#string RECOVERYTANKER.TACANmode

TACAN mode, i.e. "X" or "Y". Default "Y". Use only "Y" for AA TACAN stations!

#string RECOVERYTANKER.TACANmorse

TACAN morse code. Three letters identifying the TACAN station. Default "TKR".

#boolean RECOVERYTANKER.TACANon

If true, TACAN is automatically activated. If false, TACAN is disabled.

#number RECOVERYTANKER.Tupdate

Last time the pattern was updated.

Wrapper.Airbase#AIRBASE RECOVERYTANKER.airbase

The home airbase object of the tanker. Normally the aircraft carrier.

#string RECOVERYTANKER.alias

Alias of the spawn group.

#number RECOVERYTANKER.altitude

Tanker orbit pattern altitude.

#boolean RECOVERYTANKER.awacs

If true, the groups gets the enroute task AWACS instead of tanker.

#number RECOVERYTANKER.callsignname

Number for the callsign name.

#number RECOVERYTANKER.callsignnumber

Number of the callsign name.

Wrapper.Unit#UNIT RECOVERYTANKER.carrier

The carrier the tanker is attached to.

#string RECOVERYTANKER.carriertype

Carrier type.

#number RECOVERYTANKER.dTupdate

Minimum time interval in seconds before the next pattern update can happen.

#number RECOVERYTANKER.distBow

Race-track distance bow. distBow is >0.

#number RECOVERYTANKER.distStern

Race-track distance astern. distStern is <0.

#boolean RECOVERYTANKER.eplrs

If true, enable data link, e.g. if used as AWACS.

#string RECOVERYTANKER.lid

Log debug id text.

#number RECOVERYTANKER.lowfuel

Low fuel threshold in percent.

#string RECOVERYTANKER.modex

Tail number of the tanker.

DCS#Vec3 RECOVERYTANKER.orientation

Orientation of the carrier. Used to monitor changes and update the pattern if heading changes significantly.

DCS#Vec3 RECOVERYTANKER.orientlast

Orientation of the carrier for checking if carrier is currently turning.

Core.Point#COORDINATE RECOVERYTANKER.position

Position of carrier. Used to monitor if carrier significantly changed its position and then update the tanker pattern.

#boolean RECOVERYTANKER.recovery

If true, tanker will recover using the AIRBOSS marshal pattern.

#boolean RECOVERYTANKER.respawn

If true, tanker be respawned (default). If false, no respawning will happen.

#boolean RECOVERYTANKER.respawninair

If true, tanker will always be respawned in air. This has no impact on the initial spawn setting.

#number RECOVERYTANKER.speed

Tanker speed when flying pattern.

#number RECOVERYTANKER.takeoff

Takeoff type (cold, hot, air).

#string RECOVERYTANKER.tankergroupname

Name of the late activated tanker template group.

#number RECOVERYTANKER.terminaltype

Terminal type of used parking spots on airbases.

#number RECOVERYTANKER.uid

Unique ID of this tanker.

#boolean RECOVERYTANKER.uncontrolledac

If true, use and uncontrolled tanker group already present in the mission.

#boolean RECOVERYTANKER.unlimitedfuel

If true, the tanker will have unlimited fuel.

#string RECOVERYTANKER.version

Class version.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM 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.

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.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

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.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

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.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

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.