Sign in to follow this  
MaDDogz

Help with one button function

Recommended Posts

Hi

 

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?

 

Thanks

Luke

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
end
if Tvar == 2 then SVar = 2
end
if Tvar == 4 then SVar = 3
end
if Tvar == 8 then SVar = 4
end
if Tvar == 15 then Svar = 0
end

    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
    end
    DspShow("Mesh", " " .. SVar .. " ")
end

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")
end

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

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

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




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 ()

end

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

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

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

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

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 ()

 

end

 

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!

 

linda.jpg

 

and the editor :

 

linda1.jpg

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