Banner Image

Module Ops.TARS

Global(s)

Global TARS

Simulates photo-reconnaissance and visual-observation missions in DCS World.

#TARS TARS

Simulates photo-reconnaissance and visual-observation missions in DCS World.

Players fly designated recon aircraft or helicopters, activate the film from the F10 radio menu, overfly enemy units within the sensor's flight envelope, and return to an allied airbase or FARP to trigger a debrief. Detected targets are published as coalition-only F10 map markers and optional scoring credits are awarded.

Quick-start

The system initialises automatically at the bottom of this file:

     local locale = "de"           -- optional, default is "en"
     TARS_Instance = TARS:New(locale)

Nothing else is required. Adjust the configuration fields at the top of the file (TARS.filmLimitMax, TARS.parameters, TARS.allowedAmmo, …) to fit your mission before loading.

Important: TARS:New() creates a (deep) copy of the TARS class table. All configuration and runtime state is read from that instance. So either change TARS.* fields before calling TARS:New(), or change the fields on the returned instance afterwards, e.g. TARS_Instance.filmLimitMax = 10. Changing TARS.* after TARS:New() has no effect on the running instance.

To share an existing MOOSE SCORING object instead of creating a second one, pass it to the constructor:

     local myScoring = SCORING:New("My Mission")
     TARS_Instance = TARS:New("en", myScoring)

How it works

  • Footprint (cameras): the camera looks forward-down at offset (depression angle, radians) with a full opening angle of fov (degrees). On flat ground this projects an ellipse ahead of the aircraft. Units and, optionally, statics inside the ellipse are captured when AGL is between minAlt and maxAlt and roll/pitch are below maxRoll/maxPitch (degrees).
  • Footprint (visual helicopters, optimalAlt set): a circle AGL * tan(offset) ahead of the helicopter (here offset is measured from the vertical) whose radius is interpolated from minRange/optimalRange/maxRange over minAlt/optimalAlt/maxAlt.
  • Capture interval: each tick uses one exposition (duration). The time to the next tick is derived from footprint size, ground speed and overlap, clamped to min_interval..120 seconds.
  • Debrief: after the film is stopped (menu, film exhausted or capture limit reached) land within landingDistance of a friendly airbase/FARP. Stopping the film while already on the ground at a base also starts the debrief.

Player workflow

1. Spawn into a recon-capable slot and open the F10 › Task TARS radio menu.
2. Select TARS validation on the ground. The system checks your loadout and reports the platform's altitude band, FOV, and available film. The validation item then disappears once approved. 3. Take off. Start filming / STB & Resume / Stop filming appear in the menu.
4. Select TARS mode : Start filming to begin recording.
5. Fly over enemy units within the sensor's altitude/attitude envelope.
Each detected unit is confirmed in the HUD (+1 Captured target).
6. Use TARS mode : STB & Resume to pause (e.g. to refuel).
Film resumes automatically on the next takeoff if the loadout is still valid.
7. Select TARS mode : Stop filming or let the film timer expire.
8. Land at an allied airbase or FARP within TARS.landingDistance metres.
The film controls disappear. After landingDelay + debriefDelay seconds the intel marks appear on the F10 map and scoring credits are awarded. After the debrief the TARS validation item reappears for the next sortie.

Localization

All player-facing strings are defined in TARS.Messages using a table.

Platforms and Settings

Player group name filters

     TARS.recoNameFilter = { enabled=false, keyword="Reco" } -- Only allow groups with this keyword in the name

Adding a new platform

Add an entry to TARS.reconTypes and a matching typename and profile to TARS.parameters:

   TARS_Instance.reconTypes["F-16C_50"] = true
   TARS_Instance.parameters["F-16C_50"] = {
       minAlt=300, maxAlt=8000, maxRoll=10, maxPitch=15, -- Note altitude is AGL!
       fov=35, duration=300, offset=math.rad(20), -- fov = field of view, duration = # max of photos, offset = camera angle in Radians
       name="F-16C with RECCE pod"
   }

Optical System Parameters Demonstrator

The optical system is like a torchlight, the further away from the ground you are, the larger is the area covered. One underestimated effect is however, that on flat land, because at angle, you actually cover an elliptic area. You can checkout the effects of various parameters on this demonstrator.

Available Platforms are

   TARS.reconTypes = {
     ["MiG-21Bis"]=true, ["AJS37"]=true, ["Mirage-F1EE"]=true,
     ["F-5E-3"]=true,    ["F-14A-135-GR"]=true, ["F-14B"]=true,
     ["F-4E-45MC"]=true, ["P-51D"]=true, ["P-51D-30-NA"]=true,
     ["SpitfireLFMkIX"]=true, ["FW-190A8"]=true, ["FW-190D9"]=true,
     ["SA342M"]=true, ["SA342L"]=true, ["UH-1H"]=true, ["OH58D"]=true,
     ["Mi-8MT"]=true, ["MH-6J"]=true,
     ["OH-6A"]=true,}

Allowed weapon types on the platforms are - will be validated by the script

Gun ammo is always allowed and does not need to be listed.

   TARS.allowedAmmo = {
     ["AIM-9B"]=true,["AIM-9D"]=true,["AIM-9E"]=true,["AIM-9G"]=true,
     ["AIM-9H"]=true,["AIM-9J"]=true,["AIM-9L"]=true,["AIM-9M"]=true,
     ["AIM-9N"]=true,["AIM-9P"]=true,["AIM-9P3"]=true,["AIM-9P5"]=true,
     ["AIM-9JULI"]=true,
     ["R-3S"]=true,["R-13M"]=true,["R-13M1"]=true,["R-60"]=true,["R-60M"]=true,
     ["R550 Magic II"]=true,
     ["7_62x51"]=true,}

Film and detection settings

   TARS.filmLimitEnabled = true
   TARS.filmLimitMax     = 25        -- max 25 captured objects
   TARS.detectUnits      = true      -- capture UNIT objects
   TARS.detectStatics    = false     -- capture STATIC objects incl. of FARPs

Target UNIT Filters

   TARS.units = { air=false, ground=true, ship=true }

Target UNIT Name Filters

You always only detect UNITs of the other coalition. E.g. below - a RED unit would only detect BLUE units which have "Hawk" somewhere in the UNIT name. Name keywords are tested independent of capitalization, it doesn't matter if it is Hawk, HAWK, or hAwK.

   TARS.targetNameFilter = { enabled = true, keywords = { [coalition.side.BLUE] = { "Hawk" }, [coalition.side.RED]  = { "Scud" },},}    

Target STATIC Filters

   TARS.statics = {
     farps=true,
     captureExceptions=false, captureExceptionsList={}, -- these are mutually exclusive, either exceptions from the typename list captureExceptionsList **or**
     captureUnique=false,     captureUniqueList={},}    -- unique (once only) typenames from the captureUniqueList!

Other Settings

   TARS.debug           = false
   TARS.mooseScoring    = true       -- if true use MOOSE scoring
   TARS.valueScoring    = 100        -- points per detection
   TARS.landingDelay    = 30         -- check valid landing after this many seconds
   TARS.debriefDelay    = 60         -- show debriefing after this many seconds
   TARS.landingDistance = 2500       -- land closer than this many meters to a friendly base for debrief
   TARS.PilotParameterHelper = false -- show helper checks on pitch/roll/AGL parameters

SRS integration

All player messages route through TARS:_MsgUnit() and TARS:_MsgCoalition(). To broadcast over SRS, init the SRS system with TARS_Instance:SetSRS(...), provide the necessary parameters.

Scoring

Two scoring backends are supported:

  • MOOSE SCORING — TARS.mooseScoring = true (default, set before TARS:New()). Uses the SCORING object passed to TARS:New(locale, Scoring) or creates one, and awards TARS_Instance.valueScoring points per target.

  • DCSBot — used when mooseScoring is false. Awards ceil(count/4) credits via dcsbot.addUserPoints() if the DCSBot table is present.

No points are awarded for a debrief without (new or updated) targets.

Mission Scripting integration

Moose FSM Style callback functions are available for mission designers. Optionally overwrite with own function. Processed after landing on debriefing analysis:

     function mytars:OnBeforeDataProcessing(Snapshot) -- provides a #TARS.Snapshot data table for a captured object, function must return true to call the OnAfterDataProcessing() function next.

     function mytars:OnAfterDataProcessing(Snapshot) -- provides a #TARS.Snapshot data table for a captured object for use in your mission script.

Global TARS_SESSION

Tracks all states for a single recon sortie.

#TARS_SESSION TARS_SESSION

Tracks all states for a single recon sortie.

One instance is created per player per flight when they take off from a validated slot. It holds the remaining film, the list of targets captured this pass, and all flags that drive the capture state-machine.

Instances are stored in TARS_Instance.instances[unitName] and are reset (not destroyed) at the end of each successful debrief so the pilot can fly another sortie in the same slot without rejoining.

Type(s)

#
Fields and Methods inherited from # Description

#.parameters

TARS , extends Core.Base#BASE
Fields and Methods inherited from TARS Description

TARS:AddBaseMenu(unit, playerName)

[INTERNAL] Creates the Task TARS F10 sub-menu and its initial items.

TARS:CheckIfRecon(unit)

[INTERNAL] Validates the aircraft loadout.

