Page 1 of 1

SimConnect_SetDataOnSimObject

Posted: Fri Jul 15, 2016 4:01 am
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

Re: SimConnect_SetDataOnSimObject

Posted: Fri Jul 15, 2016 12:13 pm
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.

Re: SimConnect_SetDataOnSimObject

Posted: Tue Jul 19, 2016 6:36 am
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.

Re: SimConnect_SetDataOnSimObject

Posted: Tue Jul 19, 2016 6:39 am
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.

Re: SimConnect_SetDataOnSimObject

Posted: Tue Jul 19, 2016 12:59 pm
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.

Re: SimConnect_SetDataOnSimObject

Posted: Wed Jul 20, 2016 3:24 pm
by zamirk
Thanks for your guidelines. I Will give it a try IA!

Re: SimConnect_SetDataOnSimObject

Posted: Mon Aug 01, 2016 7:28 pm
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

Re: SimConnect_SetDataOnSimObject

Posted: Mon Sep 05, 2016 10:38 am
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