Sign in to follow this  
Guest gita1111

My SimConnect Client will only work correctly in Paused Mode

Recommended Posts

Real quick background, I'm driving FSX from another source, using it as just a visual image generator. I've got everything hooked up and driving, but when I go to unpause FSX, FSX flips between my new external data and what looks like the initialization point.I've got it set up that I use the "Init Position" when I jump to a new place, and then I just SetSimConnectObject on "Plane Latitude", "Plane Longitude", "Plane Altitude", "Plane Pitch", "Plane Bank", and "Plane Heading...". These are the only 6 variables I'm setting. I launch FSX in just a default quick flight mode. But as soon as I unpause FSX, I get the flipping.Are there other API function calls I need to make when continuously streaming this new data to change my ownship position? Like is there a way to disconnect the math-model inside FSX while I'm in live mode?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

There is a way to disable AI for an object but i don't know whether it works or not and how, never played with it. And i'm somewhat certain it doesn't work with the players aircraft.Look for a description of SimConnect_AIReleaseControl() in the API reference to write your own AI for an object.I guess if you want to control the players aircraft you would have to intercept and mask all related simulation events and send out your own events/values to FSX. That is somewhat described in "SimConnect Priorities" (just search for the string in the API reference page. Good luck ...

Share this post


Link to post
Share on other sites

I got a little further with this problem; turns out the entire scene isn't flickering between different values, rather the ownship is rapidly oscillating between small values in pitch and sometimes roll; mainly pitch. The oscillations are maybe +-5 degrees. Now when I added "Plane Pitch" and "Plane Bank" to my sim object data def, I used "degrees" as the units - even though the SDK variable doc says the units are in radians. I also noticed that the pitch/roll coming out of my sim is reversed from what FSX wants, so I also flipped the sign on my pitch and roll before feeding it to set data on sim object. Would something like this be causing the FSX oscillations? The data coming over looks smooth. Only thing I can think is that somehow the data is getting messed up in the FSX internal conversion from degrees to radians. But then this doesn't make sense since my lat/lon degrees are driving the live scene smooth - and it really doesn't make sense that when I go to FSX "Pause" mode, everything is smooth. I know there are experts out there who have some tips, even though I'm a new member here, I would return the favor by being an active participant on the board here.thanks and happy holidays.

Share this post


Link to post
Share on other sites

Maybe it does make sense though. This is just a thought as I have not tested this with a real SimConnect program, but when FSX is in paused mode it is not 'flying' the aircraft.By flying I mean that FSX is calculating the next position of the aircraft many times per second based on the characteristics of the aircraft and user inputs.If FSX is flying it would update the positon of the plane in between the updates you send via SimConnect. This might explain the oscillations you are seeing.Like I said, just a thought ... and if this is correct then using 'slew' mode might be another way to get rid of the oscillations.

Share this post


Link to post
Share on other sites

>There is a way to disable AI for an object but i don't know>whether it works or not and how, never played with it. And i'm>somewhat certain it doesn't work with the players aircraft.>>Look for a description of SimConnect_AIReleaseControl() in the>API reference to write your own AI for an object.>>I guess if you want to control the players aircraft you would>have to intercept and mask all related simulation events and>send out your own events/values to FSX. That is somewhat>described in "SimConnect Priorities" (just search for the>string in the API reference page. Good luck ...Thanks for the tips. I was able to mask events, but I'm not sure the approach to mask values?You were correct in your assumption that I couldn't release AI control for the ownship. I got an exception #24, which means "operation invalid for object type." Good news is, I can enter "slew" mode and that disables the game engine for the ownship - but I would like to attempt masking the values.

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
Sign in to follow this