TARS:CheckTask(unit)

[INTERNAL] Validates loadout on the ground and sets the approved flag.

TARS:Control(instance)

[INTERNAL] Arms the capture session.

TARS:CreateInstance(unit)

[INTERNAL] Creates and registers a new TARS_SESSION.

TARS:GetInstance(unitName)

[INTERNAL] Returns the active TARS_SESSION for a unit name, or nil.

TARS:IsNearAlliedBase(unit)

[INTERNAL] Returns true if the unit is within landingDistance of any allied base/FARP.

TARS.Messages

Nested localization table: TARS.Messages[locale][messageID] = string.

TARS:New(locale, Scoring)

Creates the TARS singleton and wires up all event handlers.

TARS:OnAfterDataProcessing(TargetSnap)

Moose FSM Style callback function for mission designers.

TARS:OnBeforeDataProcessing(TargetSnap)

Moose FSM Style callback function for mission designers.

TARS:OutMark(snap, coa)

[INTERNAL] Places a coalition F10 map marker for a detected target snapshot.

TARS.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

TARS:ProcessLanding(instance)

[INTERNAL] Debrief: publishes marks and awards points after a valid landing.

TARS:RemoveGroundMenu(playerName)

[INTERNAL] Removes the TARS F10 menu for a player.

TARS:RemoveUnusedMarks(_, time)

[INTERNAL] Removes F10 marks for units and statics that no longer exist.

TARS.SRS

TARS.SRSSpeaker

TARS:SetSRS(Path, Frequency, Modulation, Culture, Gender, Voice, Coalition, Port, Speed, Provider, Backend, Speaker)

Configure SRS radio output.

TARS:SetSRSPiperSpeaker(Speaker)

Set SRS Voice Speaker for Hound/Piper.

TARS:ShowPlatformInfo(instance)

[INTERNAL] Sends platform capabilities as a HUD message.

TARS:StandbyCapture(instance)

[INTERNAL] Toggles film standby on/off.

TARS:StopCapture(instance)

[INTERNAL] Ends the capture session; marks it as awaiting debrief.

TARS:_AddUserPoints(name, points)

[INTERNAL] Awards credits via DCSBot (if loaded).

TARS:_CbInfo(playerName)

[INTERNAL] F10 callback: show platform info.

TARS:_CbStart(playerName)

[INTERNAL] F10 callback: start capture.

TARS:_CbStb(playerName)

[INTERNAL] F10 callback: toggle STB.

TARS:_CbStop(playerName)

[INTERNAL] F10 callback: stop capture.

TARS:_CbValidate(playerName)

[INTERNAL] F10 callback: ground validation.

TARS:_GetUnitFromPlayerName(playerName)

[INTERNAL] Resolves the MOOSE UNIT for a player from the groundMenus registry.

TARS:_MatchRecoNameFilter(name)

[INTERNAL] Checks a group name against recoNameFilter (plain text, case-insensitive).

TARS:_MenuAddFilmControls(playerName)

[INTERNAL] Adds the three film-control items using the active locale labels.

TARS:_MenuAddValidation(playerName)

[INTERNAL] Adds the "TARS validation" menu item using the active locale label.

TARS:_MenuRemoveFilmControls(playerName)

[INTERNAL] Removes the three film-control items.

TARS:_MenuRemoveValidation(playerName)

[INTERNAL] Removes the "TARS validation" menu item.

TARS:_MsgCoalition(text, seconds, coa)

[INTERNAL] Sends a localized MESSAGE to an entire coalition.

TARS:_MsgUnit(text, seconds, playerName, Silent)

[INTERNAL] Sends a localized MESSAGE to a single unit by player name.

TARS:_OnEventBirth(EventData)

[INTERNAL] Handles unit birth.

TARS:_OnEventDead(EventData)

[INTERNAL] Handles unit death.

TARS:_OnEventEngineStartup(EventData)

[INTERNAL] Handles engine startup (fallback for pre-loaded slots).

TARS:_OnEventLand(EventData)

[INTERNAL] Handles landing events (Land + RunwayTouch share this handler).

TARS:_OnEventPlayerLeaveUnit(EventData)

[INTERNAL] Handles player leaving a slot.

TARS:_OnEventTakeOff(EventData)

[INTERNAL] Handles takeoff events (TakeOff + RunwayTakeOff share this handler).

TARS:_ScheduleDebrief(instance)

[INTERNAL] Schedules the landing validation and debrief for an ended session on the ground.

TARS:_Txt(id, ...)

[INTERNAL] Resolves a localized string by message ID.

TARS._vAltMax

Maximum AGL (m) for visual-recon helicopters.

TARS._vAltMin

Minimum AGL (m) for visual-recon helicopters.

TARS._vAltOpti

Optimal AGL (m) for visual-recon helicopters.

TARS._vRangeMax

Detection radius (m) at _vAltMax.

TARS._vRangeMin

Detection radius (m) at _vAltMin.

TARS._vRangeOpti

Detection radius (m) at _vAltOpti.

TARS.allowedAmmo

Map of [weaponDisplayName] = true for permitted loadout items.

TARS.debriefDelay

Seconds after confirmation before F10 marks appear.

TARS.debug

Enable debugging in TARS.

TARS.detectStatics

Master toggle for detecting DCS Static objects.

TARS.detectUnits

Master toggle for detecting DCS Unit objects.

TARS.detectedTargets

Lifetime map [unitName] = #TARS.Snapshot of all reported targets.

TARS.filmLimitEnabled

Cap the number of detections per sortie.

TARS.filmLimitMax

Maximum unique detections allowed per sortie.

TARS.getPitch(mooseUnit)

[INTERNAL] Returns the aircraft's pitch angle in degrees.

TARS.getRoll(mooseUnit)

[INTERNAL] Returns the aircraft's signed bank/roll angle in degrees.

TARS.groundMenus

Runtime map [playerName] = #TARS.MenuData of open F10 menus.

TARS.instances

Runtime map [unitName] = #TARS_SESSION of active sorties.

TARS.landingDelay

Seconds after touchdown before landing is confirmed.

TARS.landingDistance

Max distance (m) from an allied base/FARP for a valid debrief.

TARS.lid

Log-line prefix shown in Moose.log entries.

TARS.life2text(life)

Maps a 0–100 health value to a human-readable damage status label.

TARS.locale

Active locale: "en" (default), "de", "fr".

TARS.marks

{ blue = {}, red = {} } — maps [unitName] = markID. Mark IDs come from UTILS.GetMarkID().

TARS.mooseScoring

Enable MOOSE SCORING backend.

TARS.parameters

Map of [typeName] = #TARS.PlatformParams with per-platform sensor profiles.

TARS.recoNameFilter

