Module PseudoATC

  • Functional - (R2.4) Rudimentary ATC.

Banner Image


The pseudo ATC enhances the standard DCS ATC functions.

In particular, a menu entry "Pseudo ATC" is created in the "F10 Other..." radiomenu.

Features

  • Weather report at nearby airbases and mission waypoints.
  • Report absolute bearing and range to nearest airports and mission waypoints.
  • Report current altitude AGL of own aircraft.
  • Upon request, ATC reports altitude until touchdown.
  • Works with static and dynamic weather.
  • Player can select the unit system (metric or imperial) in which information is reported.
  • All maps supported (Caucasus, NTTR, Normandy, Persian Gulf and all future maps).

Demo Missions

MOOSE - ALL Demo Missions


YouTube Channel

MOOSE YouTube Channel


Author: funkyfranky

Contributions: FlightControl


Global(s)

PSEUDOATC

PSEUDOATC class, extends Core.Base#BASE

The PSEUDOATC class adds some rudimentary ATC functionality via the radio menu.

Type PSEUDOATC

PSEUDOATC:AltidudeTimerToggle(id)

Toggle report altitude reporting on/off.

PSEUDOATC:AltitudeTimeStart(id)

Start altitude reporting scheduler.

PSEUDOATC:AltitudeTimerStop(id)

Stop/destroy DCS scheduler function for reporting altitude.

PSEUDOATC:ChattyOff()

Chatty mode off.

PSEUDOATC:ChattyOn()

Chatty mode on.

PSEUDOATC.ClassName

Name of the Class.

PSEUDOATC.Debug

If true, print debug info to dcs.log file.

PSEUDOATC:DebugOff()

Debug mode off.

PSEUDOATC:DebugOn()

Debug mode on.

PSEUDOATC:LocalAirports(id)

Create list of nearby airports sorted by distance to player unit.

PSEUDOATC:MenuAirports(id)

Create "F10/Pseudo ATC/Local Airports/Airport Name/" menu items each containing weather report and BR request.

PSEUDOATC:MenuClear(id)

Clear player menus.

PSEUDOATC:MenuRefresh(id)

Refreshes all player menues.

PSEUDOATC:MenuWaypoints(id)

Create "F10/Pseudo ATC/Waypoints/ menu items.

PSEUDOATC:New()

PSEUDOATC contructor.

PSEUDOATC:PlayerEntered(unit)

Function called when a player enters a unit.

PSEUDOATC:PlayerLanded(unit, place)

Function called when a player has landed.

PSEUDOATC:PlayerLeft(unit)

Function called when a player leaves a unit or dies.

PSEUDOATC:PlayerTakeOff(unit, place)

Function called when a player took off.

PSEUDOATC:ReportBR(id, position, location)

Report absolute bearing and range form player unit to airport.

PSEUDOATC:ReportHeight(id, dt, _clear)

Report altitude above ground level of player unit.

PSEUDOATC:ReportWeather(id, position, location)

Weather Report.

PSEUDOATC:SetEventsMoose(switch)

Enable/disable event handling by MOOSE or DCS.

PSEUDOATC:SetMenuRefresh(interval)

Set time interval after which the F10 radio menu is refreshed.

PSEUDOATC:SetMessageDuration(duration)

Set duration how long messages are displayed.

PSEUDOATC:SetReportAltInterval(interval)

Set time interval for reporting altitude until touchdown.

PSEUDOATC:Start()

Starts the PseudoATC event handlers.

PSEUDOATC:_DisplayMessageToGroup(_unit, _text, _time, _clear)

Display message to group.

PSEUDOATC:_GetPlayerUnitAndName(_unitName)

Returns the unit of a player and the player name.

PSEUDOATC:_OnBirth(EventData)

Function called my MOOSE event handler when a player enters a unit.

PSEUDOATC:_PlayerLanded(EventData)

Function called by MOOSE event handler when a player landed.

PSEUDOATC:_PlayerLeft(EventData)

Function called by MOOSE event handler when a player leaves a unit or dies.

PSEUDOATC:_PlayerTakeOff(EventData)

Function called by MOOSE/DCS event handler when a player took off.

PSEUDOATC:_myname(unitname)

Returns a string which consits of this callsign and the player name.

PSEUDOATC.chatty

