Jump to content
Sign in to follow this  
scottb613

FSW LEAR 35 - Al's FSUIPC LUA Scripts = More Button Controls

Recommended Posts

Hi Folks,

Note: Al - I'd suggest you sticky this due to huge benefit to community...

There are few things I despise more while flying - than dropping my HOTAS and having to reach for my mouse... 

Just a reminder - Al (our resident LUA genius) - created the absolute best LUA script that will allow you to assign far more controls than the default setup - in addition - this fixes some issues - like not seeing the spoiler move when viewing from outside...

I've got (6) rotary encoders on a button box that allows me to slew the HDG, CRS, and ALT bugs by spinning nobs instead of mouse clicks - way better...

The caveat - you MUST have the paid version of FSUIPC to utilize...

I don't think Al uploaded them anywhere - but he kindly distributes on PM request...

Made a huge difference for me while flying this fine bird...

Summary below - I added a couple to it - all of which can be assigned to hardware...

Regards,
Scott

 

  --     FUNCTION           Parameter (ipcPARAM) Value
   --Lear35SteerLock()               1	Toggles Lear35 Steer Lock On and Off
   --L35HdgBugSync()                 2	Aligns Heading Bug with current a/c heading
   --Lear35YawDamper()               3	Toggles Yaw Damper On and Off
   --L35LandLtsNight()               4	Toggles Lear35 Landing and Taxi Lights Switch; at night displays switch position on Green Bar
   --L35ReversersNight()             5	Toggles L35 Reversers on and off; at night displays switch position on Green Bar
   --L35_Altitude_Decrement()        6	Decrement altitude window setting by 1,000ft
   --L35_Altitude_Increment()        7	Increment altitude window setting by 1,000ft
   --Lear35GearHorn()                8	Toggles Lear35 Gear Horn "Test" Switch located next to Landing Gear lever
   --Lear35Spoilers()                9	Toggles Spoilers On and Off
   --Lear35Rec_Lts()                10	Toggles Recognition lights On and Off
   --Lear35StopWatch()              11	3-way toggle of the panel 'stop watch'
   --Lear35Go_Around()              12	L35 Go-Around button
   --Lear35Air_IgnSw()              13	Toggles Both Lear35 Air Ignition Switches On and Off
   --L35EngStart()                  14	Lear35A Engine Start sequence, select Control Panel Ready to Start first
   --L35ThrottleStart()             15	Sets Lear35 Throttles into Detent Position for Starting
   --L35CabinAltHorn()              16	Toggles Lear35 Gear Horn "Silence" Switch
   --Lear35Land_Lts()               17	Toggles Lear35 Landing and Taxi Lights Switch; no switch position Green Bar display at night
   --Lear35Reversers()              18	Toggles L35 Reversers on and off; no switch position Green Bar display at night
   --Lear35FuelCmptrSw()            19	Toggles Both Lear35 Fuel Computer Switches On and Off
   --Lear35LeftFuelCmptrSw()        20	Toggles Lear35 Left Fuel Computer Switch On and Off
   --Lear35RightFuelCmptrSw()       21	Toggles Lear35 Right Fuel Computer Switch On and Off
   --Lear35LeftAir_IgnSw()          22	Toggles Lear35 Left air ignition switch on and off
   --Lear35RightAir_IgnSw()         23	Toggles Lear35 Right air ignition switch on and off
   --Lear35AutoPilot_Sw()           24	Toggles Lear35 Autopilot switch on and off
   --Lear35RadioAlt_Sw()            25	Toggles Lear35 Radio Altimeter switch on and off
   --L35_Altitude_Decrement_10()    26	Decrement altitude window setting by 10,000ft
   --L35_Altitude_Increment_10()    27	Increment altitude window setting by 10,000ft

 

Edited by scottb613

imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites

Thanks for the heads up Scott,  I am currently using the key assignments from the Lear owner's manual (G1000 MFD and PFD Soft Keys) for many functions like Yaw, Steer Lock, Spoiler etc.  The 2 functions that I would love the most are Landing and Taxi lights ON/OFF. I have no knowledge of how to use LUA scripts, but I do own FSUIPC (paid).  Can you link me to a HOW TO for getting these 2 functions set up on a joystick button ?  Thanks 🙂


 
Quote

850237

WAT1460.png

Share this post


Link to post
Share on other sites
2 minutes ago, vcarlo said:

Thanks for the heads up Scott,  I am currently using the key assignments from the Lear owner's manual (G1000 MFD and PFD Soft Keys) for many functions like Yaw, Steer Lock, Spoiler etc.  The 2 functions that I would love the most are Landing and Taxi lights ON/OFF. I have no knowledge of how to use LUA scripts, but I do own FSUIPC (paid).  Can you link me to a HOW TO for getting these 2 functions set up on a joystick button ?  Thanks 🙂

For me too please Scott. 


UK P3DV5 and Xplane 11 Simmer
PilotEdge I11, CAT11, A-Z (ZLA), A-Z (WUS)