{ enabled=#boolean, keyword=#string } — restricts TARS menus to matching group names.

TARS.reconTypes

Map of [typeName] = true for all recon-capable DCS type names.

TARS.scoring

MOOSE SCORING instance (nil if mooseScoring is false).

TARS.statics

Sub-config for static filtering (farps, captureExceptions, whitelist).

TARS.targetNameFilter

{ enabled=#boolean, keywords=#table } — per-coalition keyword lists for target filtering.

TARS.units

Sub-toggles { air, ground, ship } for unit categories.

TARS.valueScoring

Points awarded per detected target (MOOSE path).

TARS.version

Semantic version string, e.g. "v2.1.0".

Fields and Methods inherited from BASE Description

TARS.ClassID

The ID number of the object. Each object created with BASE.New() gets the next number.

TARS.ClassName

The name of the class.

TARS:ClearState(Object, StateName)

Clear a state value that was set for an object.

TARS:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

TARS:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

TARS:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

TARS:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

TARS:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

TARS:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

TARS:CreateEventGroupChangeOption(EventTime, Initiator)

Creation of a S_EVENT_GROUP_CHANGE_OPTION event.

TARS:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

TARS:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

TARS:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

TARS:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

TARS:CreateEventUnitLost(EventTime, Initiator)

Creation of a Unit Lost Event.

TARS:E(Arguments)

Log an exception which will be traced always.

TARS:EventDispatcher()

Returns the event dispatcher

TARS:EventRemoveAll()

Remove all subscribed events

TARS:F(Arguments)

Trace a function call.

TARS:F2(Arguments)

Trace a function call level 2.

TARS:F3(Arguments)

Trace a function call level 3.

TARS:GetClassID()

Get the ClassID of the class instance.

TARS:GetClassName()

Get the ClassName of the class instance.

TARS:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

TARS:GetEventPriority()

Get the object's configured event priority.

TARS:GetParent(Child, FromClass)

Get the parent object from the inheritance chain.

TARS:GetProperties()

Get all of the properties of an object in a table.

TARS:GetProperty(Key)

Get one property of an object by the key.

TARS:GetState(Object, Key)

Get a Value given a Key from the Object.

TARS:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

TARS:I(Arguments)

Log an information which will be traced always.

TARS:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

TARS:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

TARS:IsTrace()

Check whether tracing is enabled for the object.

TARS:New()

BASE constructor.

TARS:OnEvent(EventData)

Occurs when an Event for an object is triggered.

TARS:OnEventBDA(EventData)

BDA.

TARS:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

TARS:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

TARS:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

TARS:OnEventDead(EventData)

Occurs when an object is dead.

TARS:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

TARS:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

TARS:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

TARS:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

TARS:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

TARS:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

TARS:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

TARS:OnEventGroupChangeOption(EventData)

Occurs when an option is changed for an AI group.

TARS:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

TARS:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

TARS:OnEventKill(EventData)

Occurs on the death of a unit.

TARS:OnEventLand(EventData)

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.

TARS:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

TARS:OnEventLandingQualityMark(EventData)

Landing quality mark.

TARS:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

TARS:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

TARS:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

TARS:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

TARS:OnEventParatrooperLanding(EventData)

Paratrooper landing.

TARS:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

TARS:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

TARS:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

TARS:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

TARS:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

TARS:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

TARS:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

TARS:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

TARS:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

TARS:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

TARS:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

TARS:OnEventTriggerZone(EventData)

Trigger zone.

TARS:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

TARS:OnEventWeaponAdd(EventData)

Weapon add.

TARS.Properties

Properties stored with BASE.SetProperty().

TARS:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a function call once after a delay.

TARS:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a repeated function call.

TARS:ScheduleStop(SchedulerID)

Stops the Schedule.

TARS.Scheduler

The scheduler object used by BASE.ScheduleOnce() and BASE.ScheduleRepeat(). Created on first use.

TARS:SetEventPriority(EventPriority)

Set the object's event priority for subsequent subscriptions.

TARS:SetProperty(Key, Value)

Set one property of an object.

TARS:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

TARS.States

States stored with BASE.SetState(), indexed by the class name and ID of the given object.

TARS:T(Arguments)

Trace a function logic level 1.

TARS:T2(Arguments)

Trace a function logic level 2.

TARS:T3(Arguments)

Trace a function logic level 3.

TARS:TraceAll(TraceAll)

Trace all methods in MOOSE

TARS:TraceClass(Class)

Set tracing for all methods of a class.

TARS:TraceClassMethod(Class, Method)

Set tracing for a specific method of a class.

TARS:TraceLevel(Level)

Set the highest trace level.

TARS:TraceOff()

Set trace off.

TARS:TraceOn()

Set trace on.

TARS:TraceOnOff(TraceOnOff)

Switch F and T tracing on or off.

TARS:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

TARS._

TARS:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

TARS:_Serialize(Arguments)

(Internal) Serialize arguments

TARS:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

TARS.__

TARS:onEvent(event)

The main event handling function...

Fields and Methods inherited from TARS.MenuData Description

TARS.MenuData.approved

true after successful ground validation.

TARS.MenuData.groupID

Numeric group ID.

TARS.MenuData.itemInfo

"TARS capture config" — always present.

TARS.MenuData.itemStart

"Start filming" — added on takeoff.

TARS.MenuData.itemStb

"STB & Resume" — added on takeoff.

TARS.MenuData.itemStop

"Stop filming" — added on takeoff.

TARS.MenuData.itemValidate

"TARS validation" — present in GROUND_NEW; removed after validation.

TARS.MenuData.menuHandle

Root sub-menu. Call :Remove() to destroy.

TARS.MenuData.playerName

Player display name.

TARS.MenuData.unitName

DCS unit name.

Fields and Methods inherited from TARS.PlatformParams Description

TARS.PlatformParams.duration

Expositions (shots) available per sortie.

TARS.PlatformParams.fov

Camera full opening angle (degrees). Not used for visual-recon helis.

TARS.PlatformParams.maxAlt

Maximum AGL altitude (m) for valid detections.

TARS.PlatformParams.maxPitch

Maximum pitch angle (degrees) — camera must be level.

TARS.PlatformParams.maxRange

Detection radius (m) at maxAlt.

TARS.PlatformParams.maxRoll

Maximum bank angle (degrees) — camera must be level.

TARS.PlatformParams.minAlt

Minimum AGL altitude (m) for valid detections.

TARS.PlatformParams.minRange

Detection radius (m) at minAlt — visual-recon helis only.

TARS.PlatformParams.min_interval

Optional minimum seconds between two capture ticks (default 2).

TARS.PlatformParams.name

Human-readable label in player messages.

TARS.PlatformParams.offset

Cameras: depression angle below the horizon (radians), footprint centre AGL / tan(offset) ahead. Visual-recon helis: look-ahead angle from the vertical (radians), circle centre AGL * tan(offset) ahead.

TARS.PlatformParams.optimalAlt

Optimal AGL (m) — triggers the dual-cone model.

TARS.PlatformParams.optimalRange

Detection radius (m) at optimalAlt.

TARS.PlatformParams.overlap

Optional frame overlap 0–1 (default 0.5). Used by _CalcInterval.

Fields and Methods inherited from TARS.Snapshot Description

TARS.Snapshot.ammo

Ammo table at detection (units only).

TARS.Snapshot.category

Object.Category.* of the detected object.

TARS.Snapshot.coa

Coalition side (units only).

TARS.Snapshot.dcsObj

Raw DCS object reference.

TARS.Snapshot.groupCat

Group category (units only).

TARS.Snapshot.groupID

Group ID (units only).

TARS.Snapshot.life

Health 0-100 at detection (units only).

TARS.Snapshot.name

DCS unit name (registry key).

TARS.Snapshot.playername

Player name who captured the data.

TARS.Snapshot.point

World position at detection time.

TARS.Snapshot.time

Mission time of the snapshot.

TARS.Snapshot.type

DCS type name.

TARS.Snapshot.unit

MOOSE UNIT wrapper or STATIC wrapper.

Fields and Methods inherited from TARS_SESSION Description

TARS_SESSION:AddToTargetList(list)

[INTERNAL] Merges a FindTargets result into this session's target list.

TARS_SESSION.Callback

The TARS Callback object for menu functions etc.

TARS_SESSION:CaptureData()

[INTERNAL] Starts the dynamic-interval capture loop.

TARS_SESSION:CaptureLoop()

[INTERNAL] Main capture tick.

TARS_SESSION:Delete()

[INTERNAL] Stops any running capture loop and removes this session from the registry.

TARS_SESSION:FindTargets()

[INTERNAL] Searches for targets in the sensor footprint ahead of the aircraft.

TARS_SESSION:New(unit, Callback, NoMenu)

[INTERNAL] Creates a new TARS_SESSION for the given MOOSE UNIT.

TARS_SESSION.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

TARS_SESSION:ReturnReconTargets()

[INTERNAL] Publishes all captured targets as F10 coalition marks.

TARS_SESSION:SetObjectParams(unit, NoMenu)

[INTERNAL] Fully initialises (or resets) all sortie state.

TARS_SESSION:SetObjectParamsLight(unit)

[INTERNAL] Refreshes aircraft references WITHOUT resetting sortie state.

TARS_SESSION:_CalcFootprint(params, alt)

[INTERNAL] Calculates the sensor footprint at a given AGL.

TARS_SESSION:_CalcInterval(unit, params)

[INTERNAL] Calculates the capture interval in seconds based on current speed and altitude.

TARS_SESSION:_CalcVisualRange(params, altitude)

[INTERNAL] Two-segment linear interpolation for visual-recon helicopter range.

TARS_SESSION:_FreezeUnit(_Object)

[INTERNAL] Freezes a MOOSE object into a TARS.Snapshot.

TARS_SESSION:_NormalizeLife(unit)

[INTERNAL] Returns a unit's current health as a 0–100 percentage.

TARS_SESSION:_OffsetCalc(unit, params, center_shift)

[INTERNAL] Calculates the 2-D ground point ahead of the aircraft.

TARS_SESSION:_ScheduleLoop(delay)

[INTERNAL] Schedules the next capture tick for the current loop generation.

TARS_SESSION:_SetSharedParams(unit)

[INTERNAL] Populates all shared fields from a MOOSE UNIT object.

TARS_SESSION:_ValidateObjectFound(_Object)

[INTERNAL] Validates a single DCS/MOOSE object against all active filters.

TARS_SESSION.ammo

Ammo table snapshot from unit:GetAmmo().

TARS_SESSION.captureCount

Total unique targets captured this sortie.

TARS_SESSION.capturing

true while the capture loop is actively running.

TARS_SESSION.category

Group category at session creation.

TARS_SESSION.coa

Coalition side (1 = Red, 2 = Blue).

TARS_SESSION.coordinate

TARS_SESSION.debriefID

Generation counter of the scheduled debrief. Stale debrief timers are ignored.

TARS_SESSION.debug

Enable debugging in TARS_SESSION.

TARS_SESSION.debugunitsearch

Enable Target Search Debug.

TARS_SESSION.duration

Remaining expositions (shots) for this sortie. One exposition is used per capture tick.

TARS_SESSION.filmExhausted

true when duration reached zero.

TARS_SESSION.group

MOOSE GROUP the aircraft belongs to.

TARS_SESSION.groupID

Numeric group ID.

TARS_SESSION.isInEllipse(ox, oz, cx, cz, a, b, heading_rad)

[INTERNAL] Checks a point is inside of an elipse

TARS_SESSION.landingScheduled

true once the debrief timer has been registered.

TARS_SESSION.lastTakeoffTime

Mission time of the last takeoff, used for debouncing.

TARS_SESSION.lid

Log-line prefix shown in Moose.log entries.

TARS_SESSION.loop

true while the TARS_SESSION:CaptureLoop timer is scheduled.

TARS_SESSION.loopID

Generation counter of the capture loop. Stale timer callbacks with an old ID are ignored.

TARS_SESSION.objectName

DCS unit name — used as the registry key.

TARS_SESSION.playerID

Numeric DCS unit ID, used as F10-menu and message key.

TARS_SESSION.playerName

Human-readable player name as shown in the scoreboard.

TARS_SESSION.searchzone

TARS_SESSION.sessionEnded

true after STOP or film exhaustion; awaiting debrief.

TARS_SESSION.standby

true when film is paused without ending the session.

TARS_SESSION.targetList

Targets detected this pass, not yet reported. [unitName] = snap.

TARS_SESSION.time

Mission time (seconds) when the session was last refreshed.

TARS_SESSION.type

DCS type name of the aircraft (key into TARS.parameters).

TARS_SESSION.unit

The MOOSE UNIT object for the recon aircraft.

TARS_SESSION.vec3

World position snapshot taken at session creation.

TARS_SESSION.wasCapturing

true if capture was active at the moment of touchdown.

Fields and Methods inherited from BASE Description

TARS_SESSION.ClassID

The ID number of the object. Each object created with BASE.New() gets the next number.

TARS_SESSION.ClassName

The name of the class.

TARS_SESSION:ClearState(Object, StateName)

Clear a state value that was set for an object.

TARS_SESSION:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

TARS_SESSION:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

TARS_SESSION:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

TARS_SESSION:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

TARS_SESSION:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

TARS_SESSION:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

TARS_SESSION:CreateEventGroupChangeOption(EventTime, Initiator)

Creation of a S_EVENT_GROUP_CHANGE_OPTION event.

TARS_SESSION:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

TARS_SESSION:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

TARS_SESSION:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

TARS_SESSION:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

TARS_SESSION:CreateEventUnitLost(EventTime, Initiator)

Creation of a Unit Lost Event.

TARS_SESSION:E(Arguments)

Log an exception which will be traced always.

TARS_SESSION:EventDispatcher()

Returns the event dispatcher

TARS_SESSION:EventRemoveAll()

Remove all subscribed events

TARS_SESSION:F(Arguments)

Trace a function call.

TARS_SESSION:F2(Arguments)

Trace a function call level 2.

TARS_SESSION:F3(Arguments)

Trace a function call level 3.

TARS_SESSION:GetClassID()

Get the ClassID of the class instance.

TARS_SESSION:GetClassName()

Get the ClassName of the class instance.

TARS_SESSION:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

TARS_SESSION:GetEventPriority()

Get the object's configured event priority.

TARS_SESSION:GetParent(Child, FromClass)

Get the parent object from the inheritance chain.

TARS_SESSION:GetProperties()

Get all of the properties of an object in a table.

TARS_SESSION:GetProperty(Key)

Get one property of an object by the key.

TARS_SESSION:GetState(Object, Key)

Get a Value given a Key from the Object.

TARS_SESSION:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

TARS_SESSION:I(Arguments)

Log an information which will be traced always.

TARS_SESSION:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

TARS_SESSION:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

TARS_SESSION:IsTrace()

Check whether tracing is enabled for the object.

TARS_SESSION:New()

BASE constructor.

TARS_SESSION:OnEvent(EventData)

Occurs when an Event for an object is triggered.

TARS_SESSION:OnEventBDA(EventData)

BDA.

TARS_SESSION:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

TARS_SESSION:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

TARS_SESSION:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

TARS_SESSION:OnEventDead(EventData)

Occurs when an object is dead.

TARS_SESSION:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

TARS_SESSION:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

TARS_SESSION:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

TARS_SESSION:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

TARS_SESSION:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

TARS_SESSION:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS_SESSION:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

TARS_SESSION:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

TARS_SESSION:OnEventGroupChangeOption(EventData)

Occurs when an option is changed for an AI group.

TARS_SESSION:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

TARS_SESSION:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

TARS_SESSION:OnEventKill(EventData)

Occurs on the death of a unit.

TARS_SESSION:OnEventLand(EventData)

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.

TARS_SESSION:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

TARS_SESSION:OnEventLandingQualityMark(EventData)

Landing quality mark.

TARS_SESSION:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

TARS_SESSION:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

TARS_SESSION:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

TARS_SESSION:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS_SESSION:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

TARS_SESSION:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

TARS_SESSION:OnEventParatrooperLanding(EventData)

Paratrooper landing.

TARS_SESSION:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

TARS_SESSION:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

TARS_SESSION:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

TARS_SESSION:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

TARS_SESSION:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

TARS_SESSION:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

TARS_SESSION:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

TARS_SESSION:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

TARS_SESSION:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

TARS_SESSION:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

TARS_SESSION:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

TARS_SESSION:OnEventTriggerZone(EventData)

Trigger zone.

TARS_SESSION:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

TARS_SESSION:OnEventWeaponAdd(EventData)

Weapon add.

TARS_SESSION.Properties

Properties stored with BASE.SetProperty().

TARS_SESSION:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a function call once after a delay.

TARS_SESSION:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a repeated function call.

TARS_SESSION:ScheduleStop(SchedulerID)

Stops the Schedule.

TARS_SESSION.Scheduler

The scheduler object used by BASE.ScheduleOnce() and BASE.ScheduleRepeat(). Created on first use.

TARS_SESSION:SetEventPriority(EventPriority)

Set the object's event priority for subsequent subscriptions.

TARS_SESSION:SetProperty(Key, Value)

Set one property of an object.

TARS_SESSION:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

TARS_SESSION.States

States stored with BASE.SetState(), indexed by the class name and ID of the given object.

TARS_SESSION:T(Arguments)

Trace a function logic level 1.

TARS_SESSION:T2(Arguments)

Trace a function logic level 2.

TARS_SESSION:T3(Arguments)

Trace a function logic level 3.

TARS_SESSION:TraceAll(TraceAll)

Trace all methods in MOOSE

TARS_SESSION:TraceClass(Class)

Set tracing for all methods of a class.

TARS_SESSION:TraceClassMethod(Class, Method)

Set tracing for a specific method of a class.

TARS_SESSION:TraceLevel(Level)

Set the highest trace level.

TARS_SESSION:TraceOff()

Set trace off.

TARS_SESSION:TraceOn()

Set trace on.

TARS_SESSION:TraceOnOff(TraceOnOff)

Switch F and T tracing on or off.

TARS_SESSION:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

TARS_SESSION._

TARS_SESSION:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

TARS_SESSION:_Serialize(Arguments)

(Internal) Serialize arguments

TARS_SESSION:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

TARS_SESSION.__

TARS_SESSION:onEvent(event)

The main event handling function...

Field(s)

#table #.parameters

Function(s)

Field(s)

#table TARS.Messages

Nested localization table: TARS.Messages[locale][messageID] = string.

#boolean TARS.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

#boolean TARS.SRS
#number TARS._vAltMax

Maximum AGL (m) for visual-recon helicopters.

#number TARS._vAltMin

Minimum AGL (m) for visual-recon helicopters.

#number TARS._vAltOpti

Optimal AGL (m) for visual-recon helicopters.

#number TARS._vRangeMax

Detection radius (m) at _vAltMax.

#number TARS._vRangeMin

Detection radius (m) at _vAltMin.

#number TARS._vRangeOpti

Detection radius (m) at _vAltOpti.

#table TARS.allowedAmmo

Map of [weaponDisplayName] = true for permitted loadout items.

#number TARS.debriefDelay

Seconds after confirmation before F10 marks appear.

#boolean TARS.debug

Enable debugging in TARS.

#boolean TARS.detectStatics

Master toggle for detecting DCS Static objects.

#boolean TARS.detectUnits

Master toggle for detecting DCS Unit objects.

#table TARS.detectedTargets

Lifetime map [unitName] = #TARS.Snapshot of all reported targets.

#boolean TARS.filmLimitEnabled

Cap the number of detections per sortie.

#number TARS.filmLimitMax

Maximum unique detections allowed per sortie.

#table TARS.groundMenus

Runtime map [playerName] = #TARS.MenuData of open F10 menus.

#table TARS.instances

Runtime map [unitName] = #TARS_SESSION of active sorties.

#number TARS.landingDelay

Seconds after touchdown before landing is confirmed.

#number TARS.landingDistance

Max distance (m) from an allied base/FARP for a valid debrief.

#string TARS.lid

Log-line prefix shown in Moose.log entries.

#string TARS.locale

Active locale: "en" (default), "de", "fr".

#table TARS.marks

{ blue = {}, red = {} } — maps [unitName] = markID. Mark IDs come from UTILS.GetMarkID().

#boolean TARS.mooseScoring

Enable MOOSE SCORING backend.

#table TARS.parameters

Map of [typeName] = #TARS.PlatformParams with per-platform sensor profiles.

#table TARS.recoNameFilter

{ enabled=#boolean, keyword=#string } — restricts TARS menus to matching group names.

#table TARS.reconTypes

Map of [typeName] = true for all recon-capable DCS type names.

Functional.Scoring#SCORING TARS.scoring

MOOSE SCORING instance (nil if mooseScoring is false).

#table TARS.statics

Sub-config for static filtering (farps, captureExceptions, whitelist).

#table TARS.targetNameFilter

{ enabled=#boolean, keywords=#table } — per-coalition keyword lists for target filtering.

#table TARS.units

Sub-toggles { air, ground, ship } for unit categories.

#number TARS.valueScoring

Points awarded per detected target (MOOSE path).

#string TARS.version

Semantic version string, e.g. "v2.1.0".

Function(s)

[INTERNAL] Creates the Task TARS F10 sub-menu and its initial items.

Initial state (GROUND_NEW): "TARS validation" + "TARS capture config".

Defined in:

TARS

Parameters:

#string playerName

[INTERNAL] Validates the aircraft loadout.

Defined in:

TARS

Parameter:

Return values:

#boolean:

reconOk

#string:

refusedWeapon or nil

[INTERNAL] Validates loadout on the ground and sets the approved flag.

Defined in:

TARS

Parameter:

[INTERNAL] Arms the capture session.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Creates and registers a new TARS_SESSION.

Called on takeoff, so no validation menu item is added.

Defined in:

TARS

Parameter:

Return value:

[INTERNAL] Returns the active TARS_SESSION for a unit name, or nil.

Defined in:

TARS

Parameter:

#string unitName

Return value:

or nil

[INTERNAL] Returns true if the unit is within landingDistance of any allied base/FARP.

Defined in:

TARS

Parameter:

Return value:

#boolean:

Creates the TARS singleton and wires up all event handlers.

Note: the returned instance is a copy of the TARS class table. Set TARS.* options before this call, or set them on the returned instance afterwards.

Defined in:

TARS

Parameters:

#string locale

(optional) Set locale for text output, defaults to "en". "fr" and "de" available out-of-the-box.

(optional) An existing MOOSE SCORING object to use. If not given and mooseScoring is true, a new SCORING object is created.

Return value:

self

Moose FSM Style callback function for mission designers.

Optionally overwrite with own function. Processed after landing on debriefing analysis.

Defined in:

TARS

Parameter:

#TARS.Snapshot TargetSnap

Table of data of a single found object in the last session.

Return value:

self

Moose FSM Style callback function for mission designers.

Optionally overwrite with own function. Processed after landing on debriefing analysis. Use for pre-processing.

Defined in:

TARS

Parameter:

#TARS.Snapshot TargetSnap

Table of data of a single found object in the last session.

Return value:

#boolean:

returnvalue If false, then TARS:OnAfterDataProcessing will NOT be called.

[INTERNAL] Places a coalition F10 map marker for a detected target snapshot.

Defined in:

TARS

Parameters:

#number coa

Coalition side.

Return value:

#number:

counter Mark ID used (from UTILS.GetMarkID(), so no clashes with other scripts).

[INTERNAL] Debrief: publishes marks and awards points after a valid landing.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Removes the TARS F10 menu for a player.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Removes F10 marks for units and statics that no longer exist.

Runs every 120 seconds.

Defined in:

TARS

Parameters:

#boolean _

#number time

Return value:

#number:

time + 120

Configure SRS radio output.

Defined in:

TARS

Parameters:

#string Path

  (Optional) Path to SRS (or nil to use MSRS default)

#number Frequency

MHz, e.g. 251

#number Modulation

radio.modulation.AM or FM (default AM)

#string Culture

(Optional) BCP-47 culture string, e.g. "ru-RU"

#string Gender

(Optional) "male" or "female". Usually not used when using a specific voice.

#string Voice

 MSRS voice constant; do not forget to adjust voice to your locale!

#number Coalition

MSRS Coalition, e.g. coalition.side.BLUE.

#number Port

  (Optional) SRS port (default 5002)

#number Speed

 (Optional) Speech speed (or nil to use MSRS default)

#string Provider

(Optional) Provider, e.g. MSRS.Provider.GOOGLE (or nil to use MSRS default)

#string Backend

(Optional) Backend, e.g. MSRS.Backend.HOUND (or nil to use MSRS default)

#number Speaker

(Optional, HOUND/PIPER only!) Speaker number, e.g. 11 for Speaker "318 (11)"

Return value:

self

Set SRS Voice Speaker for Hound/Piper.

Call after TARS:SetSRS().

Defined in:

TARS

Parameter:

#number Speaker

Speaker number, e.g. 11 for Speaker "318 (11)"

Return value:

self

[INTERNAL] Sends platform capabilities as a HUD message.

All labels are resolved through the active locale.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Toggles film standby on/off.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Ends the capture session; marks it as awaiting debrief.

If the aircraft is already on the ground (e.g. film auto-STB after landing), the debrief is scheduled right away.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Awards credits via DCSBot (if loaded).

Defined in:

TARS

Parameters:

#string name

Player display name.

#number points

Credits to award.

Return value:

#boolean:

true if credited.

[INTERNAL] F10 callback: show platform info.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] F10 callback: start capture.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] F10 callback: toggle STB.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] F10 callback: stop capture.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] F10 callback: ground validation.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Resolves the MOOSE UNIT for a player from the groundMenus registry.