Display some messages on events like take-off and touchdown.

PSEUDOATC.eventsmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler.

PSEUDOATC.id

Some ID to identify who we are in output of the DCS.log file.

PSEUDOATC.mdur

Duration in seconds how low messages to the player are displayed.

PSEUDOATC.mrefresh

Interval in seconds after which the F10 menu is refreshed. E.g. by the closest airports. Default is 120 sec.

PSEUDOATC:onEvent(Event)

Event handler for suppressed groups.

PSEUDOATC.player

Table comprising each player info.

PSEUDOATC.talt

Interval in seconds between reporting altitude until touchdown. Default 3 sec.

PSEUDOATC.version

PSEUDOATC version.

Global(s)

#PSEUDOATC PSEUDOATC

PSEUDOATC class, extends Core.Base#BASE

The PSEUDOATC class adds some rudimentary ATC functionality via the radio menu.

Local weather reports can be requested for nearby airports and player's mission waypoints. The weather report includes

  • QFE and QNH pressures,
  • Temperature,
  • Wind direction and strength.

The list of airports is updated every 60 seconds. This interval can be adjusted by the function PSEUDOATC.SetMenuRefresh(interval).

Likewise, absolute bearing and range to the close by airports and mission waypoints can be requested.

The player can switch the unit system in which all information is displayed during the mission with the MOOSE settings radio menu. The unit system can be set to either imperial or metric. Altitudes are reported in feet or meter, distances in kilometers or nautical miles, temperatures in degrees Fahrenheit or Celsius and QFE/QNH pressues in inHg or mmHg. Note that the pressures are also reported in hPa independent of the unit system setting.

In bad weather conditions, the ATC can "talk you down", i.e. will continuously report your altitude on the final approach. Default reporting time interval is 3 seconds. This can be adjusted via the PSEUDOATC.SetReportAltInterval(interval) function. The reporting stops automatically when the player lands or can be stopped manually by clicking on the radio menu item again. So the radio menu item acts as a toggle to switch the reporting on and off.

Scripting

Scripting is almost trivial. Just add the following two lines to your script:

pseudoATC=PSEUDOATC:New()
pseudoATC:Start()

Type PseudoATC

Type PSEUDOATC

Extends Core.Base#BASE

  • PSEUDOATC class

Field(s)

PSEUDOATC:AltidudeTimerToggle(id)

Toggle report altitude reporting on/off.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:AltitudeTimeStart(id)

Start altitude reporting scheduler.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:AltitudeTimerStop(id)

Stop/destroy DCS scheduler function for reporting altitude.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:ChattyOff()

Chatty mode off.

Don't display some messages on take-off and touchdown.

PSEUDOATC:ChattyOn()

Chatty mode on.

Display some messages on take-off and touchdown.

#string PSEUDOATC.ClassName

Name of the Class.

#boolean PSEUDOATC.Debug

If true, print debug info to dcs.log file.

PSEUDOATC:DebugOff()

Debug mode off.

This is the default setting.

PSEUDOATC:DebugOn()

Debug mode on.

Send messages to everone.

PSEUDOATC:LocalAirports(id)

Create list of nearby airports sorted by distance to player unit.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:MenuAirports(id)

Create "F10/Pseudo ATC/Local Airports/Airport Name/" menu items each containing weather report and BR request.

Parameter

  • #number id : Group id of player unit for which menues are created.

PSEUDOATC:MenuClear(id)

Clear player menus.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:MenuRefresh(id)

Refreshes all player menues.

Parameter

  • #number id : Group id of player unit.

PSEUDOATC:MenuWaypoints(id)

Create "F10/Pseudo ATC/Waypoints/ menu items.

Parameter

  • #number id : Group id of player unit for which menues are created.

PSEUDOATC:New()

PSEUDOATC contructor.

Return value

#PSEUDOATC: Returns a PSEUDOATC object.

PSEUDOATC:PlayerEntered(unit)

Function called when a player enters a unit.

Parameter

PSEUDOATC:PlayerLanded(unit, place)

Function called when a player has landed.

Parameters

  • Wrapper.Unit#UNIT unit : Unit of player which has landed.

  • #string place : Name of the place the player landed at.

PSEUDOATC:PlayerLeft(unit)