System details: Gigabyte P57v7 CF2 17.3" laptop. Kaby Lake i7 7700HQ CPU (averaging 3.4mhz). NVIDIA GeForce GTX 1070 8mb (laptop version), 16 GB of DDR4-2400 RAM, SSD - Samsung 970 Evo  500GB M.2 NVMe, 1TB HDD 7200.

Share this post


Link to post
Share on other sites

Hi Scott, is there somewhere we can download the scripts? Also I have Al instructions from a previous post I can post if you don't have them, thanks!

Cheers

Martin

Share this post


Link to post
Share on other sites

Hi Folks,

We'll need to see how Al wants to distribute it - in the past it was merely a PM to Al with your email address...

It's pretty easy to setup - personally - I use FSUIPC for all my assignments - so being familiar with assigning joystick buttons in FSUIPC would be helpful... It's a good idea to delete the corresponding controls for your hardware in your actual sim settings first to avoid conflicts...

Copy Al's LUA script into the "Modules" directory in the sim - where FSUIPC is installed...

Then You can assign them to "key presses" or "buttons/switches" via the FSUIPC interface... Since the Lear is unique - it's a good idea to check the box for "Profile Specific" - it will prompt you to type an identifier the first time you use it... Make sure this box is checked from here on out when changing the Lear specific assignments...

Go to FSUIPC and select the Buttons/Switches tab - click a button on your hardware you wish to assign...

Check "Profile Specific"...

Check "Select for FS Control"...

If you have Al's script in the correct location - scroll down the "Control Sent" dialog drop down (cheat: just use the little down arrow to open the window and then type "Lua" it should take you right to it) until you find "Lua LUA Lear35" - this is used for ALL the assignments I listed above... Note there are a bunch of similarly named items - make sure you pick the first one which is exactly as displayed...

Then put a "1" in the "Parameter" field... That's it - checking my list above "1" corresponds to the "Steering Lock" which you've just assigned - hit OK to save - or another button to assign the next one... Everything stays the same except the "Parameter" which corresponds to the desired function listed above...

Hope this helps...

Regards,
Scott

 

9rn9rt.jpg

 

Edited by scottb613
  • Like 1

imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites
36 minutes ago, vcarlo said:

Thanks for the heads up Scott,  I am currently using the key assignments from the Lear owner's manual (G1000 MFD and PFD Soft Keys) for many functions like Yaw, Steer Lock, Spoiler etc.  The 2 functions that I would love the most are Landing and Taxi lights ON/OFF. I have no knowledge of how to use LUA scripts, but I do own FSUIPC (paid).  Can you link me to a HOW TO for getting these 2 functions set up on a joystick button ?  Thanks 🙂

Hi...

Taxi Lights are a default function and you can do that without LUA... Rec and Landings require LUA...

Regards,
Scott


imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites
11 minutes ago, MartinRex007 said:

Hi Scott, is there somewhere we can download the scripts? Also I have Al instructions from a previous post I can post if you don't have them, thanks!

Cheers

Martin

Hi Martin,

The latest version I have from Al consolidated everything into a single script - much easier to manage...

Regards,
Scott


imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites
7 minutes ago, scottb613 said:

Hi...

Taxi Lights are a default function and you can do that without LUA... Rec and Landings require LUA...

Regards,
Scott

Very odd ???  In my system the RECOG works fine with CTL + R, but TAXI and LAND will not work with any assignments ....hmmm


 
Quote

850237

WAT1460.png

Share this post


Link to post
Share on other sites

Hi...

Here are my Nav and Rec lights respectively - they are assigned to latching toggles - hence the "released" condition is needed in my particular setup:

16hqi5j.jpg

e5qqfc.jpg

Regards,

Scott

 

Edited by scottb613

imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites
9 minutes ago, vcarlo said:

Very odd ???  In my system the RECOG works fine with CTL + R, but TAXI and LAND will not work with any assignments ....hmmm

Quote


imageproxy.png.c7210bb70e999d98cfd3e77d7

Share this post


Link to post
Share on other sites

Hi Folks,

For those that just want a script to operate the Lear's Landing and Taxi light switches, the small script below should do it. In operation, each key or button push will move the light switches "one place" at a time in a round-robin (3-way toggle) fashion (Off - Taxi - Landing - Off, etc).Type, or copy and paste, the below into a text editor like Notepad or Notepad++ and save it as L35Lndg&TaxiLts.lua to your sims Modules folder. You can then use FSUIPC to assign either a key or button to activate the script. For example, to assign the Shift+L key combination open the FSUIPC Key Presses tab, click the Set button and push the Shift and L keys on your keyboard, then from the dropdown list select Lua L35Lndg&TaxiLts, check the No Repeats! box, click Confirm and then OK. It should look like this:

a206f09b96.JPG

 

You may need to restart the sim for everything to take effect.

There are couple of things to be are careful about:

1. If you want to rename the script, note Lua script names can have a max of 16 characters to the left of the .lua.

2. In the drop down list beside Lua L35Lndg&TaxiLts.lua you will see other options that start with LuaKill, LuaToggle, Lua Set, etc. You want the 'plain' Lua option as shown in the picture above.