Defined in:

TARS

Parameter:

#string playerName

Return value:

unit or nil.

[INTERNAL] Checks a group name against recoNameFilter (plain text, case-insensitive).

Defined in:

TARS

Parameter:

#string name

Group name.

Return value:

#boolean:

true if the filter is disabled or the keyword is contained in the name.

[INTERNAL] Adds the three film-control items using the active locale labels.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Adds the "TARS validation" menu item using the active locale label.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Removes the three film-control items.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Removes the "TARS validation" menu item.

Defined in:

TARS

Parameter:

#string playerName

[INTERNAL] Sends a localized MESSAGE to an entire coalition.

Defined in:

TARS

Parameters:

#string text

Resolved message text.

#number seconds

Display duration in seconds.

#number coa

Coalition side (1 = Red, 2 = Blue).

[INTERNAL] Sends a localized MESSAGE to a single unit by player name.

Defined in:

TARS

Parameters:

#string text

Resolved message text.

#number seconds

Display duration in seconds.

#string playerName

Player display name.

#boolean Silent

Do not send via SRS if this is true.

[INTERNAL] Handles unit birth.

Defined in:

TARS

Parameter:

[INTERNAL] Handles unit death.

Defined in:

TARS

Parameter:

[INTERNAL] Handles engine startup (fallback for pre-loaded slots).

