August 2Aug 2 So I'm new to scripting, and I'm trying to write a collection of scripts for AAO that I can use to map my Behringer X-Touch Mini's button and rotaries to the FCU/MCP in the new Synaptics A220. I've got the latest AAO installed (Which works fine with my hardware using scripts written by a guy named Guenseli (flightsim.to) for several other airliners), and I asked AI to write me a script, for starters and to try and learn the process, to toggle the captain's flight director on/off. This is the code it gave me:(L:A220_FCU_FD_Status, Number) 0 == if{ 1 (>L:A220_FCU_FD_Status, Number) } its{ 0 (>L:A220_FCU_FD_Status, Number) } 1 (>L:A220_FCU_FD_Btn, Number)So...I created a new script group (A220), gave the new script a title (FD_On), and pasted this code into the large white box, as per instructions. I then saved it "as new", and I then went and mapped it to a button on my X-Touch. Further, I confirmed the plane was in a state where the FD COULD be enabled (IRs aligned) by pressing it in game with my mouse, and it came on. So I then tested my newly programmed button, and...nothing.Now, the first thing I will say is, the code above does not match the format and phrasing that is published directly from Synaptics. That said, I replaced the core lvar phrase above with the one from their publication, and it still didn't work. And the word "Number" in there doesn't seem right, but the instructions didn't say anything about changing it, so I didn't.All that said...and I'm not even sure if my procedure is correct and would yield a working switch even with correct code.Sooo...my question is, is there anyone out there who could possibly look at this and determine whether I'm anywhere close to being on the right track? It would surely be appreciated if so. Thanks!
August 2Aug 2 Commercial Member 2 hours ago, Capt Jingles said:its{This operator does not exist. Should probably read "els{"2 hours ago, Capt Jingles said:the code above does not match the format and phrasing that is published directly from SynapticsAnd what is the published format? 2 hours ago, Capt Jingles said:And the word "Number" in there doesn't seem rightThis is the "unit" of a variable. For SDK AVars it is usually something like ", Knots", ", Feet" etc. If you don't know the unit, use ". Number". For simulator LVars, ", Number" is mandatory in AAO - see manual, chapter about "Scripting". LORBY-SI
August 2Aug 2 Author Here's the link to the posting they advised to go get their variables. The FD vars are referenced at the end of the Fight Control Panel section.SimVars | Synaptic DocsIndex of all simulator variables (L-Vars and H-Events) that the A220 reads and writes, organized by system. These can be used to read and modify the aircraft state's using external applications.
August 2Aug 2 Commercial Member I'm sorry, but I don't own this aircraft, so I can only guess. I would try this:1 (L:A22X L Flight Director, Bool) - (>L:A22X L Flight Director, Bool) 1 (L:A22X R Flight Director, Bool) - (>L:A22X R Flight Director, Bool)**************To explain my code above: funtionally my script is identical to this:(L:A22X L Flight Director, Bool) 0 == if{ 1 (>L:A22X L Flight Director, Bool) } els{ 0 (>L:A22X L Flight Director, Bool) }************** Edited August 2Aug 2 by Lorby_SI LORBY-SI
August 2Aug 2 Author So I fed the modified code ( I added underscores) into AI and asked it to write the code again. It gave me this:(L:A22X_L_Flight·Director,·Number)·0·==·if{·1·(>L:A22X_L_Flight·Director,·Number)·}·els{·0·(>L:A22X_L_Flight·Director,·Number)·}This didn't work either.I will now try your code, first with spaces, then with underscores.Thank you!
August 2Aug 2 Commercial Member BTW. If you want to get all those LVars into AAO's lists, load the plane in the sim and then run "Scripting->Read LVars from sim" . After this has completed, you can select the variables from the internal AAO lists - that rules out typos. Edited August 2Aug 2 by Lorby_SI LORBY-SI
August 2Aug 2 Commercial Member Also, I would check the page "MSFS IEs" on the AAO event selection dialog. Normally, developers are supposed to provide IEs = "Input Events". Edited August 2Aug 2 by Lorby_SI LORBY-SI
August 2Aug 2 Author Unsurprisingly...YOUR code works (with spaces)! Thank you so much! 😀Now I just gotta figure out everything that isn't a toggle switch, like rotaries, multi-position switches, etc. Would be really satisfying to be able to do this all myself! Then I'll need to learn how to plug everything into the Streamdeck XL.Seriously...thank you for the help. I'll try not to be a pest as I learn.Jingles
August 2Aug 2 Commercial Member Just now, Capt Jingles said:Unsurprisingly...YOUR code works (with spaces)! Thank you so much! 😀Now I just gotta figure out everything that isn't a toggle switch, like rotaries, multi-position switches, etc. Would be really satisfying to be able to do this all myself! Then I'll need to learn how to plug everything into the Streamdeck XL.Seriously...thank you for the help. I'll try not to be a pest as I learn.JinglesThe web page seems to be comprehensive, it also mentions when a LVar is read-only (=they cannot be used to operate a switch, only to read its state/position). There is also a second list with default simulator SDK events that can be used, there just wasn't one for the FD (at first glance). Edited August 2Aug 2 by Lorby_SI LORBY-SI
August 3Aug 3 Author OK so, as I mentioned, I'm completely new to RPN scripting; which is to say, I don't understand it at all. But I did enough research to understand that YOUR script (which worked)...1·(L:A22X·L·Flight·Director,·Bool)·-·(>L:A22X·L·Flight·Director,·Bool)...is essentially just popping "1" into a buffer and subtracting the value retrieved from the first expression (L:A22X L Flight Director, Bool) from the buffer value, and popping into back into the same variable via the > the second expression. Hence, the result is going to always be the binary inverse of that variable's original value.So, imagine my confusion when I go then and use that same format - that same core code in fact - to program several other Boolean variables and literally NONE of them work! E.G...1·(L:A22X·FG·Approach,·Bool)·-·(>L:A22X·FG·Approach,·Bool)In general, this script does nothing. The only sign that anything is even being sent to the sim is that every 3rd...6th...10th time you hit the button, the light above the APPR button in the sim will blip on for maybe a 1/10 of a second, then blip back out. APPR mode is never engaged.So I apologize, but I'm thoroughly confused. I don't know how to proceed if the same logic that works on one Boolean LVAR doesn't work on another Boolean LVAR.
August 3Aug 3 Author And the debug window seems to indicate the script is working properly. I don't know how to paste an image, but this is the output in the debug window:1 (L:A22X FG Approach, Bool) - (>L:A22X FG Approach, Bool)1 0 - (>L:A22X FG Approach, Bool)1 (>L:A22X FG Approach, Bool)
August 3Aug 3 Commercial Member Does the Synaptic list say that you can write to this LVar? Many of them are read-only and you will have to use an Event from the other list. LORBY-SI
August 3Aug 3 Author 28 minutes ago, Lorby_SI said:Does the Synaptic list say that you can write to this LVar? Many of them are read-only and you will have to use an Event from the other list.I saw you mention that yesterday; I can't see a specification on any of the lvars for read-only. Where do you see it?This is the entry for the APPR mode lvar.L:A22X FG ApproachBoolWhether approach mode is armed or engaged
August 3Aug 3 Author OK, I get it now...the MSFS IE's...yes, the APPR button is just using the default button. OK, now I get it! I've setup quite a number of planes in my X-Touch, and this might be the first one that used a lvar from that list!Thank you again!Jingles
August 3Aug 3 Author Oh, if you could though please, let me know how you can tell which ones are R/O vs programmable. I can't tell.
Create an account or sign in to comment