Skip to content

A220 config: lights declared as FeatureType.Bool always read as 0 (only taxi lights work) #17

Description

@m3rlinek01

Environment
vmsACARS 2.2.74 (win-x64-stable)
MSFS 2024
Synaptic Simulations A220, A220-300 preset
Config: the built-in synaptic_a220 map added in #10
Found in line service at flyPL Virtual (pilot: m3rlinek)
Summary
In src/aircraft/SynapticA220.ts, every light except the taxi lights is declared as
FeatureType.Bool. Those lookups always come back as 0, so ACARS reports the lights as
permanently off and the lighting rules fire for a pilot who has them correctly switched on.
The taxi lights are the only light in that file declared as FeatureType.Int — and they are
the only one that works. Changing every LVar lookup to FeatureType.Int fixes all of them.
Log evidence
Before the change — the aircraft is taxiing with all exterior lights on:

I: Found matching config map from Synaptic Simulations A220
I: Beacon Lights: Selected "Synaptic Simulations A220" as the best match
...
I: Beacon Lights set to off
I: Navigation Lights set to off
I: Strobe Lights set to off
I: Landing Lights set to off
I: Logo Light set to off
I: Taxi Lights set to on      <-- the only FeatureType.Int light
I: Wing Lights set to off
...
I: Rule: BEACON_LIGHTS_ON_ENGINE_RUNNING - Timer delay passed, marking violated
I: Rule Triggered - Beacon lights must be on while engine is running, -5pts
I: Rule Triggered - Landing lights must be on below 10000, -5pts

After the change (same aircraft, same flight, lookups switched to FeatureType.Int, shipped as
a custom config with priority: 5):

I: Beacon Lights: Selected "Synaptic A220 (override)" as the best match
...
I: Landing Lights set to on
I: Strobe Lights set to on
I: Battery set to on