Defined in:

TARS

Parameter:

[INTERNAL] Handles landing events (Land + RunwayTouch share this handler).

Branch 1: capture active → auto standby. Branch 2: session ended → schedule debrief, remove film menus.

Defined in:

TARS

Parameter:

[INTERNAL] Handles player leaving a slot.

Defined in:

TARS

Parameter:

[INTERNAL] Handles takeoff events (TakeOff + RunwayTakeOff share this handler).

Branch 1: capture active → validate config, auto-resume film. Branch 2: film inactive → check approval, create session, add film menus.

Defined in:

TARS

Parameter:

[INTERNAL] Schedules the landing validation and debrief for an ended session on the ground.

Called on landing and when the film is stopped while already on the ground. A debrief generation ID makes sure that only the latest scheduled debrief is processed.

Defined in:

TARS

Parameter:

#TARS_SESSION instance

[INTERNAL] Resolves a localized string by message ID.

Lookup order: TARS.Messages[locale][id] → TARS.Messages["en"][id] → raw id. Passes extra arguments through string.format when provided.

Defined in:

TARS

Parameters:

#string id

Message ID (key in TARS.Messages[locale]).

...

Optional string.format arguments.

Return value:

#string:

Resolved, formatted string.

[INTERNAL] Returns the aircraft's pitch angle in degrees.

Defined in:

TARS

Parameter:

Wrapper.Unit#UNIT mooseUnit

The recon aircraft.

Return value:

#number:

Pitch angle in degrees.

[INTERNAL] Returns the aircraft's signed bank/roll angle in degrees.

Defined in:

TARS

Parameter:

Wrapper.Unit#UNIT mooseUnit

The recon aircraft.

Return value:

#number:

Roll angle in degrees.

Maps a 0–100 health value to a human-readable damage status label.

Defined in:

TARS

Parameter:

#number life

Health percentage (0–100), or nil.

Return value:

#string:

Damage label.

Field(s)

#table TARS.Messages

Nested localization table: TARS.Messages[locale][messageID] = string.

#boolean TARS.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

#boolean TARS.SRS
#number TARS._vAltMax

Maximum AGL (m) for visual-recon helicopters.

#number TARS._vAltMin

Minimum AGL (m) for visual-recon helicopters.

#number TARS._vAltOpti

Optimal AGL (m) for visual-recon helicopters.

#number TARS._vRangeMax

Detection radius (m) at _vAltMax.

#number TARS._vRangeMin

Detection radius (m) at _vAltMin.

#number TARS._vRangeOpti

Detection radius (m) at _vAltOpti.

#table TARS.allowedAmmo

Map of [weaponDisplayName] = true for permitted loadout items.

#number TARS.debriefDelay

Seconds after confirmation before F10 marks appear.

#boolean TARS.debug

Enable debugging in TARS.

#boolean TARS.detectStatics

Master toggle for detecting DCS Static objects.

#boolean TARS.detectUnits

Master toggle for detecting DCS Unit objects.

#table TARS.detectedTargets

Lifetime map [unitName] = #TARS.Snapshot of all reported targets.

#boolean TARS.filmLimitEnabled

Cap the number of detections per sortie.

