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! 

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
slammer88
From: LTBJ, Turkey
Posts: 147
Hey all.

I've been into Aerosoft's DHC-6 Twotter recently and Just curious about some things.

With the 7.5.0, we can use/trigger Lua scripts within Mobiflight.

* How exactly shall i do that ?
* Where should i place the script files ?
* Should i create 10 different script files for each function or can i merge them into one ?
* Is there any source i can find the Lvar's of DHC-6 ? I've been able to find the LINDA profile and thinking about getting the necessary ones from it.
2018-08-24 13:35
Avatar
paul_max
From: United Kingdom
Posts: 70
Supporter
You can only fire Lua scripts from FSUIPC or its add-ins. MobiFlight can't do it, unless you can trigger FSUIPC from MF.

Thinking outside the box USBKEYS from OpenCockpits can fire 88 keyboard characters via USB from push buttons, but without auto repeat.
So important push button commands could trigger Lua scripts in FSUIPC that way. Other USB keyboard/joystick devices could be used.

With 2 diodes you could link the push buttons simultaneously to USBKEYS and a MF Arduino. However there is no guarantee which hardware would fire first in the simulator.

Hope that helps
Paul
2018-08-24 20:17
Avatar
slammer88
From: LTBJ, Turkey
Posts: 147
iconpaul_max:

You can only fire Lua scripts from FSUIPC or its add-ins. MobiFlight can't do it, unless you can trigger FSUIPC from MF.

Thinking outside the box USBKEYS from OpenCockpits can fire 88 keyboard characters via USB from push buttons, but without auto repeat.
So important push button commands could trigger Lua scripts in FSUIPC that way. Other USB keyboard/joystick devices could be used.

With 2 diodes you could link the push buttons simultaneously to USBKEYS and a MF Arduino. However there is no guarantee which hardware would fire first in the simulator.

Hope that helps
Paul



I'm aware of it by triggering the LUA's externally via FSUIPC with a key macro, but with 7.5.0 there's a new function in MobiFlight called Lua Scripts as input and thought that it's there to ease this process, isn't it?
2018-08-25 08:39
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2949
Supporter
YES it is.

But sorry.... I Don´t know how.

I did a testrun before i get in Holliday. But no success. So i stop on it and request at Sebastian for a Guide.
He means the programmer will write it and support it here in Forum.

No response till now.....

Please try out this tool. If you understand it then tell us how it work. Maby i find time next weeks to do it myself !
Good Luck !
2018-08-25 12:42
Avatar
paul_max
From: United Kingdom
Posts: 70
Supporter
Pizman

Thanks for correcting me. It sounds like an exciting new feature in 7.5. I look forward to learning about it.

Paul
2018-08-26 00:03
Avatar
slammer88
From: LTBJ, Turkey
Posts: 147
iconpizman82:

YES it is.

But sorry.... I Don´t know how.

I did a testrun before i get in Holliday. But no success. So i stop on it and request at Sebastian for a Guide.
He means the programmer will write it and support it here in Forum.

No response till now.....

Please try out this tool. If you understand it then tell us how it work. Maby i find time next weeks to do it myself !



Thanks for answer pizman, please let me know when it's available!

Grüss
2018-08-26 10:09
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2949
Supporter
iconslammer88:


Thanks for answer pizman, please let me know when it's available!
Grüss



It is still available !

Pretty shure you have current release Version 7.5 !

You can Create a INPUT (Button for example) and use in the Dropdown simply LUA MACRO (Instead of FSUIPC Offset , EventID or so)

There is a Field with "Name" and a field with "Value"

As i said... I not understand it till now....
Where must the macro be located ( FSUIPC Folder ?? )
Whats the Syntax for "Name" field .... NAME or NAME.LUA or c:/blabla/name.lua ???
What is the Value Field good for ??
Where do we execute the needed Command like Luarun (to startup a macro) or Luakill ( to stop it if needed ) ..... Maby The Value is the key... so For example Value 1 means RUN Value 0 menas KILL etc.

If you guys got time please check this out !
Good Luck !
2018-08-26 14:44
Avatar
bennnozgurum
Posts: 30
I have checked nearly all the combinations with lua functions as you said my friend (pizman) but non of them worked... Waiting a tutorial for it... :)
2018-08-27 13:04
Avatar
gunterat
Posts: 32
Supporter
Did anybody find out how to use this function? Or even a tutorial?
I am trying to make the new Aerosoft-Airbus working with my Homecockpit and I think this function could be useful!
thank you and best regards
Guenter
2018-09-15 10:59
Avatar
slammer88
From: LTBJ, Turkey
Posts: 147
Still waiting for a tutorial :)
2018-09-15 22:49
Avatar
StephanHo
From: EDDG, Germany
Posts: 1396
Supporter
Hi guys,

