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. |
|
Call scheduler. |
|
Name of the class. |
|
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. |
|
Scores. |
|
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. |
|
Current state name. |
|
Check if FSM is in state. |
|
Options. |
|
Subs. |
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
RECOVERYTANKER:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
RECOVERYTANKER:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
RECOVERYTANKER:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
RECOVERYTANKER:CreateEventDynamicCargoUnloaded(DynamicCargo) |
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
RECOVERYTANKER:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default. |
|
UnSubscribe to a DCS event. |
|
RECOVERYTANKER:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
RECOVERYTANKER:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
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.
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)
Clear the state of an object.
Defined in:
Parameters:
Object
The object that holds the Value set by the Key.
StateName
The key that is should be cleared.
Creation of a Birth Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
#string IniUnitName
The initiating unit name.
place
subplace
Creation of a Crash Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
IniObjectCategory
Creation of a Dead Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Crash Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.Event processing Priority.
The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.
This is the worker method to retrieve the Parent class.
Note that the Parent class must be passed to call the parent class method.
self:GetParent(self):ParentMethod()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, or garbage collected, then the Values and Keys will also be gone.
Defined in:
Parameters:
Object
The object that holds the Value set by the Key.
Key
The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!
Return value:
The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.
Subscribe to a DCS Event.
Defined in:
Parameters:
Core.Event#EVENTS EventID
Event ID.
#function EventFunction
(optional) The function to be called when the event occurs for the unit.
Return value:
Log an information which will be traced always.
Can be anywhere within the function logic.
This is the worker method to inherit from a parent class.
Defined in:
Parameters:
Child
is the Child class that inherits.
#BASE Parent
is the Parent class that the Child inherits from.
Return value:
Child
This is the worker method to check if an object is an (sub)instance of a class.
Examples:
ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true
ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true
ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true
ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true
ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false
Defined in:
Parameter:
ClassName
is the name of the class or the class itself to run the check against
Return value:
#boolean:
Enquires if tracing is on (for the class).
BASE constructor.
This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.
function EVENT:New()
local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
return self
end
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
Unknown precisely what creates this event, likely tied into newer damage model.
Will update this page when new information become available.
- initiator: The unit that had the failure.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
Occurs on the death of a unit.
Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.
Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
- place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
- subplace: is always 0 for unknown reasons.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when the pilot of an aircraft is killed.
Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
Occurs when any modification to the "Score" as seen on the debrief menu would occur.
There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
Occurs when any unit begins firing a weapon that has a high rate of fire.
Most common with aircraft cannons (GAU-8), autocannons, and machine guns. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
Occurs whenever any unit in a mission fires a weapon.
But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
Schedule a new time event.
Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.
Defined in:
Parameters:
#number Start
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
#function SchedulerFunction
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
#table ...
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
Return value:
#string:
The Schedule ID of the planned schedule.
Schedule a new time event.
Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.
Defined in:
Parameters:
#number Start
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
#number Repeat
Specifies the interval in seconds when the scheduler will call the event function.
#number RandomizeFactor
Specifies a randomization factor between 0 and 1 to randomize the Repeat.
#number Stop
Specifies the amount of seconds when the scheduler will be stopped.
#function SchedulerFunction
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
#table ...
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
Return value:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.Event processing Priority.
The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, or garbage collected, then the Values and Keys will also be gone.
Defined in:
Parameters:
Object
The object that will hold the Value set by the Key.
Key
The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!
Value
The value to is stored in the object.
Return value:
The Value set.
Trace a function logic level 1.
Can be anywhere within the function logic.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace level
Set trace off.
Set trace on.
Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.
So tracing must be switched on manually in your mission if you are using Moose statically. When moose is loading dynamically (for moose class development), tracing is switched on by default.
Defined in:
Parameter:
#boolean TraceOnOff
Switch the tracing on or off.
Usage:
-- Switch the tracing On
BASE:TraceOnOff( true )
-- Switch the tracing Off
BASE:TraceOnOff( false )
UnSubscribe to a DCS event.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.