Author Topic: Set MCP heading bug correctly / Zibo 737 X-Plane 11  (Read 1687 times)

McPilot

  • Newbie
  • *
  • Posts: 5
Set MCP heading bug correctly / Zibo 737 X-Plane 11
« on: November 25, 2024, 07:02:30 AM »
Hi,
any help is appreciated because I´m a VA newbee  ;)

I want to set the heading knob on the MCP of the Boeing 737 to a desired heading.
This works very well for the recognition of my spoken input and the heading bug is turning
e.g. "heading 090 degrees".
But
if I put in a new command in e.g. "set heading 100", this new command "100" was added
to the 090 degree, so the new bug is set to 190°. So I´ll never get the right heading.
So I think it´s best to set the heading bug always to 000° first with a command and then starting
my commandlist below.
So, what´s the additional helpful VA command for this?

My commandslist:
When I say:
[set;] heading [0..3] [0..9] [0..9] degrees

commands:
Pause 0.1 seconds
Set text [loop] to '{CMD}'
Set integer [loop] value to the converted value of {TXTNUM:loop}
Write 'value recognized as {INT:loop}' to log
Start Loop While : [loop] Is Greater Than 0
    Press U key and hold for 0.03 seconds and release
    Set integer [loop] to [loop] minus 1
End Loop

THX to the helpers :)
« Last Edit: November 26, 2024, 06:10:53 AM by McPilot »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4834
  • RTFM
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #1 on: November 25, 2024, 11:51:18 AM »
Assuming you're using Microsoft Flight Simulator 2020 (possibly also 2024, not sure of compatibility), this plugin might be able to set that value directly.

McPilot

  • Newbie
  • *
  • Posts: 5
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #2 on: November 25, 2024, 02:20:20 PM »
Unfortunately no, I´m not using MSFS. It´s xplane 11 according to the subject line above.
Thanks for another helping reply.
Regards McPilot

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4834
  • RTFM
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #3 on: November 25, 2024, 02:29:12 PM »
Right. Checked the body, of the post, not the title ::)

Then there is another plugin, albeit a commercial one: SPAD.neXt, which I believe does have X-Plane compatibility.


Otherwise, without having the ability to directly set a value or retrieve information from the simulation, you'd need to keep track of the current value in a variable, but that would get desynchronized if the value isn't changed either through VoiceAttack directly, or through a keypress you have a command assigned to that keeps the value up-to-date.

McPilot

  • Newbie
  • *
  • Posts: 5
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #4 on: November 26, 2024, 06:19:07 AM »
Hi Pfeil,
thx for the response.
Your comment:
... you'd need to keep track of the current value in a variable, but that would get desynchronized if the value isn't changed either through VoiceAttack directly, or through a keypress you have a command assigned to that keeps the value up-to-date.
That´s exactly what I´m looking for. That´s my question "How to do this with commands in VoiceAttack?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4834
  • RTFM
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #5 on: November 26, 2024, 06:21:21 AM »
You'll want to read up on some of the advanced features, specifically variables, tokens, and control flow actions like conditions and loops.

Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on said features.

These topics may also be of use, in addition to the official documentation:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up

McPilot

  • Newbie
  • *
  • Posts: 5
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #6 on: November 27, 2024, 03:13:40 AM »
Hi Pfeil,
now I found out in the dataref of xplane the assigned heading settings.
It´s "sim/cockpit/autopilot/heading_mag" and a value range from 0..359
If I press my assigned keyboard u-key the values could be changed and my heading knob is turning.
So, shouldn´t it be possible, acting with a command for the "variable keypress advanced", to set
the heading to 000 zero, always before starting my voice command e.g."set heading 090".
Something like this: doesn´t work yet ;). (newbie)

Set text [~keypress] to 'u {sim/cockpit/autopilot/heading_mag} 0'
Press variable key(s) [u {sim/cockpit/autopilot/heading_mag:0}] and hold for 0.3 seconds and release

A step by step response would be appreciated... :)
THX

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4834
  • RTFM
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #7 on: November 27, 2024, 03:19:04 AM »
This "sim/cockpit/autopilot/heading_mag" value is part of an external application, and would only be accessible through a proprietary API, requiring a custom plugin to interface with.

Just putting that literal piece of text into VoiceAttack cannot work in any way like your post seems to suggest.

McPilot

  • Newbie
  • *
  • Posts: 5
Re: Set MCP heading bug correctly / Zibo 737 X-Plane 11
« Reply #8 on: November 27, 2024, 03:55:59 AM »
mmh  :-\
but thx a lot for you replies and patience.... :)