Autopilot BAe Jetstream 32

      Comments Off on Autopilot BAe Jetstream 32

Due to the complex scripting behind it, the autopilot of the BAe Jetstream 32 made by JRollon can not be simply activated with a button using the standard X-Plane reference. To solve this I made a FlyWithLua script (with Notepad++) with the following code:sports74.ru

function toggle_AP()
if button(484) then
J32_APengage = 1 – J32_APengage
if button(488) then
J32_Altselect = 1 – J32_Altselect
if button(489) then
J32_Althold = 1 – J32_Althold

if PLANE_ICAO == “JS32” then
dataref( “J32_APengage” , “J32/AutopilotServosON” , “writable” )
dataref( “J32_Altselect” , “J32/AltSelect” , “writable” )
dataref( “J32_Althold” , “J32/AltHold” , “writable” )

I used button 484 for example, but change that to the button you want. NB: X-plane will report this button with a value of 1 higher. So my 484 button shows in X-plane (Buttons:Adv) as 485…
Be sure that no other command is assigned to this button: the script does not clear any assignments.

Give the script a name (for instance APJ32.lua) and put it in the scripts folder (within the FlyWithLua folder). When you load the Jetstream it should work.
You have to hold the button a bit longer -> until the autopilot light goes on or off. Because I used ‘do_often’ instead of ‘do_every_frame’, a short ‘click’ is often not enough.
For me it works fine this way… If I use do_every_frame on my PC it reacts way too nervous and sometimes switches on and off with the same click…but perhaps it works fine on other PC’s…

To save you the work you can download the script here: Download (388.0 B)

For the script to work you need FlyWithLua! But installing FlyWithLua is very simple, see:
http://forums.x-plan…&showfile=17468 and http://forums.x-plan…showtopic=71006