December 31, 20232 yr I have not been able to locate the variable to set to activate approach mode. (A:AUTOPILOT APPROACH ACTIVE, Bool) works, but it is not settable. In the depth of Developer mode, I found L:WTAP_GP_Approach_Mode which changes in the Developer Window on APR set/unset, but not in the "Watch simulator variables" window. Any ideas? Well, being Dec 31, next year is ok....
December 31, 20232 yr Commercial Member The actual syntax in AAO is (L:WTAP_GP_Approach_Mode, Number) As the AAO manual says, if you want to read/write LVars from the sim, you must supply a unit. ", Number" is the default that always works. Conversely, if the LVar is just for internal use in the AAO scripts, then there is no unit attached - so it doesn't get sent to the sim which doesn't need it anyway Be mindful that LVars are just variables, they aren't "events" = there is no "action" associated with them. Most of the time LVars are just used to control the animation of the knob or lever. It is entirely possible to move the knob visually while the aircraft system that it is supposed to control is not affected. In MSFS developer mode, open Tools->Behaviors. Now click back into the sim and hover the mouse over the knob/switch/lever that you are interested in. Press "Ctrl - G". Now the behavior dialog will populate with the code that is associated with the component where your mouse cursor is. Look for the mouse actions at the bottom of the components list (something with "LeftSingle", "Drag" etc. in it). This usually contains the code that you have to replicate in AAO to do the same thing as the mouse action would do. Also, please make sure to always include the aircraft make and model that you are currently investigating, so we know where to look. Especially in MSFS, controls can be different for different aircraft and mods! What works in one situation may not work for another aircraft/mod. Edited December 31, 20232 yr by Lorby_SI LORBY-SI
January 2, 20242 yr Author Sorry for not mentioning the plane: TBM 930. I found this. AUTOPILOT_Approach_Button_Position changes when I click on APR, but `1·(>L:AUTOPILOT_Approach_Button_Position,·Number)` does not set it. Instead of L:, I also tried IE: (accepted, no action), O: (Red Led, so probably not valid)
January 2, 20242 yr Commercial Member The behavior code says that it is a BVar. The place to look is "Template parameters" and then start looking at the mouse interaction components at the bottom of the components treelist - "...Interaction..." "...LeftSingle..." or "...Drag..." etc. In this case you will find 1 (>B:AUTOPILOT_Approach_Button_Toggle) But. When there is a BVar then there is usually an "MSFS Input Event" not far behind. And that is the case here too. In AAO, in the usual Event selection treelist, filter for "appr" and you will find it in "MSFS Input Events". You can use either one. IE's can be assigned to buttons directly, without using scripts or anything - but they may require a specific value in the value box on the button assignment. There is a chapter about the MSFS Input Events in the AAO manual. Edited January 2, 20242 yr by Lorby_SI LORBY-SI
January 3, 20242 yr Author Thanks, working now. I promise that I read manuals much more carefully than my programmer friends do, and nevertheless got lost in the IE:/B: variables jungle. Having to switch gears now B:s are deprecated did not make it easier. As a reference for others, I include a screenshot that shows the example you illustrated. I was not aware that the items at the bottom of the tree are B: variables.
January 3, 20242 yr Commercial Member 53 minutes ago, dmenne said: Thanks, working now. I promise that I read manuals much more carefully than my programmer friends do, and nevertheless got lost in the IE:/B: variables jungle. Having to switch gears now B:s are deprecated did not make it easier. As a reference for others, I include a screenshot that shows the example you illustrated. I was not aware that the items at the bottom of the tree are B: variables. BVars are not deprecated, why would you say that? At the bottom of the list in your screenshot there are the Mouse components. Open "ASOBO_GT_Interaction_LeftSingle_Code" ("LeftSingle" as in "left mouse button single click"), you will find this particular BVar in there. These Items can also be called RightSingle, Drag, Wheel, etc. depending on the mouse action that is modelled in the component or one of its children. These componets tell you what will happen when you use the mouse in MSFS with this button/lever/whatever, and that is what you want to replicate in AAO. They should always be the first place where you start looking. Only when they are missing or don't reveal usable results, you start looking at the other components. Disregards O: and I: variables, they are not accessible from the outside and of no consequence to the actual operation. IE: on the other hand are available in the Events Treelist in AAO in the group "MSFS Input Events" as soon as you are connected and sitting in the cockpit. No need for detective work in the behavior code. Edited January 3, 20242 yr by Lorby_SI LORBY-SI
January 3, 20242 yr Author >> BVars are not deprecated, why would you say that? As an avid manual reader, I took this serious: Quote LVar to BVar mapping (deprecated, do not use) (Bvars are now handled automatically in the background) Normally, the BVar input events, that have been introduced with MSFS SU5, cannot be accessed from an outside app like AAO. AAO goes around this limitation by injecting additional code into the MSFS animation processing pipeline. So I stopped reading that chapter, which was wrong, because it referred to the "mapping", not to BVars. Maybe make this point clearer. Quote Disregards O: and I: variables, they are not accessible from the outside and of no consequence to the actual operation. Should be in the manual. Edited January 3, 20242 yr by dmenne
January 3, 20242 yr Author Reading the BVar chapter again: it is really confusing what is valid and what not. Maybe bette remove everything deprecated?
January 3, 20242 yr Commercial Member 28 minutes ago, dmenne said: Reading the BVar chapter again: it is really confusing what is valid and what not. Maybe bette remove everything deprecated? "the BVar chapter" - in the AAO manual? The one about mapping LVars to BVars? As it says right there, this whole mapping process is no longer necessary = deprecated. You can now use BVars directly in scripts or by adding them to the AAO database, they are just treated the same as all other variables. I cannot see where it says that BVars themselves are obsolete? The chapter is still there for people who want to use the mapping, for example to inject code into the behavior processing of an aircraft. Or if the default process that handles BVars fails, you just never know with MSFS. Be mindful that AAO must be started with the "Run As Administrator" option, or the direct use of BVars won't work. Edited January 3, 20242 yr by Lorby_SI LORBY-SI
January 3, 20242 yr Commercial Member Since SU14 of MSFS the best strategy is to check out the MSFS Input Events first when a button/lever/whatever doesn't react to the default SDK Events. Open the Events Treelist in AAO, go into the group "MSFS InputEvents" and search for an item where the name fits what you are looking for. Test it with a script or button, the "Test 0/1" buttons on the dialog don't work for IEs (that is a bug in AAO). IEs can be observed too, with the Watcher-Dialog in AAO. When you click on something in the cockpit that has an IE: attached, that IE should show up in the AAO observer window - unfortunately all Events show up there, those that are used by the aircraft logic too - you will have to filter a lot to get a result. Alternatively, the Input Events are also on the behavior debug dialog, they have their own tab right next to "Behaviors". Only when default events and Input Events fail, will I start looking at the behavior code, specifically the mouse components as described above. Edited January 3, 20242 yr by Lorby_SI LORBY-SI
January 4, 20242 yr Author >> Test it with a script or button, the "Test 0/1" buttons on the dialog don't work for IEs (that is a bug in AAO). Thanks, important information, because that was one of the dead end I ran into Edited January 4, 20242 yr by dmenne
Archived
This topic is now archived and is closed to further replies.