SimConnect_SetDataOnSimObject

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Locked
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

SimConnect_SetDataOnSimObject

Post by zamirk »

Hi,

I am using SimConnect_SetDataOnSimObject after creation of some aircrafts through SimConnect_AICreateNonATCAircraft. And i am continuously using SIMCONNECT_DATA_INITPOSITION structure to set its parameters every half a second. Learning Center says one must not use this structure to continuously set data through this structure as P3D tries to initiate somethings for terrain system. If so, then which structure should I have to use.

Thanks for your precious time.

Best Regards,
Zamirk
User avatar
ronh991
Posts: 724
Joined: Sat Jan 19, 2013 1:46 am
Location: Ontario, Canada

Re: SimConnect_SetDataOnSimObject

Post by ronh991 »

Can I ask why you are trying to do that? Could you not just set a waypoint and then "let" the aircraft fly to the next position.

Or you could look into the body velocity X,Y Z, but then that's like writing your own flight dynamics engine.
Ron
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Post by zamirk »

In fact, I am writing a module which will interact different flight simulators with each other that is why I have to do that.
Setting the position of aircraft could be multiple times in a second, so I can't use waypoint setting approach. Is there any way to do that.
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Post by zamirk »

Same is the case for munitions and when I set Weapon position through this approach, weapon disappears but aircraft doesn't disappear through this approach. Please, guide me about this.
User avatar
ronh991
Posts: 724
Joined: Sat Jan 19, 2013 1:46 am
Location: Ontario, Canada

Re: SimConnect_SetDataOnSimObject

Post by ronh991 »

Look into the velocity body X,Y Z in the Simulation variables section of the Utilities/Variables area in the SDK. I have not coded this, but would assume you would use SetDataonSimObject. See the throttle example.

The are other variables like acceleration and rotation. But this means setting up your own flight dynamics engine, based on what you want to do.
Ron
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Post by zamirk »

Thanks for your guidelines. I Will give it a try IA!
Adam Breed
Lockheed Martin
Posts: 1382
Joined: Mon Sep 20, 2010 6:17 pm

Re: SimConnect_SetDataOnSimObject

Post by Adam Breed »

Hi Zamirk,

I'd recommend taking a look at the SimObject API (ISimObjects). That PDK capability was specifically created for use cases similar to the one you describe. There are a couple examples included in the SDK.

Regards,
Adam
Prepar3D® Engineering Project Manager
zamirk
Posts: 132
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Post by zamirk »

Thanks Adam,
i am trying to use SimObject API, i compiled Missile SimObject Sample in Visual Studio 2013 and place Missile.dll in gauges/Missile.dll and also update dll.xml with new load Missile.dll addone, when i run prepar3d.exe its crashes on load Missile.dll, i don't know why because when i compile Missile sample project its succeeded.
So, how i debug this problem?

Regards,
zamirk
Locked