Jump to content

Sign in to follow this  
KL Oo

Assigning multiple events to one button switch

Recommended Posts

Hi guys,

 

I've just purchased a new Warthog HOTAS and am loving it. Over the past 2 days I've downloaded LINDA and learnt a lot about assigning events to button presses and am currently utilising the NGX modules provided. Great stuff.

 

What I'd like to know is if its possible to assign two events to occur consecutively upon a single button press. I.e, I want yo assign one button press to firstly enact NGXCDU GND PWR ON and then NGX GRD PWR ON.

 

I;ve tried creating mouse macros with FSUIPC but thats been problematic and I think part of the issue is FSUIPC not being able to pickup certain PMDG events or something.

 

Anyway, is there a way to do this - run two events for one button press.

 

Cheers,

 


Kael Oswald

i7 8086k @ 5.1 / ASUS ROG Maximus XI / 16GB DDR4 3600 @ 15 / H150i PRO AIO / RTX 2080 TI / 49" SONY 4K LCD TV

Share this post


Link to post
Share on other sites

Here is a good link over at A2A that shows how to do it. http://a2asimulations.com/forum/viewtopic.php?f=55&t=19524

26 minutes ago, KL Oo said:

Anyway, is there a way to do this - run two events for one button press.

 


Sam

Prepar3D V5.0/8086K@5.0/EVGA 1080TI SC Black/850W PSU/Windows 10/40" 4K Samsung Monitor@3840x2160/ASP4/ASCA/ORBX/ChasePlane/General Aviation/Vertx DA-62/

Share this post


Link to post
Share on other sites

Welcome to the LINDA community.

You can you the OnPress and OnRelease to assign the 2 sequential functions you wish to call. This is the quickest and easiest method.

Alternatively, you can write you own function containing those functions you wish to call. If you have an aircraft other than FSX Default click on Edit and then Edit User. This opens the user.lua module into the LINDA Editor. Then enter the following code, for example:

  • function myFunction()
  • function1()
  • sleep(50)
  • function2()
  • end

When done click on Save and Reload LUA Engine. 

Assign your new myFunction from the aircraft user mode to your joystick button.

Edited by ScotFlieger
  • Upvote 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

Sorry where do we find the built in function() list ?

SOLN:

If you click on "Edit Actions" on the bottom right - it will show a list of all the functions.

The names are the same ones we see in the drop down list when assigning to buttons (with underscore to represent spaces)

eg:

function AB_ALT_plus ()   for "AB ALT plus"

 

Edited by julian46
more information

Share this post


Link to post
Share on other sites

Writing LINDA code requires a little knowledge of programming for you to use the LUA interpreted language. I used function1() and function2() as example function names. You will need to replace these with the names of your desired functions.

To answer your other question. LUA function names can not use spaces so underscores are normally used by us programmers. For readability these are removed when listed.

Edited by ScotFlieger
  • 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

Thanks so much for your help Scott - Worked a treat. A world of options has opened up!!! I can pre setup my entire aircraft with one button press!

 

Edited by KL Oo

Kael Oswald

i7 8086k @ 5.1 / ASUS ROG Maximus XI / 16GB DDR4 3600 @ 15 / H150i PRO AIO / RTX 2080 TI / 49" SONY 4K LCD TV

Share this post


Link to post
Share on other sites

You are very welcome. Enjoy!!


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, cause I didn't find another post for my problem I think I am correct here.

I am really very happy about the macro "FSLabs Airbus A3xx-X 1.4 (3 Jan 20)" as I am flying the FSL A320 since more than one year. I was always looking for software assigning my game controller buttons to my Airbus. Now with this wonderful Linda Macro I can assign ALL the A320 switches , buttons and rotarys. AND it works perfect. I also use FSUIPC, LUA and SPADneXt for many years.

My question: how can I assign more than one function to ONE button. How can I configure the FSLabs A3xx macro for assigning more than one function.

e.g. I want to switch all external lights with on button.

I am IT expert and retired software developper.

Thanks , best regards

Alhard

 


