plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

Save the date ! On February the 9th, at 10:30am, we will be happy to meet you again for a live SDK Q&A ! You can already ask all your questions here on the forum.

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!


question

ericmarciano avatar image
ericmarciano asked FlyingRaccoon commented

Setting AP_FLIGHT_LEVEL_CHANGE mode

The flight level change mode does not work on my aircraft but it should, according to the aircraft config files. So I decided to trigger the event myself: when I press a panel button, the following code is executed:

SimVar.SetSimVarValue("K:AP_FLIGHT_LEVEL_CHANGE", "bool", true);

Nothing happens, the aircraft has no reaction. So I decided to check using a function that captures the events, including this one. And surprise, my function does not react when this event is triggered, while it correctly reacts for other events.

I also tried with AP_FLIGHT_LEVEL_CHANGE_ON but it makes no difference. It seems the event is completely ignored. Consequently the FL CH mode does not work :(

Does anyone has an idea why this does not work as expected?

Thank you.

gauges
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello @ericmarciano

Are other autopilot events working or just these ones?
Can you confirm the "CIRCUIT AUTOPILOT ON" simvar is set to true?

Regards,
Sylvain

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

ericmarciano avatar image
ericmarciano answered FlyingRaccoon commented

Yes, all the other autopilot modes work correctly, so I have no doubt about CIRCUIT AUTOPILOT ON. I finally found the reason why it was not working, it is just because some parts of the stock 747 were used in the model file. I changed this and it now works fine, probably because the reused parts were interfering with the autopilot.

But I solved a problem to discover another one: now that I can set the FL CH mode using this K: event (or using a key that I mapped) and now that it works, I noticed that the even listener does not get any event, which is important for me. I set the event handler to catch AP_FLIGHT_LEVEL_CHANGE and AP_FLIGHT_LEVEL_CHANGE_ON, none of them arrive when the FL CH mode is engaged using K:FLIGHT_LEVEL_CHANGE_ON or the keyboard.

This is strange...

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

It doesn't receive any key events at all or just some of the AP ones?
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.