aircraft drops down after setting the altitude

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

aircraft drops down after setting the altitude

Post by ppp333ddd_ »

Hi,
I am using C# to set the airplane altitude.

Code: Select all

sim.SetDataOnSimObject(DEFINITIONS.Altitude, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_DATA_SET_FLAG.DEFAULT, Init.Altitude);
In some "pause on" situations it will fall down with unknown reasons and that often make the plane crash when I pause it off and do the freeze.

Code: Select all

sim.TransmitClientEvent(0, EVENTS.POSITION_FREEZE_USER, 1, NOTIFICATION_GROUPS.GROUP0, SIMCONNECT_EVENT_FLAG.DEFAULT);
Is it a bug in P3D or can I solve it?

Thanks
User avatar
Rob McCarthy
Lockheed Martin
Posts: 3703
Joined: Wed Aug 24, 2011 1:37 pm

Re: aircraft drops down after setting the altitude

Post by Rob McCarthy »

Hello,

Can you post more details on when you see this happen? Some helpful info would be if this happens on the ground, in the air, how far the drop is, and if are you using the “Freeze” though key events. If it's a small drop it may be due to slight latency between making the SimConnect call and Prepar3D receiving the message.

Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: aircraft drops down after setting the altitude

Post by ppp333ddd_ »

Hello Rob,

The plane in the sky will drop onto the surface of the ground/sea depending on the scenary.

I am doing a "repositioning" for the plane - say 3 nautical miles before landing. Before setting the altitude, I simply do 3 events to pause the game, set the plane's attitude and reload the plane as follows:
EVENTS.PAUSE_ON, EVENTS.SIM_RESET and EVENTS.RELOAD_USER_AIRCRAFT
The repositioning procedure should also set the latitude, longitude, heading, engines, etc. There is also an important step: setting gears and flaps - this is when the plane crashes because I need to freeze the plane and unpause the game at this moment, the altitude could drop onto the ground/sea surface for some unknown reason. When the gears are put down, they touch the water and therefore the plane crash in the game. I have tried to swap over the steps for the repositioning process but the "plane drops down" problem cannot be solved.

Thanks.
Locked