September 20, 20169 yr I am getting back into programming a managed application with SimConnect and while I have read the SDK documentation and gone through the examples I am totally lost at what they claim it is possible to do. The Events section lists about 14 failures including engine failures (one for each possible engine), pitot blockage, pitot static, brake failures and system failures (vacuum, electrical, hydraulic). But there is no single example on how to actually trigger any of these failures or query the simulator about the current state of the failures. // subscribe to Engine Failuressimconnect.MapClientEventToSimEvent(EVENTS.FAIL_ENGINE_1, "TOGGLE_ENGINE1_FAILURE") simconnect.AddClientEventToNotificationGroup(NOTIFICATION_GROUP.BasicFailures, EVENTS.FAIL_ENGINE_1, false); // set the group prioritysimconnect.SetNotificationGroupPriority(NOTIFICATION_GROUP.BasicFailures, SimConnect.SIMCONNECT_GROUP_PRIORITY_HIGHEST); and then I tried triggering with: simconnect.TransmitClientEvent(00000001, EVENTS.FAIL_ENGINE_1, 1, NOTIFICATION_GROUP.BasicFailures, SIMCONNECT_EVENT_FLAG.DEFAULT); and with simconnect.SetSystemEventState(EVENTS.FAIL_ENGINE_1, SIMCONNECT_STATE.ON); neither of them work. E.G.Freelance IT Consultant www.PanamaVibes.com | www.lordofwingsPTY.com | www.coralys.com @aviationweb
September 21, 20169 yr Emilio_G, I'd suggest you to use the SetDataOnSimObject function to trigger a failure, like in the following example (it's Delphi but you'll easily grasp the idea): first add it to data definition SimConnect_AddToDataDefinition(hSimConnect, ord(DATDEF_SETENG1ONFIRE), 'ENG ON FIRE:1', '', SIMCONNECT_DATATYPE_INT32) then call whenever you want it SimConnect_SetDataOnSimObject(hSimConnect, ord(DATDEF_SETENG1ONFIRE), SIMCONNECT_OBJECT_ID_USER, 0, 0, 0, 0)
Create an account or sign in to comment