change vehicle issues

jpearson
Posts: 41
Joined: Fri Dec 03, 2010 6:52 pm

Postby jpearson » Thu Apr 14, 2011 12:23 pm

when changing aircraft with SimConnect_ChangeVehicle(), the new aircraft will load slightly slanted to where the back end of the aircraft is underneath the ground.



also, how do i determine the correct name for each vehicle to pass through SimConnect?

jpearson
Posts: 41
Joined: Fri Dec 03, 2010 6:52 pm

Postby jpearson » Thu Apr 14, 2011 2:18 pm

figured it out i think. ChangeVehicle() seems to work off of the "title" field for each "fltsim.X" object in the aircraft configuration file for that aircraft model. for example, to get an F-35C from Abacus to load through SimConnect, I had to pass the title of "Abacus PC F-35C Lighting II" from the following description within the aircraft configuration file.



...beginning of aircraft config file



[fltsim.0]

title=Abacus PC F-35C Lighting II



...rest of configuration file, etc.



This should absolutely be documented in the SimConnect API Reference with clear examples and dummy aircraft configuration files.

jpearson
Posts: 41
Joined: Fri Dec 03, 2010 6:52 pm

Postby jpearson » Thu Apr 14, 2011 2:18 pm

also, the problem of the aircraft seeming to start with landing gear slightly in the ground seemed to be related to trying to pause the sim too soon after reloading the aircraft. not pausing the sim after loading a vehicle did not cause the same problem

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

Postby Adam Breed » Fri Apr 15, 2011 3:17 pm

Hi,



If you need more clarification on the aircraft configuration files, they are fully documented in the Learning Center under SimObject Creation Kit -> SimObject Container SDK -> Aircraft Configuration Files. The ‘title’ is the way the system calls variations of the same aircraft container. I agree the use of the title could be better documented and we will do our best to update that in future releases. The Learning Center currently uses the Mooney Bravo as an example, which is an aircraft we deliver with Prepar3D.



In addition, you are correct about having to unpause to update the ground position after loading a vehicle. The aircraft load procedure does not compute the position to the ground until the application is unpaused. You can think of it as a straight vehicle swap. So, when the centroid of vehicle A is closer to the ground, (compared to the centroid of the vehicle B) vehicle B will appear slightly underground until the application is allowed to process its next frame.
Prepar3D® Engineering Project Manager

jpearson
Posts: 41
Joined: Fri Dec 03, 2010 6:52 pm

Postby jpearson » Fri Apr 15, 2011 3:41 pm

thanks, Adam. I have not had to do anything with sim object creation so I was not as familiar with the information contained within that section of the SDK but I will keep it in mind for future reference. In the interest of improving the SDK in future releases, the ChangeVehicle() example is a little confusing when trying to use it with aircraft with convoluted or non-trivial names. The name to reference the aircraft by is unclear considering that the name Mooney Bravo is the aircraft's folder name, its AIR file name, the title and sim fields for the first "fltsim" object in its aircraft configuration file and a couple other references include this name in them somewhere or use it explicitly, so its hard to determine where the sim is getting the correct name from. Also, its natural to look in the GUI menu to try to determine a name, and when the names that appear for the aircraft (when trying to select an aircraft through the user interface) dont work it starts to get confusing. I basically had to compare aircraft config files for things that worked and things that didnt and figure out which string that included a name was actually being used and experiment. I dont mean to sound whiny or beat a dead horse, I just want to use it as an example to stress the importance of clear documentation, especially when dealing with someone else's SDK. thanks again for your help!!


Return to “SimConnect Interface Questions”

Who is online

Users browsing this forum: Google [Bot] and 10 guests