MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
juankster96
Posts: 1
Hello everyone,

I am currently building a home cockpit with a friend who's a pilot. I'm not a pilot so all of the terminology has been very new to me. So far I have been able to do great and I'm almost done but I've encountered a very frustrating issue I haven't been able to resolve. I am working with XPlane 11 simulator and we are building a King Air C90B cockpit.

I am using a few rotary encoders as inputs for the COMM, NAV1, ADF, Transponder, altitude, etc. and what I do is I send a keyboard shortcut (e.g. ctrl+alt+m) to the simulator and it works for all of the radios. The problem comes when I do the same for Heading, Course, Decision height and Barometer (which I think are all autopilot). The encoder seems to send the keyboard shortcut but nothing happens on the simulator, however, when I press the shortcut with my keyboard I can see the change I want (the heading increases or decreases, etc.).

Now, I managed to do a workaround for the Heading by using FSUIPC - Offset option (I found the offset is 0x07CC on the XPUIC file that comes with the plugin) and it kinda works, it's a little bit not as great as a keyboard shortcut but I haven't been able to do the same for the other ones (course, DH and Baro) because there is no offset value for those ones on the file, for some reason.

The only other option I think could work in this case would be a Lua Macro, however I have no idea about them, I've searched examples but I think what I need is pretty simple and the examples I find are quite complex. I don't know how to go about it, where I would store the Lua macro file. I kinda understand that I have to call the file name on Mobiflight from other forum messages. So I was wondering if maybe you guys could help me with a simple Lua Macro script to say, increase the DH or the course.

Now, I know from my simulator that the dataref I need to change are "sim/radios/obs1_up" and "sim/radios/obs1_down" for course, "sim/instruments/dh_ref_up" and "sim/instruments/dh_ref_down" for DH, and "sim/instruments/barometer_up" and "sim/instruments/barometer_down" for barometer, but what I don't know is how I can trigger them with a Lua Macro on mobiflight.

If someone could help me build a script for that or give me a few instructions on how to do it I would be really really thankful!
2022-03-07 04:29
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
At first to the keys....

Some elements are working strange. So there can be a problem we not be able to solve with the keys.
BUT you can make some testings. Maybe you can solve the problem directly.

1. Try ADMIN Mode ( For MF and Sim) In the past we have some situations where specially "Key send" struggle without Admin rights !

2. Change the Keys. Specially Combinations like Shift+X or Shift+Strg+X can be problematic in case there is a hudge difference if we press them by hand on a keyboard or by a emulator like MF .... Some Programms require a sequence.... Other require a simultan press.
So try just for testing to use just "h" for example instead of STRG+h . Maybe you see the critical fact by this testing.


About LUA..... In XPLANE there is no LUA Macro/Code. This is for FSUIPC ( FSX/P3D) only. XPUIPC use its own coding ( Not LuaMAcro).
As you expect.... It is possible to add new Things within the XPUIPC Config File.
If you know the needed DataRefs you can insert thre some lines of Code to set these Stuff on Free Offsets.
Here best way for help is joinig our Discord and talk to rthe Xplane Guys! they can help you with the code !


Last Alternate: Joystick Controllers!
Can you set the needed Elements in Xplane Settings to Joystick Buttons ?
If Yes.... Then the most easy way would be to not use Mobilfiight. Then simply use a LeoBodnar or a simmular Controller and send your Inputs direct as Joystick Buttons.
(MF also support VJOY..... But its currently bugged and will be available hopefully again in the next Version in some months ! )
Good Luck !
2022-03-07 13:49
icon