Function called when a player leaves a unit or dies.

Parameter

PSEUDOATC:PlayerTakeOff(unit, place)

Function called when a player took off.

Parameters

  • Wrapper.Unit#UNIT unit : Unit of player which has landed.

  • #string place : Name of the place the player landed at.

PSEUDOATC:ReportBR(id, position, location)

Report absolute bearing and range form player unit to airport.

Parameters

  • #number id : Group id to the report is delivered.

  • Core.Point#COORDINATE position : Coordinates at which the pressure is measured.

  • #string location : Name of the location at which the pressure is measured.

PSEUDOATC:ReportHeight(id, dt, _clear)

Report altitude above ground level of player unit.

Parameters

  • #number id : Group id to the report is delivered.

  • #number dt : (Optional) Duration the message is displayed.

  • #boolean _clear : (Optional) Clear previouse messages.

Return value

#number: Altitude above ground.

PSEUDOATC:ReportWeather(id, position, location)

Weather Report.

Report pressure QFE/QNH, temperature, wind at certain location.

Parameters

  • #number id : Group id to which the report is delivered.

  • Core.Point#COORDINATE position : Coordinates at which the pressure is measured.

  • #string location : Name of the location at which the pressure is measured.

PSEUDOATC:SetEventsMoose(switch)

Enable/disable event handling by MOOSE or DCS.

Parameter

  • #boolean switch : If true, events are handled by MOOSE (default). If false, events are handled directly by DCS.

PSEUDOATC:SetMenuRefresh(interval)

Set time interval after which the F10 radio menu is refreshed.

Parameter

  • #number interval : Interval in seconds. Default is every 120 sec.

PSEUDOATC:SetMessageDuration(duration)

Set duration how long messages are displayed.

Parameter

  • #number duration : Time in seconds. Default is 30 sec.

PSEUDOATC:SetReportAltInterval(interval)

Set time interval for reporting altitude until touchdown.

Parameter

  • #number interval : Interval in seconds. Default is every 3 sec.

PSEUDOATC:Start()

Starts the PseudoATC event handlers.

PSEUDOATC:_DisplayMessageToGroup(_unit, _text, _time, _clear)

Display message to group.

Parameters

  • Wrapper.Unit#UNIT _unit : Player unit.

  • #string _text : Message text.

  • #number _time : Duration how long the message is displayed.

  • #boolean _clear : Clear up old messages.

PSEUDOATC:_GetPlayerUnitAndName(_unitName)

Returns the unit of a player and the player name.

If the unit does not belong to a player, nil is returned.

Parameter

  • #string _unitName : Name of the player unit.

Return values

  1. Wrapper.Unit#UNIT: Unit of player.

  2. #string: Name of the player.

  3. nil If player does not exist.

PSEUDOATC:_OnBirth(EventData)

Function called my MOOSE event handler when a player enters a unit.

Parameter

PSEUDOATC:_PlayerLanded(EventData)

Function called by MOOSE event handler when a player landed.

Parameter

PSEUDOATC:_PlayerLeft(EventData)

Function called by MOOSE event handler when a player leaves a unit or dies.

Parameter

PSEUDOATC:_PlayerTakeOff(EventData)

Function called by MOOSE/DCS event handler when a player took off.

Parameter

PSEUDOATC:_myname(unitname)

Returns a string which consits of this callsign and the player name.

Parameter

  • #string unitname : Name of the player unit.

#boolean PSEUDOATC.chatty

Display some messages on events like take-off and touchdown.

#boolean PSEUDOATC.eventsmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler.

#string PSEUDOATC.id

Some ID to identify who we are in output of the DCS.log file.

#number PSEUDOATC.mdur

Duration in seconds how low messages to the player are displayed.

#number PSEUDOATC.mrefresh

Interval in seconds after which the F10 menu is refreshed. E.g. by the closest airports. Default is 120 sec.

PSEUDOATC:onEvent(Event)

Event handler for suppressed groups.

Parameter

  • #table Event : Event data table. Holds event.id, event.initiator and event.target etc.

#table PSEUDOATC.player

Table comprising each player info.

#number PSEUDOATC.talt

Interval in seconds between reporting altitude until touchdown. Default 3 sec.

#number PSEUDOATC.version

PSEUDOATC version.

Type RANGE