Jump to content
Sign in to follow this  
kenny584

MSFS2020 C700 AP SPD SET.

Recommended Posts

Hi Folks, I'm trying to set up an SD+ button for the C700 AP SPD toggle using this code from a downloaded script in AAO (L:XMLVAR_SpeedIsManuallySet,·Bool)·!·(>B:AUTOPILOT_Speed_Mode_Set) However, nothng happens in the sim. When I 'RUN' the script in AAO the toggle works in the sim. I've double checked my spelling in the various boxes, now I'm stuck. Can someone give me a clue as to what I should be entering into AAO?

Regards...Kenny.

Share this post


Link to post
Share on other sites

Hello again. My knowledge is very limited at the moment, but so far I have been simply reading the appropriate variable code from the script and typing it into the 'Read' section of the Stream Deck software. Is that what you mean by 'calling the script'? I have attached a screenshot of the content buttons in my 'Thrust' folder. As you will see I am simply typing in what AAO is showing me when I select the action/event from the script. I am even a bit unsure of the correct terminology. I have used this method for the two battery toggles as well as the fuel buttons, the engine start buttons and the APU toggle as well as the external lights. It all works so far and I am in awe of how it all comes together. However, I can't get the autopilot FMS/MAN speed toggle to work by pressing the button in the SD+ and I don't know why.😕

https://www.dropbox.com/scl/fi/0rgzjdjyx015ponhzjm6h/SD-SPD-SET.png?rlkey=wz45iaajp4apmq1qg5pc06m1v&dl=0

Regards...Kenny.

 

Share this post


Link to post
Share on other sites

Apparently you are calling the Script with K: and the script name. I assume that you have checked that the name is correct?

The only obvious thing is, that the BVar name in your Read variable it wrong.

BVars don't have a fixed name. The name is different when you read from or write to it

-> To read from a BVar you use "(B:whatevername)"