#number TARS.filmLimitMax

Maximum unique detections allowed per sortie.

#table TARS.groundMenus

Runtime map [playerName] = #TARS.MenuData of open F10 menus.

#table TARS.instances

Runtime map [unitName] = #TARS_SESSION of active sorties.

#number TARS.landingDelay

Seconds after touchdown before landing is confirmed.

#number TARS.landingDistance

Max distance (m) from an allied base/FARP for a valid debrief.

#string TARS.lid

Log-line prefix shown in Moose.log entries.

#string TARS.locale

Active locale: "en" (default), "de", "fr".

#table TARS.marks

{ blue = {}, red = {} } — maps [unitName] = markID. Mark IDs come from UTILS.GetMarkID().

#boolean TARS.mooseScoring

Enable MOOSE SCORING backend.

#table TARS.parameters

Map of [typeName] = #TARS.PlatformParams with per-platform sensor profiles.

#table TARS.recoNameFilter

{ enabled=#boolean, keyword=#string } — restricts TARS menus to matching group names.

#table TARS.reconTypes

Map of [typeName] = true for all recon-capable DCS type names.

Functional.Scoring#SCORING TARS.scoring

MOOSE SCORING instance (nil if mooseScoring is false).

#table TARS.statics

Sub-config for static filtering (farps, captureExceptions, whitelist).

#table TARS.targetNameFilter

{ enabled=#boolean, keywords=#table } — per-coalition keyword lists for target filtering.

#table TARS.units

Sub-toggles { air, ground, ship } for unit categories.

#number TARS.valueScoring

Points awarded per detected target (MOOSE path).

#string TARS.version

Semantic version string, e.g. "v2.1.0".

Function(s)

Clear a state value that was set for an object.

Defined in:

Parameters:

Object

The object the state is about.

StateName

The key that 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.

DCS#Airbase place

(Optional) The airbase, FARP or ship where the object was born.

#number subplace

(Optional) The 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.

#number IniObjectCategory

(Optional) The object category of the initiator.

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.

#number IniObjectCategory

(Optional) The object category of the initiator.

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_GROUP_CHANGE_OPTION event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Group Initiator

The initiating group of the event.

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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 Unit Lost 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.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#number:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the object's configured event priority.

Defined in:

Return value:

#number:

The configured priority. Defaults to 5.

Get the parent object from the inheritance chain.

To run a parent method on the current instance, call the function with self as its first argument.

local Parent = self:GetParent( self, MYCLASS )
Parent.ParentMethod( self )

Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) Walk up the chain of Child to this class first and return its parent. Use this to call a parent method from a method of an intermediate class.

Return value:

The parent, or nil if there is none.

Get all of the properties of an object in a table.

Defined in:

Return value:

#table:

of values, indexed by keys.

Get one property of an object by the key.

Defined in:

Parameter:

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!

Return value:

Value The value that is stored. Note that the value can be a #string, but it can also be any other type! Nil if not found.

Get a Value given a Key from the Object.

The values are stored in the calling object, keyed by the class name and ID of the given Object. They are not removed when the given Object is destroyed or garbage collected. Use BASE.ClearState() to remove a value.

Defined in:

Parameters:

Object

The object the state is about.

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 no value is stored for the Key.

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

(Optional) The function to be called as EventFunction( self, EventData ) when the event occurs. If not given, the method named after the event is called, e.g. self:OnEventDead( EventData ).

Return value:

self

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

The Child class table is deep copied. The copy looks up missing fields and methods in Parent through its metatable. Parent is usually a new object of the parent class, e.g. BASE:Inherit( self, BASE:New() ).

Defined in:

Parameters:

#table Child

The Child class that inherits.

#BASE Parent

The Parent object that the Child inherits from.

Return value:

The new Child object.

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

The name of the class (#string, case insensitive) or the class itself to run the check against.

Return value:

#boolean:

True if the object is an instance of the class or of a class derived from it. False for an invalid parameter.

Check whether tracing is enabled for the object.

Defined in:

Return value:

#boolean:

true when the Lua debug library is available, tracing is on, and TraceAll, TraceClass, or TraceClassMethod selects the object.

BASE constructor.

Creates a new object as a deep copy of the table the method is called on and assigns the next ClassID. When the BASE class itself is copied, its class-level fields Debug (the Lua debug library) and Scheduler are left out. When the method is called on a derived class or instance, its own Debug and Scheduler fields are copied along with its other fields.

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

Defined in:

Return value:

The new object.

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.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when an option is changed for an AI group.

The event identifies the initiating group, but does not provide the option ID or value.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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 succumbs to Davy 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.

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Paratrooper landing.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not multiplayer 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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite weapon reload not counted). Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Schedule a function call once after a delay.

The schedule starts immediately. The function is called without the object as first argument. Pass the object explicitly if needed, e.g. self:ScheduleOnce( 5, MYCLASS.Stop, self ).

Defined in:

Parameters:

#number Start

Delay in seconds before the function is called.

#function SchedulerFunction

The function to be called. It receives the optional arguments given after it.

...

(Optional) Arguments passed to the function.

Return value:

#string:

The Schedule ID of the planned schedule.

Schedule a repeated function call.

The schedule starts immediately. The function is called without the object as first argument. Pass the object explicitly if needed.

Defined in:

Parameters:

#number Start

Delay in seconds before the first call.

#number Repeat

Interval in seconds between the calls.

#number RandomizeFactor

Randomization factor between 0 and 1 to randomize the Repeat interval.

#number Stop

(Optional) Time limit in seconds from when the schedule starts. Omit it or use 0 for no time limit. The dispatcher checks the limit after each call, so a call that was already scheduled can run after the limit expires.

#function SchedulerFunction

The function to be called. It receives the optional arguments given after it.

...

(Optional) Arguments passed to the function.

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 object's event priority for subsequent subscriptions.

The Core.Event dispatcher processes priorities 1 through 10 (10 through 1 for events like Dead). Each subscription is stored under the priority in effect when it is registered.

Defined in:

Parameter:

#number EventPriority

Priority used when registering events.

Return value:

self

Set one property of an object.

Defined in:

Parameters:

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 that is stored. Note that the value can be a #string, but it can also be any other type!

Set a state or property of the Object given a Key and a Value.

The values are stored in the calling object, keyed by the class name and ID of the given Object. They are not removed when the given Object is destroyed or garbage collected. Use BASE.ClearState() to remove a value.

Defined in:

Parameters:

Object

The object the state is about. Its class name and ID are used as index.

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 be stored.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

(Optional) true or nil = trace all methods in MOOSE, false = switch it off.

Set tracing for all methods of a class.

Tracing must also be switched on with BASE.TraceOn().

Defined in:

Parameter:

#string Class

Class name.

Set tracing for a specific method of a class.

Tracing must also be switched on with BASE.TraceOn().

Defined in:

Parameters:

#string Class

Class name.

#string Method

Method.

Set the highest trace level.

F and T methods up to this level write to the log.

Defined in:

Parameter:

#number Level

(Optional) Trace level 1, 2, or 3. Defaults to 1.

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Switch F and T tracing on or off.

Tracing starts disabled in BASE. BASE.E() and BASE.I() log independently of this switch.

Defined in:

Parameter:

#boolean TraceOnOff

(Optional) Use false to disable tracing. Defaults to true.

Usage:


  -- Switch the tracing On
  BASE:TraceOnOff( true )

  -- Switch the tracing Off
  BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

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.

Defined in:

Parameter:

DCS#Event event

F10 menu registration data.

Stored in self.groundMenus[playerName].

Field(s)

#boolean TARS.MenuData.approved

true after successful ground validation.

#number TARS.MenuData.groupID

Numeric group ID.

Core.Menu#MENU_GROUP_COMMAND TARS.MenuData.itemInfo

"TARS capture config" — always present.

Core.Menu#MENU_GROUP_COMMAND TARS.MenuData.itemStart

"Start filming" — added on takeoff.

Core.Menu#MENU_GROUP_COMMAND TARS.MenuData.itemStb

"STB & Resume" — added on takeoff.

Core.Menu#MENU_GROUP_COMMAND TARS.MenuData.itemStop

"Stop filming" — added on takeoff.

Core.Menu#MENU_GROUP_COMMAND TARS.MenuData.itemValidate

"TARS validation" — present in GROUND_NEW; removed after validation.

Core.Menu#MENU_GROUP TARS.MenuData.menuHandle

Root sub-menu. Call :Remove() to destroy.

#string TARS.MenuData.playerName

Player display name.

#string TARS.MenuData.unitName

DCS unit name.

Function(s)

Platform sensor/camera profile.

Stored in TARS.parameters[typeName].

Field(s)

#number TARS.PlatformParams.duration

Expositions (shots) available per sortie.

#number TARS.PlatformParams.fov

Camera full opening angle (degrees). Not used for visual-recon helis.

#number TARS.PlatformParams.maxAlt

Maximum AGL altitude (m) for valid detections.

#number TARS.PlatformParams.maxPitch

Maximum pitch angle (degrees) — camera must be level.

#number TARS.PlatformParams.maxRange

Detection radius (m) at maxAlt.

#number TARS.PlatformParams.maxRoll

Maximum bank angle (degrees) — camera must be level.

#number TARS.PlatformParams.minAlt

Minimum AGL altitude (m) for valid detections.

#number TARS.PlatformParams.minRange

Detection radius (m) at minAlt — visual-recon helis only.

#number TARS.PlatformParams.min_interval

Optional minimum seconds between two capture ticks (default 2).

#string TARS.PlatformParams.name

Human-readable label in player messages.

#number TARS.PlatformParams.offset

Cameras: depression angle below the horizon (radians), footprint centre AGL / tan(offset) ahead. Visual-recon helis: look-ahead angle from the vertical (radians), circle centre AGL * tan(offset) ahead.

#number TARS.PlatformParams.optimalAlt

Optimal AGL (m) — triggers the dual-cone model.

#number TARS.PlatformParams.optimalRange

Detection radius (m) at optimalAlt.

#number TARS.PlatformParams.overlap

Optional frame overlap 0–1 (default 0.5). Used by _CalcInterval.

Function(s)

Frozen target snapshot.

Field(s)

#table TARS.Snapshot.ammo

Ammo table at detection (units only).

#number TARS.Snapshot.category

Object.Category.* of the detected object.

#number TARS.Snapshot.coa

Coalition side (units only).

DCS#Object TARS.Snapshot.dcsObj

Raw DCS object reference.

#number TARS.Snapshot.groupCat

Group category (units only).

#number TARS.Snapshot.groupID

Group ID (units only).

#number TARS.Snapshot.life

Health 0-100 at detection (units only).

#string TARS.Snapshot.name

DCS unit name (registry key).

#string TARS.Snapshot.playername

Player name who captured the data.

DCS#Vec3 TARS.Snapshot.point

World position at detection time.

#number TARS.Snapshot.time

Mission time of the snapshot.

#string TARS.Snapshot.type

DCS type name.

Wrapper.Unit#UNIT TARS.Snapshot.unit

MOOSE UNIT wrapper or STATIC wrapper.

Function(s)

Field(s)

#TARS TARS_SESSION.Callback

The TARS Callback object for menu functions etc.

#boolean TARS_SESSION.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

#table TARS_SESSION.ammo

Ammo table snapshot from unit:GetAmmo().

#number TARS_SESSION.captureCount

Total unique targets captured this sortie.

#boolean TARS_SESSION.capturing

true while the capture loop is actively running.

#number TARS_SESSION.category

Group category at session creation.

#number TARS_SESSION.coa

Coalition side (1 = Red, 2 = Blue).

#number TARS_SESSION.debriefID

Generation counter of the scheduled debrief. Stale debrief timers are ignored.

#boolean TARS_SESSION.debug

Enable debugging in TARS_SESSION.

#boolean TARS_SESSION.debugunitsearch

Enable Target Search Debug.

#number TARS_SESSION.duration

Remaining expositions (shots) for this sortie. One exposition is used per capture tick.

#boolean TARS_SESSION.filmExhausted

true when duration reached zero.

Wrapper.Group#GROUP TARS_SESSION.group

MOOSE GROUP the aircraft belongs to.

#number TARS_SESSION.groupID

Numeric group ID.

#boolean TARS_SESSION.landingScheduled

true once the debrief timer has been registered.

#number TARS_SESSION.lastTakeoffTime

Mission time of the last takeoff, used for debouncing.

#string TARS_SESSION.lid

Log-line prefix shown in Moose.log entries.

#boolean TARS_SESSION.loop

true while the TARS_SESSION:CaptureLoop timer is scheduled.

#number TARS_SESSION.loopID

Generation counter of the capture loop. Stale timer callbacks with an old ID are ignored.

#string TARS_SESSION.objectName

DCS unit name — used as the registry key.

#number TARS_SESSION.playerID

Numeric DCS unit ID, used as F10-menu and message key.

#string TARS_SESSION.playerName

Human-readable player name as shown in the scoreboard.

#boolean TARS_SESSION.sessionEnded

true after STOP or film exhaustion; awaiting debrief.

#boolean TARS_SESSION.standby

true when film is paused without ending the session.

#table TARS_SESSION.targetList

Targets detected this pass, not yet reported. [unitName] = snap.

#number TARS_SESSION.time

Mission time (seconds) when the session was last refreshed.

#string TARS_SESSION.type

DCS type name of the aircraft (key into TARS.parameters).

Wrapper.Unit#UNIT TARS_SESSION.unit

The MOOSE UNIT object for the recon aircraft.

DCS#Vec3 TARS_SESSION.vec3

World position snapshot taken at session creation.

#boolean TARS_SESSION.wasCapturing

true if capture was active at the moment of touchdown.

Function(s)

[INTERNAL] Merges a FindTargets result into this session's target list.

Notifies the player per new detection using the active locale. Stops adding once the film limit (filmLimitMax) is reached.

Defined in:

TARS_SESSION

Parameter:

#table list

Map of [unitName] = Wrapper.Unit#UNIT from TARS_SESSION:FindTargets().

[INTERNAL] Starts the dynamic-interval capture loop.

The first tick fires after 2 seconds; subsequent ticks are spaced by _CalcInterval() which adapts to the aircraft's current speed and altitude.

Defined in:

TARS_SESSION

[INTERNAL] Main capture tick.

Scheduled dynamically via timer.scheduleFunction. The interval between ticks is calculated from the aircraft's current speed and camera footprint via _CalcInterval(), ensuring adequate frame overlap regardless of whether the platform is a slow helicopter or a fast jet. duration is decremented by one exposition each tick. Scheduled via _ScheduleLoop(); stale ticks of an older loop generation never get here.

Defined in:

TARS_SESSION

Return value:

nil

[INTERNAL] Stops any running capture loop and removes this session from the registry.

Defined in:

TARS_SESSION

[INTERNAL] Searches for targets in the sensor footprint ahead of the aircraft.

Cameras use an elliptical footprint, visual-recon helicopters a circle (see _CalcFootprint). Nothing is scanned while the aircraft is outside its altitude/attitude envelope.

Defined in:

TARS_SESSION

Return value:

#table:

[unitName] = Wrapper.Unit#UNIT

[INTERNAL] Creates a new TARS_SESSION for the given MOOSE UNIT.

Defined in:

TARS_SESSION

Parameters:

The recon aircraft's MOOSE UNIT.

#TARS Callback

The TARS singleton (for callbacks and config access).

#boolean NoMenu

(Optional) If true, do not (re-)add the validation menu item.

Return value:

self The newly created session.

[INTERNAL] Publishes all captured targets as F10 coalition marks.

Defined in:

TARS_SESSION

Return value:

#number:

count Number of marks placed or updated this debrief.

[INTERNAL] Fully initialises (or resets) all sortie state.

After a debrief reset, re-adds the validation menu item (GROUND_NEW state).

Defined in:

TARS_SESSION

Parameters:

The recon aircraft's MOOSE UNIT.

#boolean NoMenu

(Optional) If true, do not re-add the validation menu item (e.g. when airborne).

Return value:

[INTERNAL] Refreshes aircraft references WITHOUT resetting sortie state.

Defined in:

TARS_SESSION

Parameter:

The recon aircraft's MOOSE UNIT.

[INTERNAL] Calculates the sensor footprint at a given AGL.

Cameras (fov set): ellipse of a forward-down looking camera (depression offset, full opening angle fov); falls back to a circle if offset - fov/2 is less than 2°, i.e. the far edge would reach the horizon. Visual-recon helicopters (optimalAlt set): circle with radius from _CalcVisualRange(). For these, offset is the look-ahead angle from the vertical (as in the pre-ellipse model), so the circle centre is AGL * tan(offset) ahead, i.e. close to the helicopter (6° → ~0.1 × AGL), not AGL / tan(offset) (~9.5 × AGL).

Defined in:

TARS_SESSION

Parameters:

Platform parameter table.

#number alt

AGL in metres.

Return values:

#number:

a Along-track semi-axis (m).

#number:

b Cross-track semi-axis (m).

#number:

center_shift Shift (m) of the footprint centre relative to the point AGL / tan(offset) ahead.

[INTERNAL] Calculates the capture interval in seconds based on current speed and altitude.

Uses the footprint length along the flight path and the configured overlap to determine how long the aircraft needs to travel before the next frame is needed. Clamped between min_interval (default 2) and 120 seconds to prevent extreme values.

Defined in:

TARS_SESSION

Parameters:

The recon aircraft.

Platform parameter table.

Return value:

#number:

interval Capture interval in seconds.

[INTERNAL] Two-segment linear interpolation for visual-recon helicopter range.

Defined in:

TARS_SESSION

Parameters:

#number altitude

AGL in metres.

Return value:

#number:

radius Detection sphere radius in metres.

[INTERNAL] Freezes a MOOSE object into a TARS.Snapshot.

Defined in:

TARS_SESSION

Parameter:

MOOSE UNIT or STATIC.

Return value:

[INTERNAL] Returns a unit's current health as a 0–100 percentage.

Defined in:

TARS_SESSION

Parameter:

Return value:

#number:

Health 0–100, or nil.

[INTERNAL] Calculates the 2-D ground point ahead of the aircraft.

Defined in:

TARS_SESSION

Parameters:

#number center_shift

shift value

Return value:

#table:

{ x, z, MSL, alt } ahead of the aircraft.

[INTERNAL] Schedules the next capture tick for the current loop generation.

The tick runs protected (pcall); errors are logged instead of silently killing the timer.

Defined in:

TARS_SESSION

Parameter:

#number delay

Seconds until the next tick.

[INTERNAL] Populates all shared fields from a MOOSE UNIT object.

Defined in:

TARS_SESSION

Parameter:

The recon aircraft's MOOSE UNIT.

[INTERNAL] Validates a single DCS/MOOSE object against all active filters.

Returns true if the object should be added to the target list.

Defined in:

TARS_SESSION

Parameter:

MOOSE UNIT or STATIC.

Return value:

#boolean:

[INTERNAL] Checks a point is inside of an elipse

Defined in:

TARS_SESSION

Parameters:

ox

oz

cx

cz

a

b

heading_rad

Return value:

#boolean:

IsInElipse

Field(s)

#TARS TARS_SESSION.Callback

The TARS Callback object for menu functions etc.

#boolean TARS_SESSION.PilotParameterHelper

If true, there will be messages about the correct parameters to the UNIT.

#table TARS_SESSION.ammo

Ammo table snapshot from unit:GetAmmo().

#number TARS_SESSION.captureCount

Total unique targets captured this sortie.

#boolean TARS_SESSION.capturing

true while the capture loop is actively running.

#number TARS_SESSION.category

Group category at session creation.

#number TARS_SESSION.coa

Coalition side (1 = Red, 2 = Blue).

#number TARS_SESSION.debriefID

Generation counter of the scheduled debrief. Stale debrief timers are ignored.

#boolean TARS_SESSION.debug

Enable debugging in TARS_SESSION.

#boolean TARS_SESSION.debugunitsearch

Enable Target Search Debug.

#number TARS_SESSION.duration

Remaining expositions (shots) for this sortie. One exposition is used per capture tick.

#boolean TARS_SESSION.filmExhausted

true when duration reached zero.

Wrapper.Group#GROUP TARS_SESSION.group

MOOSE GROUP the aircraft belongs to.

#number TARS_SESSION.groupID

Numeric group ID.

#boolean TARS_SESSION.landingScheduled

true once the debrief timer has been registered.

#number TARS_SESSION.lastTakeoffTime

Mission time of the last takeoff, used for debouncing.

#string TARS_SESSION.lid

Log-line prefix shown in Moose.log entries.

#boolean TARS_SESSION.loop

true while the TARS_SESSION:CaptureLoop timer is scheduled.

#number TARS_SESSION.loopID

Generation counter of the capture loop. Stale timer callbacks with an old ID are ignored.

#string TARS_SESSION.objectName

DCS unit name — used as the registry key.

#number TARS_SESSION.playerID

Numeric DCS unit ID, used as F10-menu and message key.

#string TARS_SESSION.playerName

Human-readable player name as shown in the scoreboard.

#boolean TARS_SESSION.sessionEnded

true after STOP or film exhaustion; awaiting debrief.

#boolean TARS_SESSION.standby

true when film is paused without ending the session.

#table TARS_SESSION.targetList

Targets detected this pass, not yet reported. [unitName] = snap.

#number TARS_SESSION.time

Mission time (seconds) when the session was last refreshed.

#string TARS_SESSION.type

DCS type name of the aircraft (key into TARS.parameters).

Wrapper.Unit#UNIT TARS_SESSION.unit

The MOOSE UNIT object for the recon aircraft.

DCS#Vec3 TARS_SESSION.vec3

World position snapshot taken at session creation.

#boolean TARS_SESSION.wasCapturing

true if capture was active at the moment of touchdown.

Function(s)

Clear a state value that was set for an object.

Defined in:

Parameters:

Object

The object the state is about.

StateName

The key that 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.

DCS#Airbase place

(Optional) The airbase, FARP or ship where the object was born.

#number subplace

(Optional) The 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.

#number IniObjectCategory

(Optional) The object category of the initiator.

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.

#number IniObjectCategory

(Optional) The object category of the initiator.

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_GROUP_CHANGE_OPTION event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Group Initiator

The initiating group of the event.

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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 Unit Lost 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.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#number:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the object's configured event priority.

Defined in:

Return value:

#number:

The configured priority. Defaults to 5.

Get the parent object from the inheritance chain.

To run a parent method on the current instance, call the function with self as its first argument.

local Parent = self:GetParent( self, MYCLASS )
Parent.ParentMethod( self )

Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) Walk up the chain of Child to this class first and return its parent. Use this to call a parent method from a method of an intermediate class.

