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
wif
From: Austria
Posts: 20
Hello

I'm trying to set the altitude with the ALT preselector in 1000 ft steps higher or less. It's an Carenado CJ2 aircraft on a FSX:SE Sim, and Carenado is very tricky. I asked their support for help, but they told me, thats not possible, because its too complex and they have their own thing. The FSUIPC logger tells me, if I set the altitude with the mouse, it starts 6 event-IDs at the same time to set the desired altitude. I tried all with Mobiflight, but no luck. With Linda tracer I found a Lvar "L:CUSTOM_AP_ALT_VAR_SET_ENGLISH" to operate the ALT value. I made a lua macro with it. At Mobiflight in the macro settings at the value window, I wrote 1000 in it. Then I do one click with the encoder to fire the macro, I get 1000 on the PC monitor. More clicks nothing, no action - the value stays as it is, just 1000. If I write e.g. 5000 in the value window and I do one click, I get 5000 on the monitor, but nothing more.
On Hubhop by Mobiflight at the presets for the FSMS 2020 there is one for the Carenado M20R. It says this: (L:CUSTOM_AP_ALT_VAR_SET_ENGLISH, feet) (L:CUSTOM_AP_ALT_VAR_SET_ENGLISH, feet) 1000 + (>L:CUSTOM_AP_ALT_VAR_SET_ENGLISH). Maybe this could help. But unfortunately I have no idea, how to manage this. Maybe someone could give me a little help. Thanks in advance

Best regards
Franz
2022-11-27 18:27
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

You mix up 2 Sims.

HubHop is fully based on FS2020 and our direct Sim Connect Interface...... So there we no longer work with FSUIPC anymore.


Your FSX is different. HEre we have no access with Mobiflight to Simconnect itself. The only interface there is FSUIPC.
So as you find out.... The only way to controll the Aircraft is the way FSUIPC allow us to do.

If there exist no event (as the guys tell you) your again on the right idea.... Then a Lua Code is the final last chance.
Maybe not by sending events.... Often those aircrafts have "LVars" you can handle with Lua Code ( simmular to the way we work in FS2020)
But pretty sure not with the same code you quoted.... Cause this is RPN Code for WASM Modules in FS2020 only !

If there is a Advanced user here ( i don´t think so) he will awnser.....
Better is to join our Discord.... But also there the number of FSX users is meanwhile <5% .
So... Try it maybe in puplic Cockpitbuilder Forums or in the Forums of the AddOn.
Good Luck !
2022-11-28 01:10
Avatar
wif
From: Austria
Posts: 20
Hi Pizman,

thanks for your prompt answer.
I guess I have to learn the LUA coding. My thinking goes in that direction. First read the current ALT value from the SIM and put it into an Offset, add or subtract 1000 ft with each click and send that new value back to the SIM. I hope I learn this. We'll see.

Thanks again
Best regards Franz
2022-11-28 09:16
Avatar
wif
From: Austria
Posts: 20
Hi Pizman,

I checked the Post Nr. 17813 you wrote this:
Hi

Das wird auf dem Weg kompliziert bzw. unmöglich.

Was du verwendest ist ein SET Event.... Sprich der Parameter ist der Wert den du schreiben willst. Im genesatz dazu funktionieren Toggle und Increase/Decrease Events OHNE echten parameter da sie ja einfach ihre Aufgabe einmal ausführen..... ein SET Event aber einen spezifichen Wert sendet.

Was kein Problem wäre, ist einen gezielten Wert zu senden..... Verwende als Parameter z.b. 1000 dann pasiert was..... Immer wenn du die Taste drückst sendet er jetzt 1000 und setzt den Wert immer gleich..... ABER Das willst du ja nicht.

Was du brauchst wäre eine Funktion die sagt " Lies aktuellen Wert .... Addidere z.b. 10 ..... und schreib das Ergebnis als Parameter in das Event.
ABER Das geht nicht..... Sowas ähnliches hat Sebastian als Datapipe für Jeehell gemacht..... Aber da das sonst bisher niemand brauchte ist das nicht frei programmierbar.