Here's the script. Note  --  signifies a comment.

-- L35Lndg&TaxiLts.lua
-- Using FSUIPC, assign key or button to cycle L35A light switch between Off, Taxi Lights and Landing Lights (3-way toggle).

   land_taxi_lts_switch=ipc.readLvar("L:TAXI_LAND")   --get current light switch value:-1=off, 0=taxi lights, 1=landing lights
   if land_taxi_lts_switch==nil or (land_taxi_lts_switch~=-1 and land_taxi_lts_switch ~= 0 and land_taxi_lts_switch~= 1) then   
      ipc.writeLvar("L:TAXI_LAND",-1)                   --lights off                  --
   elseif land_taxi_lts_switch== -1 then             
      ipc.writeLvar("L:TAXI_LAND",0)                    -- turn taxi lights on
      ipc.writeLvar("L:XMLSND70",1)                    --switch sound
   elseif land_taxi_lts_switch==0 then             
      ipc.writeLvar("L:TAXI_LAND",1)                   --turn landing lights on
      ipc.writeLvar("L:XMLSND70",1)                    --switch sound
    elseif land_taxi_lts_switch==1 then             
      ipc.writeLvar("L:TAXI_LAND",-1)                  --all lights off    
      ipc.writeLvar("L:XMLSND70",1)                    --switch sound
   end
  return

If you have any problems let me know.

Al

Edited by ark
  • Upvote 1

Share this post


Link to post
Share on other sites

Since the Lua script topic has come up, I thought I mention a couple of things.

In the AVSIM library there a number of Lua scripts including Approach Callouts and HUD Parameters that may be of some interest. These scripts should work with most a/c.  Below are the Library descriptions.

Approach CallOuts consists of two Lua scripts and a sound folder with wav files that work together to provide altitude, gear and flap settings, and approach minimums (Decision Height) audio callouts on an approach to landing. The callouts are at Radio Altimeter (RA) heights of 2000, 1000, 500, 400, 300, 200, 100, 50, 40, 30, 20, and 10 ft. At 800ft RA (a user settable value) you get a callout of current flap and gear positions. There is no gear callout if the aircraft has a fixed gear. The minimums callout may be based on a RA or BARO (MSL) altitude. A registered (payware) copy of FSUIPC is required to execute the Lua scripts.

Note: While the documentation that comes with this library download is valid, I do have an updated script that better accommodates P3Dv4 display window limitations.  So if interested I'll be glad to send you the updated script.

One might argue the Approach Callout script provides some callouts you might get from a co-pilot.  😉

HUD_Parameters is a Lua script that displays flight parameters in a small text window that pops up when the script is selected by an assigned key or button if the aircraft is in the air. Parameters displayed are: • Indicated Airspeed (IAS. Kts) • True Airspeed (TAS, Kts) • Ground Speed (GS, Kts) • Mach# (when above a user settable altitude, currently 25000ft) • Altitude (ALT, ft) • Radio Altitude (RA, ft) • Vertical Speed (VS, ft/min) • Vertical Speed per Nautical Mile (VS/NM, ft/NM) • Attitude Indicator pitch (AI, degrees) • Flight Path Angle (FPA, degrees) The top of the script contains user settable values for the size and location of the display, the altitude above which the a/c Mach# will be displayed (default is 25000ft), the data update interval in milliseconds (default is 2000), and whether or not data is to be logged in HUD_Parameters.log (default is 0, off). These values can be set using a text editor like NotePad. A registered copy of FSUIPC is required to execute the Lua script. Simply copy the script to the Modules folder of FSX and use FSUIPC4 to assign a key, button or switch to toggle the script on and off. The script turns off if the aircraft is on the ground.

 

22490613c7.jpg

 

The Lear35 Controls script that Scott mentioned has now expanded to 36 functions. I certainly don't use them all but some have been included at the request of others. One of the newer functions is a "Center CDI" function which when activated in VLOC mode will point the HSI course arrow directly at a tuned in VOR which centers the CDI. You then instantly know the course to the VOR as well as what radial you are on as indicated by the tail of the course arrow. Our resident L35 pilot Joe tells me he has this feature, along with Heading Bug Sync, in his Lears.

Al

 

 

 

Edited by ark

Share this post


Link to post
Share on other sites

Hi Al,

 

Do I just copy and past this into a text file and rename as .lua ? I'm fairly new to LUA scripts- but with the lear's strange "non-default" way of assigning buttons I think its necessary to learn. 


Brendan R, KDXR PHNL KJFK

Type rated: SF34 / DH8 (Q400) / DC9 717 MD-88/ B767 (CFI/II/MEI/ATP)

Majestic Software Q400 Beta Team / Pilot Consultant / Twitter @violinvelocity

Share this post


Link to post
Share on other sites
8 minutes ago, bjratchf said:

Hi Al,

 

Do I just copy and past this into a text file and rename as .lua ? I'm fairly new to LUA scripts- but with the lear's strange "non-default" way of assigning buttons I think its necessary to learn. 

Hi Brendan,

If you are talking about the landing light script above, the answer to your question is "yes".

Al

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...