Simconnect CRASH FLAG
-
- Posts: 4
- Joined: Mon Jan 21, 2019 2:19 am
Simconnect CRASH FLAG
I want to read the CRASH FLAG in P3D via simconnect. I use AddToDataDefinition() function to read it and I've tried different ways but all failed. Is there anyone know what's wrong with this problem and help me to solve it, I'll be appreciate for your help.
Re: Simconnect CRASH FLAG
What crash are you trying to detect? the user crashing? or something else?zhaohy0623 wrote: ↑Mon Jan 21, 2019 2:37 am I want to read the CRASH FLAG in P3D via simconnect. I use AddToDataDefinition() function to read it and I've tried different ways but all failed. Is there anyone know what's wrong with this problem and help me to solve it, I'll be appreciate for your help.
Regards,
Simbol
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
-
- Posts: 4
- Joined: Mon Jan 21, 2019 2:19 am
Re: Simconnect CRASH FLAG
Hi Simbol, I'm trying to recognize the crash of aircraft when it's collising with terrain or buildings.Simbol wrote: ↑Mon Jan 21, 2019 9:40 amWhat crash are you trying to detect? the user crashing? or something else?zhaohy0623 wrote: ↑Mon Jan 21, 2019 2:37 am I want to read the CRASH FLAG in P3D via simconnect. I use AddToDataDefinition() function to read it and I've tried different ways but all failed. Is there anyone know what's wrong with this problem and help me to solve it, I'll be appreciate for your help.
Regards,
Simbol
Regards
Deman Zhao
Re: Simconnect CRASH FLAG
You can subscribe to the detection of the crash via SimConnect_SubscribeToSystemEvent.
It is fairly simple to do, you map an event id to the crash event, you use the function above to register for notifications and then you listen to such event id to know when it happened.
Information: http://www.prepar3d.com/SDKv4/sdk/simco ... ystemEvent
An example of monitoring of events: http://www.prepar3d.com/SDKv4/sdk/simco ... nitor.html
Regards,
Simbol
It is fairly simple to do, you map an event id to the crash event, you use the function above to register for notifications and then you listen to such event id to know when it happened.
Information: http://www.prepar3d.com/SDKv4/sdk/simco ... ystemEvent
An example of monitoring of events: http://www.prepar3d.com/SDKv4/sdk/simco ... nitor.html
Regards,
Simbol
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com
-
- Posts: 4
- Joined: Mon Jan 21, 2019 2:19 am
Re: Simconnect CRASH FLAG
Thanks Simbol, I've tried this sample and it works well. Now I want to recognize the flag of crash using this sample : https://www.prepar3d.com/SDKv4/sdk/simc ... _data.htmlSimbol wrote: ↑Wed Jan 23, 2019 3:40 pm You can subscribe to the detection of the crash via SimConnect_SubscribeToSystemEvent.
It is fairly simple to do, you map an event id to the crash event, you use the function above to register for notifications and then you listen to such event id to know when it happened.
Information: http://www.prepar3d.com/SDKv4/sdk/simco ... ystemEvent
An example of monitoring of events: http://www.prepar3d.com/SDKv4/sdk/simco ... nitor.html
Regards,
Simbol
but when I just add a property named Crash_Flag and use SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Crash Flag", "enum") to register property, it doesn't work at all. Do you know what's wrong with it?
Regards
Deman Zhao
Re: Simconnect CRASH FLAG
You need to use the system event notification, no requesting the data via data requests, the SimConnect_SubscribeToSystemEvent function is used to request that a specific system event is notified to the client.
Check the examples I gave you before, particularly the "pause monitor", following the same approach you need to register for the event notification "Crashed".
Regards,
S.
Check the examples I gave you before, particularly the "pause monitor", following the same approach you need to register for the event notification "Crashed".
Regards,
S.
CEO Flight Sim Technologies Ltd
Oficial Website: https://www.FSReborn.com