Return value:

The parent, or nil if there is none.

Get all of the properties of an object in a table.

Defined in:

Return value:

#table:

of values, indexed by keys.

Get one property of an object by the key.

Defined in:

Parameter:

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!

Return value:

Value The value that is stored. Note that the value can be a #string, but it can also be any other type! Nil if not found.

Get a Value given a Key from the Object.

The values are stored in the calling object, keyed by the class name and ID of the given Object. They are not removed when the given Object is destroyed or garbage collected. Use BASE.ClearState() to remove a value.

Defined in:

Parameters:

Object

The object the state is about.

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 no value is stored for the Key.

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

(Optional) The function to be called as EventFunction( self, EventData ) when the event occurs. If not given, the method named after the event is called, e.g. self:OnEventDead( EventData ).

Return value:

self

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

The Child class table is deep copied. The copy looks up missing fields and methods in Parent through its metatable. Parent is usually a new object of the parent class, e.g. BASE:Inherit( self, BASE:New() ).

Defined in:

Parameters:

#table Child

The Child class that inherits.

#BASE Parent

The Parent object that the Child inherits from.

Return value:

The new Child object.

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

The name of the class (#string, case insensitive) or the class itself to run the check against.

Return value:

#boolean:

True if the object is an instance of the class or of a class derived from it. False for an invalid parameter.

Check whether tracing is enabled for the object.

Defined in:

Return value:

#boolean:

true when the Lua debug library is available, tracing is on, and TraceAll, TraceClass, or TraceClassMethod selects the object.

BASE constructor.

Creates a new object as a deep copy of the table the method is called on and assigns the next ClassID. When the BASE class itself is copied, its class-level fields Debug (the Lua debug library) and Scheduler are left out. When the method is called on a derived class or instance, its own Debug and Scheduler fields are copied along with its other fields.

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

Defined in:

Return value:

The new object.

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.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when an option is changed for an AI group.

The event identifies the initiating group, but does not provide the option ID or value.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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 succumbs to Davy 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.

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workaround for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Paratrooper landing.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not multiplayer 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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite weapon reload not counted). Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Schedule a function call once after a delay.

