Luamacros for FS2020

Announcements, questions
tomrach
Posts: 12
Joined: 07 Mar 2020, 19:26

Luamacros for FS2020

Post by tomrach » 06 Oct 2020, 10:55

Hello Peter. Will you be working on the luamacros version for FS2020? The SDK is already available so we could try assigning commands to a second keyboard. Greetings.

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Luamacros for FS2020

Post by admin » 07 Oct 2020, 08:34

:-)
Sure I expected this question...

I already had a look into SDK but seemed to be not completed yet - especially the SimConnect part. I may give it another try.
It would be little bit more complicated that FSX SimConnect connector in HidMacros but I'm not saying its impossible.

Anyway I'm focused to Zibo Mod in Xpl-11 these days so not sure when I start FS2020 :-)
Petr Medek
LUAmacros author

tomrach
Posts: 12
Joined: 07 Mar 2020, 19:26

Re: Luamacros for FS2020

Post by tomrach » 07 Oct 2020, 08:52

So we wait :D

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Luamacros for FS2020

Post by admin » 19 Oct 2020, 22:54

Starting slowly but seems that FS2020 could be supported.
Find experimental build here https://github.com/me2d13/luamacros/rel ... poc-events, just download the zip file and run exe.

You should be able to send SimConnect events with code like

Code: Select all

lmc_fs_event('LANDING_LIGHTS_TOGGLE')
lmc_fs_event('NAV1_STBY_SET', 0x11480)
So even parameters are supported. Event list and their support in FS2020 can be found in FS SDK.

Some quickstart lua script is here: https://github.com/me2d13/luamacros/blo ... s/fsxx.lua assigning landing lights to L key and tuning sample frequency at NAV1 to N key.

Some notes & limitations
  • only events are supported, vars can come later
  • I had to switch luamacros in this build to pure 64bit application but I have problems with DirectX and game devices. So you can't read & use joysticks in this release. I mean to interact with luamacros, joystick in game is working
  • I haven't tested Xplane support in this 64bit build and even didn't include plugin into the zip file. This is fsxx test build only
Petr Medek
LUAmacros author

tomrach
Posts: 12
Joined: 07 Mar 2020, 19:26

Re: Luamacros for FS2020

Post by tomrach » 21 Oct 2020, 10:27

THANK YOU VERY MUCH!!! I will be testing. Keep developing it, Peter. Thanks. :D

BradyBrother100
Posts: 13
Joined: 03 May 2019, 01:17

Re: Luamacros for FS2020

Post by BradyBrother100 » 22 Oct 2020, 00:31

D:\MSFS SDK\Documentation\03-Content_Configuration\Variable_Lists
There should be some PDFs that have all of the Events.
Hope this helps!
Brady

eliz
Posts: 1
Joined: 10 Oct 2022, 05:35

Re: Luamacros for FS2020

Post by eliz » 10 Oct 2022, 05:50

Hi,
Why the msfs lmc version, about game devices in Microsoft OS,
lmc_print_devices()
lmc_set_axis_handler()
are not the same as in x-plan version?
I think it is not related to msfs, it is related to Microsoft and DX.
In other words, can you compile a version with the ability to read axis? even if write to msfs axis will not be possible.

Thanks.

Eli

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Luamacros for FS2020

Post by admin » 10 Oct 2022, 07:55

As I wrote in the post:
admin wrote:
19 Oct 2020, 22:54
  • I had to switch luamacros in this build to pure 64bit application but I have problems with DirectX and game devices. So you can't read & use joysticks in this release. I mean to interact with luamacros, joystick in game is working
Till now I didn't find a way make game controllers working in 64bit build :-(
Petr Medek
LUAmacros author

postavka
Posts: 2
Joined: 16 Jan 2023, 07:51

Re: Luamacros for FS2020

Post by postavka » 16 Jan 2023, 08:01

Hello, all I will use this post to ask. I used to use luamacros in x-plane with second keyboard. I created lua files for 6 of my planes. All works fine. Here in MSFS2020 I took the sample code from this post, added the ID of my keyboard like I do in the script used in xp11

Code: Select all

lmc_assign_keyboard('MACROS',"ID_2005"); 
it sends the "event" to MSFS when I press the button on second KB, but also triggers the shortcut for that key that is set in MSFS. For example if I set F3 button for

Code: Select all

lmc_fs_event('SPOILERS_ARM_TOGGLE')
the spolers are armed but also the throttles are increasing. In xp11 it somehow disabled all shortcuts on second keyboard. Is there a way to do that in MSFS? Thnaks and keep the good work!

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Luamacros for FS2020

Post by admin » 16 Jan 2023, 09:03

Probably not, you can read some background here https://github.com/me2d13/luamacros/wik ... ot-blocked
Petr Medek
LUAmacros author

Post Reply