Skip to content

SimVars

Marek Vajgl edited this page Apr 25, 2024 · 6 revisions

The app connects to FS2020 via the SimConnect library and reads out values for COM volume and transmit flag. If not changed, default SimVars to read out COM volume and transmit flag are used (see below).

Those simvars are predefined and used by all default FS2020 airplanes and most of the add-ons. However, in some cases, you might need to adjust those simvars, e.g.:

  • You would like to keep the original behavior as lowering the in-game COM radio volume to 0 causes FS2020 AI ATC is not heard. When connected via this app, lowering the COM radio volume to 0 causes also the vPilot volume to be muted.
  • Some planes/addons use different simvars to control the volume/transmit COM and you would like to monitor them instead.

Monitored SimVars

As mentioned, the app is monitoring several FS2020 SimVars to provide its functionality:

  • COM radio volume 1-3 - to read out the current volume of the COM radio in the simulation. By default, this property is represented by COM VOLUME:{i}.
  • Active COM transmiting radio 1-3 - to read out the currently selected COM radio used for transmission. By default, this property is represented by COM TRANSMIT:{i}.
  • COM radio active frequency 1-3 - to read out the current active frequency for each COM radio. This property is represented by COM ACTIVE FREQUENCY:{i} (cannot be changed).

In the config file, you can change the monitored FS2020 vars from the default ones to different ones via keys AppSimCon.ComVolumeVar for volume or AppSimCon.ComTransmitVar for transmit. For example, you can adjust the values to use so-called L-vars like:

{
  "AppSimCon": {
    ...
    "ComVolumeVar": "L:COM_VOLUME:{i}",
    "ComTransmitVar": "L:COM_TRANSMIT:{i}",
    ...
...

Note: Sequence {i} is always replaced with the respective COM number.

Note: Be sure you are not overriding some L-var used by another addon as this may cause unexpected behavior in the sim.

When set in this way, you may now change L:COM_VOLUME:1 variable to control the COM1 volume. In the volume variable, expected values are decimals between 0..1 defining volume %. In the transmit variable, expected values are decimal values 0 (not active) or 1 (active).

Once done, you can map your controller to work with those values (e.g. via MobiFlight) to control transmit and volume values.

Additionally:

  • By default, plane latitude location is used for validation if FS2020 has loaded already and is ready to initialize SimVars. This value is checked for non-empty and non-zero value. Once detected, the SimVar initialization is executed (see below). The default "plane latitude" SimVar can be changed to a different one with the same behavior using InitializedCheckVar key in config file.

SimVars Init

This part was created to initialize custom L-vars (defined in the previous step) on the app startup. However, it can be used also to reset the default values if the original FS2020 simvars are used.

Why - if you define custom L-vars in the previous step and those variables are not defined/used by any addon, you have to set their initial values.

To set the variable values when started, use InitComTransmit, InitComVolume and InitComFrequency keys in config:

{
  "AppSimCon": {
    ...
    "InitComTransmit": [ 1, 0, -1 ],
    "InitComVolume": [ 0.9, -1, -1 ],
    "InitComFrequency: [122.8, -1, -1],
    ...
...  

Rules:

  • The number of elements in the list must equal to AppSimCon.NumberOfComs.
  • Value -1 always means "do nothing, skip initialization and continue with the next item".
  • For volume, float values 0..1 define the initial state. E.g., 0.5 initializes volume to 50 %.
  • For transmit, integer values 0/1 define the initial state: 0 - not active, 1 - active.
  • For frequency, decimal values between 118.000 and 136.975 are accepted.

The example above initializes sets COM1 transmit to the active state, COM2 transmit to the inactive state, and skips COM3 transmit initialization. Also sets COM1 volume to 90 % and frequency to 122.800 (VATSIM Unicom) and skips the other COM2/3 initializations.

Note: Default SimEvent COM_RADIO_SET_HZ (or its equivalents for COM2/3) is used to adjust the COM frequency. This cannot be changed.