regards, 

   Alhard,   FS-Pilot since 1980,

WIN7, FS9-FSX-P3Dv45, 3 PCs, 6 Monitors, IVAO, Helicopter, Airbus, VFR

Share this post


Link to post
Share on other sites
On 11/25/2018 at 12:25 AM, KL Oo said:

Thanks so much for your help Scott - Worked a treat. A world of options has opened up!!! I can pre setup my entire aircraft with one button press!

 

Hi Kael, could you please show me your coding.

Thanks


regards, 

   Alhard,   FS-Pilot since 1980,

WIN7, FS9-FSX-P3Dv45, 3 PCs, 6 Monitors, IVAO, Helicopter, Airbus, VFR

Share this post


Link to post
Share on other sites

@alihor first let me clarify a point. LINDA offers aircraft Modules to provides functions to control individual aircraft. For the FSLabs A3XX we have added a FSUIPC Mouse Macro (.MCRO) to define virtual cockpit (VC) buttons that we previously unaccessible by normal Lvars means. Each entry in the MCRO file refers to a single VC buttons and cannot be combined.

Most LINDA modules provide functions for individual actions (ie. Landing Lights) as well as combined functions to operate multiple actions. You can create and adapt any number of functions to suit your requirements. These should be placed in the user.lua file under the aircraft (/modules/linda/aircrafts/{your aircraft name}). I gave an example of the function structure in an earlier posting on this thread. Just give the function a unique name (case sensitive) and include the functions names you wish to be called in that function. When operating calling multiple switch activation functions it is advisable to include a Sleep call between each one (eg. _sleep(100) will give a 100ms or 1/10th sec delay between each). There are also plenty of examples LUA functions in the aircraft actions.lua. A search for LUA programming will provide the syntax and standard functions.

 

Edited by ScotFlieger

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, thanks for the clarification.

My main question is: when I program in user.lua my sequence, can I assign this function in LINDA joystick assignments. Will this function appear in the list of the macros you wrote fo FSL A3xx ?

As I programmed in the past a lot of LUA scripts, now I know how to solve my problem.

I will report when I succeeded.

Thanks

PS. why didnt I get an email notification?

 


regards, 

   Alhard,   FS-Pilot since 1980,

WIN7, FS9-FSX-P3Dv45, 3 PCs, 6 Monitors, IVAO, Helicopter, Airbus, VFR

Share this post


Link to post
Share on other sites

All functions created in user.lua can be assigned as normal using the sub-menu immediately under the aircraft’s menu entry. Any reference to a function supplied in the aircraft module will be able to run as if it were called separately. You also override any existing function name should you wish to replace that function.

PS. To help you test a function without first assigning it to a button you can simply right-click on the function’s name in the LINDA Editor. 

Edited by ScotFlieger

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

Hey Andrew, SUCCESS this little test code in user.lua works fine:

-- insert your code below here:
-- 200211 my code AH
    
function ALL_LT_ON ()
    ipc.sleep(20)
    VC_OVHD_EXTLT_Strobe_on ()
    ipc.sleep(20)
    VC_OVHD_EXTLT_Beacon_on ()
    ipc.sleep(20)        
end   

I assigned it to a button and the lights were ON.

thanks for your help, now I will improve this function.

 


regards, 

   Alhard,   FS-Pilot since 1980,

WIN7, FS9-FSX-P3Dv45, 3 PCs, 6 Monitors, IVAO, Helicopter, Airbus, VFR

Share this post


Link to post
Share on other sites

Hi Andrew, for the time beeing my last question:

How do you manage to click on the right button in my multi monitor environment and e.g. the overhead panel is undocked on a separate monitor ?

It's a miracle for me. Please explain, I would understand.

thanks


regards, 

   Alhard,   FS-Pilot since 1980,

WIN7, FS9-FSX-P3Dv45, 3 PCs, 6 Monitors, IVAO, Helicopter, Airbus, VFR

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.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    18%
    $4,710.00 of $25,000.00 Donate Now
×
×
  • Create New...