• 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.

MSFS2020 -Aircrafts change from country when I set ""HEADING_BUG_SET"

Messages
5
Country
portugal
I tried for now two aircrafts (Cessna 172 Skyhawk G1000 and Carenado PA44 Seminole ) and the result is the same.

My c# code taken from example at WWW:

sim.AddToDataDefinition(DEFINITIONS.Struct2, "HEADING_BUG_SET", "degrees", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
sim.RegisterDataDefineStruct<Struct2>(DEFINITIONS.Struct2);
Struct2 s2 = new Struct2();
s2.heading = Convert.ToInt32(headp.Text);
sim.SetDataOnSimObject(DEFINITIONS.Struct2, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_DATA_SET_FLAG.DEFAULT, s2);

Thks for your help
Note - before I saw this site I reported this bug at Flight Simulator Zendesk some minutes ago
 
Messages
2,077
Country
us-ohio
"HEADING_BUG_SET" is not a variable. It's an event name. I have no idea how you're getting this to run without it returning an error on the SetData... function. You need to look at the Send Event A sample project. While it's written in C++, the steps remain the same for C#.
 
Messages
5
Country
portugal
Thks WarpD ... and yes, it is weird to not have the error as is quite weird it changes the location of the aircraft. I understand that you code at C++ but for C# coders I attach here one (quite simplified) VS2019 sln where I am reading variables and trying (incorrectly) to set the AP heading. You will understand of course the code also. Thks again
 

Attachments

  • BugHeading (2).zip
    136.2 KB · Views: 93
Messages
5
Country
portugal
I went to review my code and yes I was treating is as an Event but as I was having an error (quite stupid I saw now because it was a wrong conversion/cast) I changed to variable ... and as I had no error I was insisting!
 
Messages
5
Country
portugal
Solved - now I can set the Events Heading (HEADING_BUG_SET) and turn on AP Heading Mode (AP_PANEL_HEADING_ON). Thanks WarpD to put me at the right path.
 
Top