-> To write to it, you have to append an "action-word" to the name:
25 (>B:whatevername_Set)
1  (>B:whatevername_Toggle)
1  (>B:whatevername_Inc)
1  (>B:whatevername_Dec)
... and many more. 
(They don't have to all work at the same time, but one of them usually does.)

 


LORBY-SI

Share this post


Link to post
Share on other sites

Mmmm, okay. Thanks for the info, and I know you will shake your head a bit here, but the info is still a bit above my pay grade😵. Here is the Manage Script Groups window. This is what I have been using so far to 'code' my SD+ buttons. I have simply been using the variable part of the line of code and entering it into the Read window in the SD+ software. I have no idea what the L var part of the line means, unfortunately. I'm still wading through the various web pages of documentation, like the FS2020 SDK Events and Variables pages and also the PDF for AAO.

https://www.dropbox.com/scl/fi/f6av0e21b4b21vho8zn0y/Script-Group..png?rlkey=29yqg5d3ml5knl2arb7i92rei&dl=0

I appreciate your help.

Cheers...Kenny.

Share this post


Link to post
Share on other sites

Does that script work, did you test it? AAO must be connected to the simulator and the correct aircraft loaded (they are all diffferent), then a "Test" button will appear on the script editor window in AAO.

And, as said above, you have to correct the BVar name in the "Read variable" of your StreamDeck Button. Whatever you were planning to do with it, what you have in the B: textbox now "AUTOPILOT_Speed_Mode_Set" will never return a value, it must be changed to "AUTOPILOT_Speed_Mode" (without the "_Set" as I tried to explain above).

The LVars, Bvars etc. are all variables, assets of the simulator itself, that contain values (= they have basically nothing to do with the AAO app - AAO is just a translator between you and the MSFS SDK). LVars and BVars in particular are invented by the aircraft developers, there is usually no spec for or explanation of them, not even their existence is documented. To find out what variables of what type are required exactly for a specific task is a steep learning curve and will require familiarizing yourself with the MSFS developer mode. Or find somebody who did it for you, by downloading ready made profiles (for example for the StreamDeck) from flightsim.to.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
51 minutes ago, kenny584 said:

the info is still a bit above my pay grade

If you are going to create your own scripts or StreamDeck actions, there is no way around requesting a raise.


LORBY-SI

Share this post


Link to post
Share on other sites
2 hours ago, kenny584 said:

I have no idea what the L var part of the line means,

This script is a toggle.

1. The LVar is suppsed to contain 0 or 1 depending on whether the associated aircraft system is off or on (IF that is indeed the correct variable for the aircraft in question - they are all different!!)
2. "!" is the "not" operator, it will flip the value from 0 to 1 / 1 to 0
3. (>B writes the result to the Set part of the BVar. 1 for ON and 0 for OFF

So if the LVar was 1/on, it will be switched off, and vice versa. 

 (there is a chapter about RPN scripting in the MSFS SDK documentation and in the AAO manual too, there is a table with all RPN operators).

Reverse Polish Notation (flightsimulator.com)

(on a side note - IMHO the script should look like this, but that is just me - "read the BVar, flip it, write back the result")
(B:AUTOPILOT_Speed_Mode)·!·(>B:AUTOPILOT_Speed_Mode_Set)

Edited by Lorby_SI
corrected the script

LORBY-SI

Share this post


Link to post
Share on other sites

And finally - you don't have to create the scripts in AAO and call them from the StreamDeck. You can send code directly too

In the StreamDeck action select "S:" as the Key Down Event, and then enter the script code "(B:AUTOPILOT_Speed_Mode) ! (>B:AUTOPILOT_Speed_Mode_Set)" directly into the textbox. Nothing to do in AAO itself in this case.

Edited by Lorby_SI
Corrected the script - sorry!

LORBY-SI

Share this post


Link to post
Share on other sites
3 hours ago, Lorby_SI said:

If you are going to create your own scripts or StreamDeck actions, there is no way around requesting a raise.

Wow, thank you so much for elaborating and communicating that info. I appreciate it once again. My apologies for the late reply. I fly online with a friend on a Friday evening. I'll read and digest all that you have written.

Best Regards...Kenny.

p.s. I said to my wife earlier, that for me, it is like learning to bake a loaf of bread and asking what flour is!! Still, I'm keen to learn. Cheers.👨‍🎓

Share this post


Link to post
Share on other sites

I just ran a quick test with the default Longitude to see if the scripts are working:

This
(B:AUTOPILOT_Speed_Mode) ! (>B:AUTOPILOT_Speed_Mode_Set)
definitely works.

This
(L:XMLVAR_SpeedIsManuallySet, Bool) ! (>B:AUTOPILOT_Speed_Mode_Set)
is also working, but it seems more like an accident. The first one is better.

And for completeness sakes, this
(IE:AUTOPILOT_Speed_Mode) ! (>IE:AUTOPILOT_Speed_Mode)
is also working, IF you have the MSFS developer mode active (this has already been acknowledged by Asobo as a bug, it should work outside of devel mode too)

Of the three, the last one (native MSFS input events) would be the best option, it is the fastest and least "expensive" in terms of performance .

To READ the current state of the Speed mode you can use either
(B:AUTOPILOT_Speed_Mode)
or
(L:XMLVAR_SpeedIsManuallySet, Bool)
or
(IE:AUTOPILOT_Speed_Mode)

(but IEs currently only work with MSFS devel mode turned ON)

 

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Hello again.

I do have Developer mode turned on, and I have been trying to figure out when and how to make use of the Behaviours section. I find it quite overwhelming at the moment because I do not fully understand all of the jargon. I have never seen the IE variables before. I'll need to find out more about them. Thanks for taking the time to test that input. I'm a retired firefighter, and as such, I have had zero dealings with RPN prior to going down the rabbit hole of trying to make aircraft work without a mouse!!...LOL

Cheers...Kenny.

Share this post


Link to post
Share on other sites
2 hours ago, kenny584 said:

I find it quite overwhelming at the moment because I do not fully understand all of the jargon.

That is to be expected. For one, all the code is backwards (hence the "reverse notation" - this is how computers worked 40 years ago - I still remember that time 🙂 ) and then nobody seems to care about any specs or rules. All the aircraft developers implement their stuff as they see fit, and more often than not, they are doing it differently

2 hours ago, kenny584 said:

I have never seen the IE variables before.

For one, they only exist in AAO - I invented this acronym to distinguish them from the others - secondly, they are in fact new, Asobo made them available only recently in SU13. Except for the fact that they only work in devel mode - but I posted that in their devel forum and they ackowledged it as a bug not a day later. I had a few discussions with one of their guys over the input events, and I have to say that Asobo actually has very good support.

IEs seem to be kind of a "wrapper" around the HVars and BVars. I found a lot of InputEvent names to be similar to the BVars and HVars. But they don't have to be similar, I found the opposite too (in the new Black Square TBM 850)

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Righto. I need to delve deeper into the syntax of all of this. Hopefully, I will have a 'lightbulb' moment somewhere along the tracks. I've always been simply an end user of sims right from the Psion software days.

Cheers...Kenny.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...