Jump to content
The simFlight Network Forums
Sfakman

MoveAircraft() X-Plane

Recommended Posts

Hi Paul,

I think I may know the answer to this already but I thought I would ask as I'm out of options.

Your MoveAircraft() method works perfectly in FSX - unfortunately, the results I'm getting in X-Plane using XPUIPC are rather different.

I'm using the following test code in c#:

FsLatitude lat = new FsLatitude(51.464943d);
FsLongitude lon = new FsLongitude(-0.434046d);
FsLatLonPoint newPos = new FsLatLonPoint(lat, lon);
bool onGround = false;
double heading = 180; 
double ias = 100;
FsAltitude altitude = FsAltitude.FromFeet(3000);
double pitch = 0.00;
double bank = 0;

FSUIPCConnection.MoveAircraft(newPos, false, altitude, heading, pitch, bank, ias, true);
FSUIPCConnection.Process();

The aircraft ends up at 30,000ft and in a different hemisphere(!) with a Lat/Lon of 46°.60s / 1°.80w with no pausing.

Appreciate you only probably only support FSUIPC but just wondered if you new anything obvious that may be causing X-Plane to misinterpret the request?

Thanks

Edited by Sfakman

Share this post


Link to post
Share on other sites

I can't see anything in your code which would cause it not to work.

It's probably down to XPUIPC not implementing the move feature.  

For this feature, the dll writes the Airspeed and OnGround flag to a special offset specifically for used for setting the aircraft initial position. This triggers FSUIPC to make a special SimConnect call that sets the new position of the aircraft.

XPlane of course doesn't use SimConnect so it would be down to the authors to translate that to the XPlane equivalent (or fake it if there isn't one).

So my guess is that they haven't implemented that particular offset.

If XPUIPC is still being developed you could ask for a fix. (It's offsets 0x0558 and 0x55C which are not working).

Otherwise, the you could try writing the Lon/Lat/Alt etc using the normal offsets (0x0560/0x0568/0x5070 etc). You might find this more basic and direct approach works, rather than using the 'special' SimConnect move feature.

Paul

Share this post


Link to post
Share on other sites

As always, thanks for the detailed response.

I think I'll try your last option and go back to basics and see how I get on. 

Appreciate the support :)

Share this post


Link to post
Share on other sites

Hi there. I've just developed a system landing gear using it for FSX and Prepr3D whose working fine for them. But for X-plane 11 and XPUIPC once it is enabled, it does not communicate with my app using fsuipc.dll from Paul. 

So I'm load of things in development (many gauges, instruments, displays, radios and so on) and I will be focused on only FSX and mainly, the PREPAR3D. This stuff is already so complicated and so many clallenges to overcome every single day. Better this way or I'm gonna be crazy.

I got happy that there are more people with same difficulties so I'd rather give X-PLANE up for now.

 

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

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.