flybywiresim/aircraft

[BUG] COCKPIT LIGHT POTENTIOMETER SDK DATA VARIABLES IGNORED AFTER UPDATE

CubanJew opened this issue · 5 comments

Mod Version
Master (package_version: 0.1.51)

Describe the bug
A32NX update for compatibility with game v1.7.12 (possibly may have been earlier update) broke the ability to adjust cockpit lights via SDK commands. Changing light potentiometer data variable MSFS:LIGHT POTENTIOMETER:x values via SDK simulation event command MSFS:LIGHT_POTENTIOMETER_x_SET:y has no affect on actual cockpit light level in-game.

With SPAD.next (or other SDK interface tool) you can:

  1. read state of each light potentiometers by reading data definition/variable
    MSFS:LIGHT POTENTIOMETER:x
    (where x is the unique light pot ID between 1-23).

  2. set the state of any light potentiometer via simulation event command MSFS:LIGHT_POTENTIOMETER_x_SET:y
    (x=pot ID, y=integer value between 1-100 denoting percent)

To Reproduce

  1. Using SPAD.next (or other SDK interface) monitor value of MSFS:LIGHT POTENTIOMETER:x (x is value between 1-23) data variables in DATA MONITOR.
  2. Adjust cabin light potentiometers in-game and observe no change to value of MSFS:LIGHT POTENTIOMETER:x. See Reference section below for pot ID cross-reference table.
  3. Set cabin light potentiometer value via SDK by issuing simulation event command MSFS:LIGHT_POTENTIOMETER_x_SET:y (x=1-23 pot ID, y=value between 1-100) and observe corresponding value change to data variable MSFS:LIGHT POTENTIOMETER:x but NO change to actual light level in-game.

Expected behavior
Should be able to adjust cockpit lights via MSFS:LIGHT_POTENTIOMETER_x_SET:y simulation commands.
Specifically:

  • Adjusting cockpit light potentiometers in-game should update value of MSFS:LIGHT POTENTIOMETER:X data variable.
  • Setting value of light potentiometer data variable MSFS:LIGHT POTENTIOMETER:x via SDK simulation event command MSFS:LIGHT_POTENTIOMETER_x_SET:y should update actual cockpit light level.

Actual behavior

  • Adjusting cockpit light potentiometers in-game does NOT update value of light potentiometer data variable.
  • Conversely, changing value of light potentiometer data variable does NOT change actual state of light in-game.

References
SDK light potentiometer ID cross-reference:
6 - FLOODLIGHT (PFD)
11 - FLOODLIGHT (PANEL)
13 - FLOODLIGHT (MAIN PANEL)
14 - PANEL LIGHTING
15 - MAIN PANEL & PEDASTOL LIGHTING
16 - OVERHEAD PANEL LIGHTING
17 - FD
18 - PFD (PILOT)
19 - ND (PILOT)
20 - PFD (COPILOT)
21 - ND (COPILOT)
22 - ECAM (UPPER)
23 - ECAM (LOWER)

Additional context

  • Light potentiometer data variable MSFS:LIGHT POTENTIOMETER:x values are still being updated via simulation event command MSFS:LIGHT_POTENTIOMETER_x_SET:y but it has no impact in-game.
  • Issue is with A32NX only; light pots work correctly with vanilla unmodified game.
  • Individual panel light on/off state MSFS:LIGHT PANEL:x (x is integer between 1-5) data variable values make no difference.
  • Issue started occurring after an A32NX update (I am 95% sure I recall it working fine with earlier A32NX version). It may have been the same update that introduced the flashlight when cabin lights are off and dark outside.
  • Discord username: NWG_CubanJew#8190

We changed the potentiometer indices to fix the issue where displays were switching themselves off. The indices should be just shifted up around 70, i.e they should now be somewhere in the 70-90 range, the highest is 93 IIRC.

Will be addressed by SPAD.neXt update. Not a A32NX bug. You can close this.

@lousybyte @lukecologne

Is there an alternate way to resolve the original displays switching off issue without shifting light potentiometer indices? The author of SPAD.next did some digging and concluded there isn't a feasible way to interface with these higher index potentiometers external to the game.

If not, for me to reset the pot indices in my local copy of A32NX would I just need to edit
A32NX/SimObjects/AirPlanes/Asobo_A320_NEO/model/A320_NEO_INTERIOR.xml
and then run A32NX/build.py? Thanks in advance.

This was the full response to me from author of SPAD.next (@c0nnex):

Dug a bit around in the MSFS code.
MSFS does only supports LIGHT_POTENTIOMETER_X_SET event for X = 1 .. 30

The data values LIGHT POTENTIOMETER:X are all readonly.

So far i did not find a way to set the value for the "LIGHT_POTENTIOMETER_SET" event.
There seesm to be no common way to push a value onto the stack, like it's done in the ingame events. So, as long as this is not documented by Asobo, or I can get the lvar bridge working (which is technically no problem, butr right now MSFS does not support "global" injections, just on plane by plane base) i fear there is no way to get this working, unless FlyByWireTeam changes indexes to

Thanks for all your hard work.

You can revert the changes from #787 if that's what this is about.

Just tried and was able to get pots working again by reverting the indices in .A320_NEO_INTERIOR.xml

Thanks!