SimConnect_SetDataOnSimObject

zamirk
Posts: 109
Joined: Mon Jul 21, 2014 8:39 am

SimConnect_SetDataOnSimObject

Postby zamirk » Fri Jul 15, 2016 4:01 am

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: 723
Joined: Sat Jan 19, 2013 1:46 am
Location: Ontario, Canada

Re: SimConnect_SetDataOnSimObject

Postby ronh991 » Fri Jul 15, 2016 12:13 pm

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: 109
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Postby zamirk » Tue Jul 19, 2016 6:36 am

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: 109
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Postby zamirk » Tue Jul 19, 2016 6:39 am

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: 723
Joined: Sat Jan 19, 2013 1:46 am
Location: Ontario, Canada

Re: SimConnect_SetDataOnSimObject

Postby ronh991 » Tue Jul 19, 2016 12:59 pm

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: 109
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Postby zamirk » Wed Jul 20, 2016 3:24 pm

Thanks for your guidelines. I Will give it a try IA!

Adam Breed
Lockheed Martin
Posts: 1385
Joined: Mon Sep 20, 2010 6:17 pm

Re: SimConnect_SetDataOnSimObject

Postby Adam Breed » Mon Aug 01, 2016 7:28 pm

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: 109
Joined: Mon Jul 21, 2014 8:39 am

Re: SimConnect_SetDataOnSimObject

Postby zamirk » Mon Sep 05, 2016 10:38 am

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


Return to “SimConnect Interface Questions”

Who is online

Users browsing this forum: No registered users and 14 guests