The schedule starts immediately. The function is called without the object as first argument. Pass the object explicitly if needed, e.g. self:ScheduleOnce( 5, MYCLASS.Stop, self ).

Defined in:

Parameters:

#number Start

Delay in seconds before the function is called.

#function SchedulerFunction

The function to be called. It receives the optional arguments given after it.

...

(Optional) Arguments passed to the function.

Return value:

#string:

The Schedule ID of the planned schedule.

Schedule a repeated function call.

The schedule starts immediately. The function is called without the object as first argument. Pass the object explicitly if needed.

Defined in:

Parameters:

#number Start

Delay in seconds before the first call.

#number Repeat

Interval in seconds between the calls.

#number RandomizeFactor

Randomization factor between 0 and 1 to randomize the Repeat interval.

#number Stop

(Optional) Time limit in seconds from when the schedule starts. Omit it or use 0 for no time limit. The dispatcher checks the limit after each call, so a call that was already scheduled can run after the limit expires.

#function SchedulerFunction

The function to be called. It receives the optional arguments given after it.

...

(Optional) Arguments passed to the function.

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 object's event priority for subsequent subscriptions.

The Core.Event dispatcher processes priorities 1 through 10 (10 through 1 for events like Dead). Each subscription is stored under the priority in effect when it is registered.

Defined in:

Parameter:

#number EventPriority

Priority used when registering events.

Return value:

self

Set one property of an object.

Defined in:

Parameters:

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 that is stored. Note that the value can be a #string, but it can also be any other type!

Set a state or property of the Object given a Key and a Value.

The values are stored in the calling object, keyed by the class name and ID of the given Object. They are not removed when the given Object is destroyed or garbage collected. Use BASE.ClearState() to remove a value.

Defined in:

Parameters:

Object

The object the state is about. Its class name and ID are used as index.

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 be stored.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

(Optional) true or nil = trace all methods in MOOSE, false = switch it off.

Set tracing for all methods of a class.

Tracing must also be switched on with BASE.TraceOn().

Defined in:

Parameter:

#string Class

Class name.

Set tracing for a specific method of a class.

Tracing must also be switched on with BASE.TraceOn().

Defined in:

Parameters:

#string Class

Class name.

#string Method

Method.

Set the highest trace level.

F and T methods up to this level write to the log.

Defined in:

Parameter:

#number Level

(Optional) Trace level 1, 2, or 3. Defaults to 1.

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Switch F and T tracing on or off.

Tracing starts disabled in BASE. BASE.E() and BASE.I() log independently of this switch.

Defined in:

Parameter:

#boolean TraceOnOff

(Optional) Use false to disable tracing. Defaults to true.

Usage:


  -- Switch the tracing On
  BASE:TraceOnOff( true )

  -- Switch the tracing Off
  BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

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.

Defined in:

Parameter:

DCS#Event event