LÖSUNG:

Aktuell bleibt dir nur ein anderes Event zu finden bzw einen Lua Script zu schreiben der genau macht was ich oben meinte (Wie die Datapipe)
Alternative wäre das arbeiten mit Key und Joystick Buttons ! ( Beste Lösung falls das A2A erlaubt)

Für die Zukunft könnte man überlegen das "Placeholder Tool" auch auf die Inputs anzuwenden..... Und auch das man im EventID Parameter Feld eine Formel eingeben kann.
In diesen Falle würde man eine Output Config erstellen die den aktuellen Wert der Funktion liest.... Gibt dieser z.b. die Variable "A" und im Parameterfeld hätte man dann die Funktion a+100 ..... Also er liest "a" addiert 100 und nutzt dies als Parameter bei nen Tastendruck.

My question now. Is this "Placeholder Tool" now available? Or something in that direction?

thanks for your answer and for your time in advance
Best regards Franz
2022-11-29 21:45
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
iconwif:


My question now. Is this "Placeholder Tool" now available? Or something in that direction?

thanks for your answer and for your time in advance
Best regards Franz



Yes it is !

The question is.... Do you got ( in that Aircraft) a "SET" Event ? So a Event we could write e.g. 5000 and it "SET" the AP Alt to 5000 ?
I don´t fully understand "how" you do the thing in first posting with the "1000" and "5000" Test.... Is this a EventID ?

If YES and you also can read the current Altitude, then you can do it as expected....

Step1 Read the Current ALT with a Output Config... Lets call this Config "Alt Info"
Step 2 Make the Input Config and enable the "Config Refference/Placeholder" there.... Select Config "Alt Info" and give it a symbol.... lets say "a"
Step 3 Choose for EventID (Or the stuff you do in first testing) and now say in the value field a+1000 or a-1000 for left/Right.
Good Luck !
2022-12-01 08:57
Avatar
wif
From: Austria
Posts: 20
Hi Pizman,

Sorry for my late respond.
Yes, I have this "Set" events. For instance 66124 AP_ALT_VAR_SET_ENGLISH. I'm used to know, how to handle this. But at his aircraft, it doesn't work as expected.
At my first posting about "1000 and 5000" Testing - this is not an event - it is an Lvar.
At the moment I don't now, what should I write in the parameter window, when I try this Lvar via a Lua script assigned to a button press or key press in FSUIPC - I used to write "0" or "1". But here, its different. I would like to write "a+1000" but this is not possible, also "nil" is not possible. Mobiflight and FSUIPC doesn't allows this.

In the meantime thanks for your help
best regards
Franz
2022-12-06 20:13
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
I have no expereince myself with those Lua Stuff ( But there are some advabnced guys on our Discord and also in the FSUIPC Documentation for Programmers there are some code examples.....

I see two ways....

1. Using the "LUA Interface Tool" in Mobiflight....
There you can Run/Stop or fire Lua Macros and code parts directly from MF.
Means you got a lua Macro that increase Altitude by 1000 .... So we can say on Button Press ( Or encoder turn) fire this event 1 time.

PRetty sure you can also include in this LUA Code/Macro the initial Altitude. If we can read it with MF ( Offset e.g.) then you can also inside the Lua code say "get Value from Offset/Lvar xy" and add 1000 and write result to Lvar xxx.

2. by write a Offset.
We can say in MF read current altitdue and add 1000 and write result to a Free to use offset.
Then in your code you say.... Always if this offset change its value then send exact that value to your Lvar.
Good Luck !
2022-12-07 18:31
Avatar
wif
From: Austria
Posts: 20
Hi Pizman,

I will try your ways.

In the meantime thank you very much for your support.

best regards
Franz
2022-12-07 20:55
icon