Jump to content
Sign in to follow this  
clarklidbury

Help with a little programming

Recommended Posts

Hello,

I am looking for some help to write a small function that calls upon default FSX autopilot behaviour. Here is how the sim behaves right now for ATT (attitude hold mode). When ATT hold is entered, the Autopilot reverts to roll hold for lateral control. I am looking for a way to keep the existing lateral mode when ATT hold is entered - so it can be used for enroute climbs and descents. It is possible to manually re-engage NAV or HDG mode. However, I would like to create a custom function that goes something like this:

function flight_level_change ()
    is NAV mode engaged?
    if yes - AP_ATT_HOLD
               AP_NAV_HOLD
    else - AP_ATT_HOLD
              AP_HDG_HOLD

end

is someone able to help me out with this? the above assumes that the autopilot is always in either HDG or NAV (true for me). It could use some kind of nested IF to also include roll_hold mode but I dont think its necessary...

thanks so much!!!

 

 

Share this post


Link to post
Share on other sites

this is what i have so far

function F406_FLCH_ON ()
    if D07C4 == 1
        then    ipc.control(65722,1)
                ipc.control(65811,1)
        else    ipc.control(65722,1)
                ipc.control(66106,1)
        end
end

but the conditional always returns false, so either i am reading the wrong offset, or expecting the wrong value or something else?

Edited by clarklidbury
typo

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...