What is LUA? Does it work in FSX also?

Heretic

Resource contributor
FSUIPC features Lua support (as LINDA) for FSX and P3D, but it's almost exclusively used to provide a bridge between input hardware (HOTAS system) and the simulator.
Not sure how much can be done beyond that though.
 
Hi Bill,

Yeah - it's pretty handy for the end user as it gives us control of buttons and switches in the cockpit - that were unavailable by other means... You can also program macros to complete multiple tasks as well... For me - there are few things more annoying than having to drop my HOTAS to grab my mouse to operate a switch or knob...

While I did not write this - here is an example of the functions someone in the user community wrote for the FSW Lear... In FSUIPC you simply call this single LUA script and vary the parameter for the function desired when assigning to your HOTAS or key stroke... It certainly opens doors that were closed to us in the past...

Code:
  --     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
Regards,
Scott
 
Interesting...

And this works in FSX also?

Thanks Roy, I'll check that. I do remember now that being in the SDK.

I wonder if one can do a VTOL file using LUA. I wanted to try doing one in C++ and found out how ultra sophisticated doing C++ was.
 

JB3DG

Resource contributor
P3D only. I use it mainly for material scripts that allow dynamic material stuff.
 

n4gix

Resource contributor
Bill, pay particular attention to how you can illuminate stuff dynamically using Lua material scripts: from zero to full brightness... :cool:
 
I use Lua scripts extensively to 'automate' some functions, to display a message window for a few seconds
when I select a different 'mode' for my controller assignments showing the new assignments for the
10 switches on my dual throttle quadrants. Some of my aircraft assignments have up to 13 'modes', each
with 10 control maps (or 20 using pinky-switch conditional mapping). Far too many to remember :)

Some time ago I decided to create some Lua scripts targeted for the A2A Simulations L-049 Constellation.
The scripts I call the 'Virtual Flight Engineer eXtension' perform a pre-flight of the aircraft, engine starts,
and then allow the user to select 'Take Off Power', 'Climb Power' and 'Cruise Power' settings in Manifold
Pressure or BMEP. All under control of the VFEX. Cabin pressurization and Super Charger engage/disengage
functions as well. Minimal user input required but the ability to disco the VFEX and take control at
any time. These scripted functions co-exist with the A2A L-049 virtual FE which only controls a few
functions automatically.

I use the Lua display function to display the current states of elevator, rudder and aileron trim settings
as each is changed. Helpful when you have both hands full controlling a take off or landing and need to
keep your eyes OUT of the cockpit :)
The Lua display of the current value of L:Variables or offsets can help in debugging code as well.
I find the FSUIPC4 / Lua combination to be indispensable to my simulation experience.

Paul
 

tgibson

Resource contributor
Nice idea for those aircraft with lots of systems modeling that was normally handled by another crew member.
 

Heretic

Resource contributor
Lua is great. From what I know, it's also a good stepping stone toward proper programming in C.

The only thing I'm sometimes missing compared to FSX' XML is direct stack manipulation.
 
I use Lua scripts extensively to 'automate' some functions, to display a message window for a few seconds
when I select a different 'mode' for my controller assignments showing the new assignments for the
10 switches on my dual throttle quadrants. Some of my aircraft assignments have up to 13 'modes', each
with 10 control maps (or 20 using pinky-switch conditional mapping). Far too many to remember :)

Some time ago I decided to create some Lua scripts targeted for the A2A Simulations L-049 Constellation.
The scripts I call the 'Virtual Flight Engineer eXtension' perform a pre-flight of the aircraft, engine starts,
and then allow the user to select 'Take Off Power', 'Climb Power' and 'Cruise Power' settings in Manifold
Pressure or BMEP. All under control of the VFEX. Cabin pressurization and Super Charger engage/disengage
functions as well. Minimal user input required but the ability to disco the VFEX and take control at
any time. These scripted functions co-exist with the A2A L-049 virtual FE which only controls a few
functions automatically.

I use the Lua display function to display the current states of elevator, rudder and aileron trim settings
as each is changed. Helpful when you have both hands full controlling a take off or landing and need to
keep your eyes OUT of the cockpit :)
The Lua display of the current value of L:Variables or offsets can help in debugging code as well.
I find the FSUIPC4 / Lua combination to be indispensable to my simulation experience.

Paul

Many thanks Paul for that input. I would love to have that capability.
 
Top