Jump to content
The simFlight Network Forums

MoveAircraft causing reload


Recommended Posts

Hi Paul,

After my query the other day about sending key presses to FSX, my code is working perfectly, BUT I am using both simConnect and FSUIPC Client.  This seems a bit over the top, since the only thing I want to do in simconnect now is move the aircraft to a give latitude and longitude. 

 

 FsLatLonPoint fsLatLonPoint = new FsLatLonPoint(lat,lon);
            FsAltitude fsAltitude = new FsAltitude(0);


            //Send Structure to simconnect to position aicraft
            //simconnect.SetDataOnSimObject(DEFINITIONS.Struct1, 0, SIMCONNECT_DATA_SET_FLAG.DEFAULT, s);
            FSUIPCConnection.MoveAircraft(fsLatLonPoint, true, fsAltitude, 0, 0, 0, 0, true);

As you can see above, I commented out the simconnect instruction and replaced with the FSUIPCConnection instruction.  Whilst it works, FSX then Loads Terrain, ATC etc after each move.  Any idea why and how I can stop this?

 

Many thanks

Martin

 

Link to post
Share on other sites

Hi Martin,

The MoveAircraft() method uses the "Initial Position" feature in FSUIPC that makes sure the scenery, weather, atc etc gets reloaded. This is normally used for things like instructor stations that get you set up for an approach to a selected airport. You would want everything reloaded in that case.

If you don't want to reload the scenery etc, then you can write directly to the Aircraft Longitude, Latitude, Heading, Altitude offsets etc.

Example using just Lon and Lat:

Declare offsets..

private Offset<FsLongitude> playerLon = new Offset<FsLongitude>("Position", 0x0568, 8);
private Offset<FsLatitude> playerLat = new Offset<FsLatitude>("Position", 0x0560, 8);

Move aircraft...

            this.playerLat.Value = lon; // lon here is an instance of FsLongitude
            this.playerLon.Value = lat; // lat here is an instance of FsLatitude
            FSUIPCConnection.Process("Position"); // Instant move, no reload. 

Paul

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.