February 20, 20242 yr Hi there, I use my StreamDeck as a virtual checklist - I have folders with each of the checklist items for a given airplane laid out in order. I try, where possible, to include buttons that represent the checklist items. For example, when I switch a battery on, I have a battery button from a profile I've previously downloaded that shows the state of the button, and the button can be pressed to toggle the state. Where I'm at is adding in a toggle button to represent variables that I create. For example, I would like a toggle button I can press that reflects that I have filed a flight plan. I don't need it to actually know that I've filed a flight plan, just to remember that I have done so. I've got the toggle button already, and I've created a boolean variable A:FileFlightPlan in AAO. What I can't get the button to do is toggle the value, and I assume I'll need to write a script in RPN to toggle this... It's just I'm not a programmer and I don't know RPN. Are you able to help? Cheers, Cameron.
February 20, 20242 yr Author I just tried getting Bing Copilot to write the code for me and it came up with: <%FileFlightPlan%> 1 - 1 max AAO is showing this in error state. Any thoughst?
February 20, 20242 yr Commercial Member 4 hours ago, C414AC said: A:FileFlightPlan in AAO. 1. You cannot create A: Variables. They are fixed and hard-coded assets from the simulator's SDK. You can only create L: Variables. 2. Variables don't have to be "created" anywhere. They begin to "live" when they are first used in a script or assignment - there nothing else to do. 3. Assuming that your variable can only ever be 0 or 1, this is the toggle-code: (L:FileFlightPlan) ! (>L:FileFlightPlan) "read variable value - negate it - write the value back in the variable" 4. No, this variable does not need a unit. Check the AAO manual, section about LVars. If you add a unit to the LVar, like (L:whatever, Bool), then AAO will synchronize it with the simulator - but the sim doesn't need the variable, it would needlessly clog up the SimConnect interface. Edited February 20, 20242 yr by Lorby_SI LORBY-SI
February 20, 20242 yr Commercial Member 3 hours ago, C414AC said: It's just I'm not a programmer and I don't know RPN. That is not a good starting point. I would suggest to take a look at the MSFS SDK spec: Reverse Polish Notation (flightsimulator.com) And the AAO manual of course, the dialect is more powerful that what the sim itself offers. 3 hours ago, C414AC said: I just tried getting Bing Copilot to write the code How would an AI know how to write flightsim RPN code? That is a very specific dialect. Edited February 20, 20242 yr by Lorby_SI LORBY-SI
February 21, 20242 yr Author 9 hours ago, Lorby_SI said: 1. You cannot create A: Variables. They are fixed and hard-coded assets from the simulator's SDK. You can only create L: Variables. I believe you but I'm confused. If I open the Input Custom Variable dialog, I get the option to specify A: and after I do, it shows up in Watch Simulator Variables 9 hours ago, Lorby_SI said: (L:FileFlightPlan) ! (>L:FileFlightPlan) So thank you, I made progress. I pasted your code into a new script saved in the "Scripts" script group and named Toggle_FlightPlanFiled. I pasted that script name into a toggle button in Stream Deck in the Key Down event box (with K:), and I have the variable name FileFlightPlan in the Read box with L: selected. Initially the toggle button endlessly turned on and off without me pressing it, even though I hadn't specified "repeating" within the Script Editor, but within Aircraft Automated Scripts, it was set as repeating, which I've now changed to one shot. It's now working as intended, thank you! 9 hours ago, Lorby_SI said: 13 hours ago, C414AC said: It's just I'm not a programmer and I don't know RPN. That is not a good starting point. I would suggest to take a look at the MSFS SDK spec I don't disagree! But I needed to get a few real-world examples sorted to get my head around some basics. Thanks again.
February 21, 20242 yr Commercial Member 6 hours ago, C414AC said: within Aircraft Automated Scripts, Why did you add it to the automated scripts??? This is not required for operating scripts. Global and Aircraft Automated Scripts are a specialized feature, designed to constantly repeat one or more scripts at runtime. In addition they can fire scripts only when your aircraft is loaded or when it is unloaded from the sim (One Shot, usually used for initialization purposes). In your case, it did exactly what it was designed to do, it constantly repeated your script. With your current setting the script will be fired once every time you load your aircraft. I seriously doubt that this is what you want, and I'd suggest that you remove this and any other script from the Automated Scripts, unless you actually want them to repeat. Edited February 21, 20242 yr by Lorby_SI LORBY-SI
February 21, 20242 yr Commercial Member 6 hours ago, C414AC said: I believe you but I'm confused. If I open the Input Custom Variable dialog, I get the option to specify A: and after I do, it shows up in Watch Simulator Variables The lists in AAO contain the variables and events that were specified in the SDK at the point in time that this AAO version was built. But the development of the simulators is not static, especially MSFS is receiving updates all the time. With these dialogs you can tell AAO about variables and events that it doesn't know about. For example new A: variables, that were added to the SDK after AAO had been released, or variables that you found in aircraft/behavior code that aren't listed in the SDK spec at all. You don't have to do this, you can also just use the variable in a script. But sometimes people want to assign them to a button or axis directly, without going through a script - and then they can add it to the database here. These dialogs are not for "defining variables". Again - the only custom variables that you as a user can create and operate are L: variables. All the other types are either SDK or animation/behavior assets, out of your control. And LVars don't have to be "defined" anywhere, you just use them in code as required. Edited February 21, 20242 yr by Lorby_SI LORBY-SI
February 21, 20242 yr Author 2 hours ago, Lorby_SI said: Why did you add it to the automated scripts??? I didn't! At least not intentionally. But I found it referenced there.
February 21, 20242 yr Commercial Member 44 minutes ago, C414AC said: I didn't! At least not intentionally. But I found it referenced there. A script cannot add itself to the Automated Scripts (unless it is part of a template that you import), you have to do it manually? In any case, make sure that there is nothing in the Global and Aircraft Automated Scripts that doesn't belong there. LORBY-SI
Archived
This topic is now archived and is closed to further replies.