stay tuned, a tutorial is in progress. If it is available it will be published here at once.
Grüße,
Stephan
2018-09-15 23:45
Avatar
kuroneko
Posts: 1
With respect to Lua/macro support, you must have FSUIPC and you should have already made sure that your script or macro works.

Please refer to the "FSUIPC Lua Plug-ins" manual for information about Lua Scripting, or the "FSUIPC4 for advacned users" manual for information about Macros. Both of these are installed when you install FSUIPC4, and presumably have equivalent documentation with FSUIPC5.

If you're trying to use a Macro, the macro/script name should just be the name of the macro file without the .MCRO extension, up to 16 characters, then a colon ( : ), then the macro name within that file.

If you're trying to use a Lua script, the script name should be one of:
  • Lua
  • LuaDebug
  • LuaKill
  • LuaSet
  • LuaClear
  • LuaToggle


Followed by a space, and then the name of the lua script (without the .lua file extension).

The parameter value is fed into the macro or script.

This functionality was written specifically to interface with SuperScript for the VRS FA-18 SuperBug and with the Aerosoft F14X - both of which are/come-with fully-fledged Lua scripts for interfacing with the aircraft. I've not tested Macro support or other scripts explicitly, but there's no reason why they shouldn't work given that they all use the general mechanism in the same way.

The function specifically uses FSUIPC offsets 0x0D6C and 0x0D70. (More information about that can be found in the FSUIPC for Programmers manual which is part of the FSUIPC SDK).
2018-09-18 11:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2949
Supporter
Hi Kuroneko.

If You are the nice guy who create this new feature at first i will say THANK YOU !
This is a verry important feature for Mobiflight ! I think this is the "bypass" we still need to make advanced Homecockpits basicly possible!
And all Users with non FSUIPC compatible AddOns like Aerosoft will tribute you a lot !

So.... Thanks again for this posting. THAT was the missing syntax i not could figure out myself... I think NOW it should be possible for all advanced Users to make this working
I will check it myself as soon as possible!
Good Luck !
2018-09-18 16:58
Avatar
bennnozgurum
Posts: 30
Dear Pizman82,

I have managed it to work my friend. Thank you very much kuroneko, you saved my days... :)

If you ask me how I did it, I have tried what Kuroneko said... However I will try to be more clear with examples.

You know I am trying to build 757 cockpit and also I have finished with my MCP. Before this lua function of Mobiflight. I have used Key function. For example I programmed arduino pin 2 as CTRL+ALT+1 and I programmed it using FSUIPC and LUA...

Our issue is using the Lua function make the function (in our LUA script file) work directly with Mobiflight.

1) My macro file name is : "757200.MCRO"
2) Some of the lua scripts that I wrote inside it (757200.MCRO file under Modules driectory of my sim FSX):
1=L:hdg_sel_clicked=toggle
2=L:vs_clicked=toggle
3=L:alt_clicked=toggle
4=L:app_clicked=toggle
3) The phrase we have to write to function correctly is:
Macro Name: 757200:L:vs_clicked
Value: 1

"757200" is my macro name without .MCRO and the colon ":" after the colon, without blank, your Lua script "L:vs_clicked".

Be careful the name of lua script inside the .MCRO file is " 2=L:vs_clicked=toggle" but we have to write only "L:vs_clicked" without "2=" and "=toggle" because it won't work... This was what I have done wrong :)

Thanks kuroneko without your instruction, it will be impossible for me to make it work...

I love this community and Mobiflight. I hope my instruction is clear :)
2018-09-28 12:56
Avatar
gunterat
Posts: 32
Supporter
Hello,
thanks to kuroneko for this new Mobiflight function and thank you to bennnozgurum for the clear instruction. Now the inputs are working well! It would be fine to have an equivalent function for outputs.
In the moment I try to create the output "APU Master Switch" within Aerosoft Airbus Pro: The name of the LVar is "AB_OVH_APU_MASTER". The Lvarlist shows: "read/write" und "1 = on, 0 = off".

Okay, now I press the button APU Master, the status goes to "1". But the button has 2 LED' s - one for "FAULT" and one for "ON". How can I get these 2 different states and write them into the offset 66C5. Do I need additional parameters?
Maybe someone has already configured the AS Airbus and can give me a script example!
Every help is more than welcome!
Best regards
Guenter
2018-12-15 13:38
Go to page 1Go to page 012Go to page 2Go to page 2