Sign in to follow this  

Help with one button function

Recommended Posts



I am useing the hotas warthog with A2A B17, and LINDA V1.13

I've managed to assign all functions, apart from one.


I have assigned 1 switch, that operate the mags.

If all engines are selected, and i throw the mag switch, it will throw all mag switch to ''on''.

If i select ENG 2 and throw the same switch it will it will only operate the mag2 switch. This is correct.



The problem im having is with the generator switches.

When i have Ex: Eng2 selected and press the button for gen on, it throws all 4 switches.


I've looked through all the listed assignment and cannot find :


''Selected engine gen on / off'' assignment


How would i create this assignment?


If i select A2A B17 in the ''edit aircraft module'', the edit button is greyed out, non clickable?




Share this post

Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I will check whether the edit aircraft module button is working correctly with the current version of LINDA 2.8.6. I am afraid version 1.13 is no longer supported and only available for legacy use 'as is'.


You can edit the A2A B17 module using the LINDA Editor. Simply open the actions.lua  file in /modules/linda/aircrafts/A2A B17. I cannot help you with the B17 functions as I do not own that aircraft add-on.

Share this post

Link to post
Share on other sites

Thanks for the reply Scotflieger.


I can do this with the engine mesh on all 4 engines useing 1 switch, so im sure it can be done


I have taken a look through the editor to try and see how it works useing my extreme limited knowledge :unknw:  and can see that it reads :


Tvar = ipc.readLvar("L:EngineSelection")


if Tvar == 1 then SVar = 1
if Tvar == 2 then SVar = 2
if Tvar == 4 then SVar = 3
if Tvar == 8 then SVar = 4
if Tvar == 15 then Svar = 0

    if SVar == 1 then
    ipc.writeLvar("L:Starter12Mesh", 0)
    elseif SVar == 2 then
    ipc.writeLvar("L:Starter12Mesh", 2)
    elseif SVar == 3 then
    ipc.writeLvar("L:Starter34Mesh", 2)
    elseif SVar == 4 then
    ipc.writeLvar("L:Starter34Mesh", 0)
    elseif SVar == 0 then
    DspShow("Mesh", " " .. SVar .. " ")

To me that reads ''Computer, read whitch engine is selected'' to mesh.


So, is it a case of inserting Tvar = ipc.readLvar("L:EngineSelection") -somewhere in the text below?



function B17_Generator1_on ()
    ipc.writeLvar("L:Eng1_GeneratorSwitch", 1)
    DspShow(" Gen", "1 on")

function B17_Generator2_on ()
    ipc.writeLvar("L:Eng2_GeneratorSwitch", 1)
    DspShow(" Gen", "2 on")

function B17_Generator3_on ()
    ipc.writeLvar("L:Eng3_GeneratorSwitch", 1)
    DspShow(" Gen", "3 on")

function B17_Generator4_on ()
    ipc.writeLvar("L:Eng4_GeneratorSwitch", 1)
    DspShow(" Gen", "4 on")

function B17_GeneratorsAll_on ()

    B17_Generator1_on ()
    _sleep(200, 500)
    B17_Generator4_on ()
    _sleep(200, 500)
    B17_Generator2_on ()
    _sleep(200, 500)
    B17_Generator3_on ()


function B17_Generator1_off ()
    ipc.writeLvar("L:Eng1_GeneratorSwitch", 0)
    DspShow(" Gen", "1off")

function B17_Generator2_off ()
    ipc.writeLvar("L:Eng2_GeneratorSwitch", 0)
    DspShow(" Gen", "2off")

function B17_Generator3_off ()
    ipc.writeLvar("L:Eng3_GeneratorSwitch", 0)
    DspShow(" Gen", "3off")

function B17_Generator4_off ()
    ipc.writeLvar("L:Eng4_GeneratorSwitch", 0)
    DspShow(" Gen", "4off")

function B17_GeneratorsAll_off ()

    B17_Generator1_off ()
    _sleep(200, 500)
    B17_Generator4_off ()
    _sleep(200, 500)
    B17_Generator2_off ()
    _sleep(200, 500)
    B17_Generator3_off ()




Share this post

Link to post
Share on other sites

Well, i managed to do it :)


Simple bit of copy and paste and a bit of guess work and i got it first time!




and the editor :



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