Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LUA script to set the heading bug no longer works

Featured Replies

I wrote a FlyWithLUA script long ago that would set the heading bug using code similar to below ....

------------------------------------------
dataref("gPlaneAPHeading", "sim/cockpit/autopilot/heading", "writable")   -- defined earlier on in the script

gPlaneAPHeading = 90  -- set the AutoPilot heading

------------------------------------------

but, with no change to the code this no longer works, yet I can set the dataref via the dataref editor plugin.

Does anyone have a suggestion of what I need to change to get this working again?

It appears to no longer be writable

My searches have turned up nothing.

Thanks.

Edited by smoothchat

Specs: Win10, 4790K, nVidia 1080ti, Saitek Yoke+Quadrant+Radio/Switch and AP panels, VRInsight 737 overhead, Virtual Avionics 737 MCP. 3 x 1440*900 main display + 1024*600 VDU display. NLR V3 Motion seat. Oculus DK2 CV1 HTC Vive VR headsets.

If that's all there is to your script, it will just set the heading bug to 90 upon sim session start and nothing more anyway. Just about any other script or plugin being run after your script finishes can override the bug position.

7950X3D + 7900 XT + 64 GB + Linux | 4800H + RTX2060 + 32 GB + Linux
My add-ons from my FS9/FSX days

  • Author

Hehe, Thanks Bjoern,

It's just a couple of lines from the Formation script which I published on the X-Plane forum. 

Thank you for prompting my memory. I have discovered that I had since enabled another script which conflicts with mine.

FYI My script is here .....

https://forums.x-plane.org/index.php?/files/file/50534-formation-flying-flywithlua-script-update-see-notes/

When I acquire the AI planes and create a formation so I can fly my plane with them (as a wingman),  I push the 1st AI plane's heading into my plane's autopilot heading so it will turn and fly the same heading as the formation (which is led by the 1st AI plane).

Example of what happens. The aircraft heading changes to match the AI plane.


cheers

Edited by smoothchat

Specs: Win10, 4790K, nVidia 1080ti, Saitek Yoke+Quadrant+Radio/Switch and AP panels, VRInsight 737 overhead, Virtual Avionics 737 MCP. 3 x 1440*900 main display + 1024*600 VDU display. NLR V3 Motion seat. Oculus DK2 CV1 HTC Vive VR headsets.

5 hours ago, smoothchat said:

Hehe, Thanks Bjoern,

It's just a couple of lines from the Formation script which I published on the X-Plane forum. 

Thank you for prompting my memory. I have discovered that I had since enabled another script which conflicts with mine.

Solutions can sometimes be so very simple... 😅

7950X3D + 7900 XT + 64 GB + Linux | 4800H + RTX2060 + 32 GB + Linux
My add-ons from my FS9/FSX days

slightly different direction, but if you want to do this with voice commands ala

the lua that does it is here

https://github.com/mSparks43/747-400/blob/cbd28b13cbf8a0f67b9c2daaec0e48b5ed3ac231/plugins/xtlua/scripts/B747.70.xt.autopilot/B747.70.xt.autopilot.lua#L2712

and the json definition for the voice command is

{"recognise":"set heading","commandArray":[{"command":"laminar/B747/autopilot/heading/target=?","pause":0.2}]}

in

https://github.com/mSparks43/747-400/blob/2.3/plugins/AutoATC/voice commands/voice_control.json

AutoATC Developer

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.