Jump to content
Sign in to follow this  
Ace9

Assistance with A2A Spitfire left/right instrument lights

Recommended Posts

Hello.

I have the A2A Spitfire 1.9 Linda module and am compiling a user.lua file. But ! I want to have two switches, 1 for each panel light as in the superb A2A simulation, oh and real life!

EDIT: - (The Lvars are not in the Linda module. Searched the Lua Variables for Panel, Instruments, Lights, etc, the A2A Lvar list states 

Flood lights  (A:LIGHT PANEL,bool) 

                    (>K:PANEL_LIGHTS_TOGGLE)

But I am at a loss hereafter. what does >K: mean ?) I have scanned the offsets 0x0d0c from 1 to 500 and all I get is both on both off, not individually switched by a different parameter?

I cannot figure out what is individually (different) controlling the left and right instrument panel switches using the tracer.

Panel_Lights_On -66057

Panel_Lights_Off -66056

Panel_Lights_Set-66058

Panel_Lights_toggle-65750

I cannot individually (left/right switch) separate the on/off function of Panel_Lights_On (Off) switch, both the left and right switch to On (Off) regardless of the Parameter set  

I have ascertained that there are 2 FSUIPC offsets, 0X0D0C - 0X0280 pertaining to lights,

When Tracer Watching these I get a return of Offset :

UB 0x0D0C=54, 22, 31, 32, 0 (and similar with 0x0280

Looking at Pete Dowsons forum, best I can see is that A2A may have assigned their own offset's or offset parameters, but how to find them short of asking A2A. 

My limited "Tracer" experience is proving a hinderance I hope I can get a boot in the right direction, please.

Edited by Ace9
add info

Share this post


Link to post
Share on other sites

I have managed to isolate the left and right, panel / instrument light's code within Linda Tracer.

Next I found the Lua Variables and tried to switch them in LInda but none of them alone switched the Lamps on although when watching the Lvars and switching the cockpit switch, Linda records ok.

Anyone please point me onwards from here. I have reached my limit, short of asking A2A, but that defeats the object.

Many Thanks. 

Left On
[L] LVar: LightPanelSwitchSave = 1
[L] LVar: LightPanelPast = 1
[L] LVar: Lamp1State = 1
[L] LVar: LightsElectricalDraw = 4.3
[L] LVar: Paused = 1
[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: Paused = 0
[L] LVar: SoundStats_CurrentCount = 0

Left Off
[L] LVar: LightPanelPast = 0
[L] LVar: CockpitSwitchSnd = 9
[L] LVar: Lamp1State = 0
[L] LVar: LightsElectricalDraw = 1.8
[L] LVar: LightPanelSwitchSave = 0
[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: CockpitSwitchSnd = 0
[L] LVar: SoundStats_CurrentCount = 0

Right On
[L] LVar: LightPanelPast = 1
[L] LVar: CockpitSwitchSnd = 10
[L] LVar: Lamp2State = 1
[L] LVar: LightsElectricalDraw = 4.3
[L] LVar: LightPanelSwitchSave = 1
[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: CockpitSwitchSnd = 0
[L] LVar: SoundStats_CurrentCount = 0

Right Off
[L] LVar: LightPanelSwitchSave = 0
[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: LightPanelPast = 0
[L] LVar: Lamp2State = 0
[L] LVar: LightsElectricalDraw = 1.8
[L] LVar: SoundStats_CurrentCount = 0

 

Share this post


Link to post
Share on other sites

Hi Roger

I am unable to help directly as I do not have the A2A Spitfire on P3Dv45. However, I may be able to give you a few pointers on the use of the Lvars you have identified.

Having identified the Lvars you want it is best to start monitoring them in the LINDA Tracer and Console. Ensure that you have Verbose logging selected. In Tracer click on the Lvar and click Start to monitor it in the console. Then operate the switch/control in the virtual cockpit (VC) and note the full range of values. Once you have these you can start to use and modify them.

Normally, to control an Lvar you need to test the initial value (using ipc.readLvar('xx')) and changing the value (using ipc.writeLvar('xx', val)). There are plenty examples of such code in the various modules. One word of caution, one or more Lvars can appear to be associated with each control - one for the switch/button, one for the response/action and possibly others (timers, intermediate values, etc).

The panel light Lvar you have identified show many of these variations. The best advice I can give it to find the one linked to the operation of the button/switch and see the results. I would start with the LampXState Lvars first.

  • Like 1

Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

Hi Andrew,

Many thanks for the instructions, I think I understand what you are saying and will play some more using your guidance which is greatly appreciated as always; and will report back with the result and answer 😁

Game on 👍 

Share this post


Link to post
Share on other sites

Sorry mistaken post.

Edited by Ace9
Error

Share this post


Link to post
Share on other sites

Hi Andrew.

I cannot find any Lvar that will work to twist the knob and switch on the light - but LampXState does rotate the knob only see the lua code below 

Note: - The list Linda delivers when the mouse is used to operate the cockpit knob also below - offset 0x0d0c = 34 and 0x0d0c=0 .

There is a similar situation with the Landing lights (in the A2A Spitfire Module) uses the same code and functions (as below) with different function names i.e SPIT_Light_Landing_left it uses L:LandingLightSwitch with values 0, 1, 2 to switch / Port Light On  -  Off  -  Stbd Light On  (I did however notice that Offset 0x0d0c uses value of 4 and 0 for the Landing Lights in the Linda Tracer listing).

Having spent an awful lot of time on this I think there is no Lvar by itself to operate the Panel Lights independently, unlike the LandinLightSwitch Lvar. 

Many Thanks.

function SPIT_Light_Panel_left ()
    LVarSet = "L:Lamp1State" -- another function for Lamp2State
    ipc.writeLvar(LVarSet, 2)
end

function SPIT_Light_Panel_off ()
    LVarSet = "L:Lamp1State" -- another function for Lamp2State
    ipc.writeLvar(LVarSet, 1)
end

function SPIT_Light_Panel_right ()
    LVarSet = "L:Lamp2State" -- another function for Lamp2State
    ipc.writeLvar(LVarSet, 2)
end

[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: Lamp1State = 1
[L] LVar: LightPanelPast = 1
[L] LVar: LightsElectricalDraw = 2.6
[L] LVar: LightPanelSwitchSave = 1
[O] Offset: UB 0x0D0C = 34
[L] LVar: SoundStats_CurrentCount = 0


[O] Offset: UB 0x0D0C = 2
[L] LVar: SoundStats_CurrentCount = 1
[L] LVar: Lamp1State = 0
[L] LVar: LightPanelPast = 0
[L] LVar: LightsElectricalDraw = 0.1
[L] LVar: LightPanelSwitchSave = 0
[L] LVar: SoundStats_CurrentCount = 0

 

Edited by Ace9

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...