• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Aircraft Failures - event processing not working?

Messages
10
Country
us-texas
I have tried without success (using both unmanaged C++ and managed c#)to receive "Aircraft Failures" events.
I have searched the documentation, only seeing in the notes section :"Not all events apply to all aircraft and all situations". I have tried several different aircraft also (and some different situations).

Anyway, for a specific example:
1. I subscribe to TOGGLE_ELECTRICAL_FAILURE in my code.
2. Start the program, see this event register in the SimConnect debug window.
3. Then I click on the failure checkbox for Electrical in the Systems tab of the failures dialog (under the &Aircraft menu) in FSX, I see the electric go out on the aircraft panel but never receive an event for this in my code, nor do I see it in the SimConnect debug panel?
4. Then when I go back into the failure dialog, I uncheck this failure setting and click OK and the electricity does come back to the aircraft, but again no event fires in my code nor the debug window.

Is this the expected behavior and I just missed it in the documentation?
Additionally, I have tried all single engine specific failure events (I didn't try Engine2, 3 or 4).

Thanks,

John
 
1. I subscribe to TOGGLE_ELECTRICAL_FAILURE in my code.
2. Start the program, see this event register in the SimConnect debug window.
3. Then I click on the failure checkbox for Electrical in the Systems tab of the failures dialog (under the &Aircraft menu) in FSX, I see the electric go out on the aircraft panel but never receive an event for this in my code, nor do I see it in the SimConnect debug panel?

I don't think any of the Menu system settings actually SEND the events in the first place for you to intercept. This is an event which can be sent by a program to set or clear electrical failures. The menus can do this directly, they are "built in".

Think of events as controls or switches. I've always called them controls, in fact -- they are tabulated in the CONTROLS.DLL after all. In the gauges SDK they are called "KEY EVENTS".

Gauges and externals programs and DLLs can use controls. many controls can be assigned to buttons and switches. But FS internally does not have to use controls to do anything.

Perhaps what you are seeking is an additional "system event" for telling you when things are changed like this? That might be the proper way, though it is unnecessary because you can get what you want by subscribing to the Sim Var "PARTIAL PANEL ELECTRICAL" instead.

Regards

Pete
 
Thanks Pete,
Well that explains why it was not working! :)

I was assuming that this correlated through to the SDK client and the menu was a fast way to test, but I'll just try sending it from another client to test with.
I am new to SimConnect so I appreciate your input.

John
 
John,

Peter is correct - the menu does not send this event - I got it to work by transmitting a client event. I assume you are testing with client event.cpp.

then add:

hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_ELEC_FAIL, "TOGGLE_ELECTRICAL_FAILURE");

hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_ELEC_FAIL);

hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST);

// add this line below
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_ELEC_FAIL, 0, GROUP0, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
 
Thanks Ron!
I got it working last night. Which is great because I just wanted to be sure our instructor station will be able to make this event fire.

Thanks for your help.

John
 
Back
Top