Why Bool fails here
The Synaptic docs (https://docs.synapticsim.com/pilots/simvars) describe these variables as
"Bool", which is presumably where the FeatureType.Bool in #10 came from. The two meanings of
"bool" have quietly diverged here: the docs use it to describe the switch (two-state, as
opposed to the taxi and seat belt switches, which they document as enums), while ACARS's
FeatureType describes how the value should be read out of the sim. MSFS LVars are floats,
so a two-state A220 switch reports 0 or 1 and has to be read as Int.
To be clear, the Synaptic documentation itself is accurate — I checked every lighting variable
it lists against the aircraft's own
Cockpit/Overhead/Lights.xml and they match, including the three-state taxi switch and the
A22X Nose Landing Lights entry that the config omits. The mismatch is purely in the mapping.
This also matches every other MSFS config in the repo: Fenix, iniBuilds A300/A350, PMDG
737/777, iFly B38M all use FeatureType.Int for LVar lookups. FeatureType.Bool only appears
for FSUIPC offsets and for A:...,bool simvars. SynapticA220.ts is the only MSFS config that
uses it for plain LVars.
It may be worth rejecting or warning on FeatureType.Bool for LVar lookups at load time, since
it fails silently — the feature just reads as permanently off, with no error in the log.
Two smaller issues in the same file

  1. The nose landing light is missing. The A220 has three landing light switches, all
    documented: A22X L Landing Lights, A22X R Landing Lights and A22X Nose Landing Lights.
    The current landingLights() requires left and right to be on, so a pilot using the nose
    light plus one wing light is reported as having the landing lights off. Suggested: include the
    nose switch and treat any one of the three as "on".
  2. Emergency lights are not mapped. A22X Emergency Lights exists and is an enum
    (0 = Off, 1 = Arm, 2 = On). 0 = Off is confirmed by the aircraft's own
    common/checklist/A220_Checklist.xml, which tests this variable against 0 for the
    "EMER LTS ... OFF" checkpoint.
    Patch
--- a/src/aircraft/SynapticA220.ts
+++ b/src/aircraft/SynapticA220.ts
@@ -22,36 +22,40 @@
 
   features: FeatureAddresses = {
     [AircraftFeature.BeaconLights]: {
-      'A22X Beacon Lights': FeatureType.Bool,
+      'A22X Beacon Lights': FeatureType.Int,
     },
     [AircraftFeature.NavigationLights]: {
-      'A22X Nav Lights': FeatureType.Bool,
+      'A22X Nav Lights': FeatureType.Int,
     },
     [AircraftFeature.StrobeLights]: {
-      'A22X Strobe Lights': FeatureType.Bool,
+      'A22X Strobe Lights': FeatureType.Int,
     },
     [AircraftFeature.TaxiLights]: {
       'A22X Taxi Lights': FeatureType.Int,
     },
     [AircraftFeature.LandingLights]: {
-      'A22X L Landing Lights': FeatureType.Bool,
-      'A22X R Landing Lights': FeatureType.Bool,
+      'A22X L Landing Lights': FeatureType.Int,
+      'A22X R Landing Lights': FeatureType.Int,
+      'A22X Nose Landing Lights': FeatureType.Int,
     },
     [AircraftFeature.LogoLights]: {
-      'A22X Logo Lights': FeatureType.Bool,
+      'A22X Logo Lights': FeatureType.Int,
     },
     [AircraftFeature.WingLights]: {
-      'A22X Wing Insp Lights': FeatureType.Bool,
+      'A22X Wing Insp Lights': FeatureType.Int,
+    },
+    [AircraftFeature.EmergencyLights]: {
+      'A22X Emergency Lights': FeatureType.Int,
     },
     [AircraftFeature.Seatbelts]: {
       'A22X Seat Belt Lights': FeatureType.Int,
     },
     [AircraftFeature.ParkingBrakes]: {
-      'A22X Parking Brake': FeatureType.Bool,
+      'A22X Parking Brake': FeatureType.Int,
     },
     [AircraftFeature.Packs]: {
-      'A22X L Pack Off': FeatureType.Bool,
-      'A22X R Pack Off': FeatureType.Bool,
+      'A22X L Pack Off': FeatureType.Int,
+      'A22X R Pack Off': FeatureType.Int,
     },
     [AircraftFeature.AntiIce]: {
       'A22X L Cowl Anti Ice': FeatureType.Int,
@@ -62,7 +66,7 @@
       'A22X APU Switch': FeatureType.Int,
     },
     [AircraftFeature.ExternalPower]: {
-      INI_GPU_AVAIL: FeatureType.Bool,
+      INI_GPU_AVAIL: FeatureType.Int,
     },
   }
 
@@ -97,8 +101,9 @@
     return value > 0
   }
 
-  landingLights(left: number, right: number): FeatureState {
-    return left === 1 && right === 1
+  // Three separate switches: left wing, right wing and nose gear
+  landingLights(left: number, right: number, nose: number): FeatureState {
+    return left == 1 || right == 1 || nose == 1
   }
 
   logoLights(value: number): FeatureState {
@@ -109,6 +114,11 @@
     return value === 1
   }
 
+  // 0 = Off, 1 = Arm, 2 = On
+  emergencyLights(value: number): FeatureState {
+    return value > 0
+  }
+
   // 0 = Off, 1 = Auto, 2 = On
   seatbelts(value: number): FeatureState {
     return value > 0

All LVar names in the patch were verified against the aircraft itself, in
SimObjects/Airplanes/Synaptic_A220/attachments/inibuilds/Asset_A220_Common/Synaptic/A220/Cockpit/Overhead/Lights.xml,
and against the Synaptic SimVars documentation.
Optional: battery and external power
Not part of the patch above, since these come from the aircraft files rather than the public
SimVars documentation, but both look wrong in practice:
Battery is not mapped, so it falls back to the MSFS default map, which reads
A:ELECTRICAL MASTER BATTERY:0. The A220 uses indices 1 and 2 (see the aircraft's
Cockpit/Overhead/Electrical.xml), so the battery reads as off no matter what the switches
are doing. Mapping A:ELECTRICAL MASTER BATTERY:1,bool and :2,bool fixes it — confirmed
with Battery set to on in the log.
External power currently uses INI_GPU_AVAIL, which reports that ground power is
available rather than in use. A22X External Power In Use is the more accurate lookup.
Neither of these is covered by the Synaptic SimVars page, which is the one real gap I found in
it — the page has no power or electrical section at all.
I am happy to open a PR with any subset of the above if that is easier.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions