January 5, 20251 yr Hi Everyone, New here and very new to stream deck, I have spent a few days playing around with it using AAO and have managed to work out quite a lot so far however one thing seems to be causing me quite the headache. Adjusting the glareshield lighting!! I want to have 2 buttons for this - one to increase the lighting by 10% and one to decrease by 10% - I know I also need to put limits in to stop it going over 100% and definitely to stop it going below 0% so I found a video on YouTube by Keith Butcher that has been very helpful with almost everything I've learnt this week with the exception of the glareshield. In the Video he writes scripts for potentiometers which all make sense to me including the upper and lower limits however the events and variables for the glareshield seem to be confusing me as it has its own and not a potentiometer. The script in the video was (A:LIGHT POTENTIOMETER:3, PERCENT) 90 <= if{(A:LIGHT POTENTIOMETER:3, PERCENT) 10 + 3 (>K:2:LIGHT_POTENTIOMETER_SET)} This works in my sim for the correct potentiometers but for the life of me I cannot seem to get the right events and variables for the glareshield into a format like this. As I say I'm very new so I'm really hoping someone has a script that will do what I'm hoping that I can copy from maybe with an explanation of how it works to help me understand maybe where I have gone wrong. Thank you in advance to anyone who can help 🙂
January 5, 20251 yr Commercial Member 1 hour ago, Sanguinus0014 said: (A:LIGHT POTENTIOMETER:3, PERCENT) 90 <= if{(A:LIGHT POTENTIOMETER:3, PERCENT) 10 + 3 (>K:2:LIGHT_POTENTIOMETER_SET)} First, let's simplify that a bit (A:LIGHT POTENTIOMETER:3, PERCENT) 10 + 100 min 3 (>K:2:LIGHT_POTENTIOMETER_SET) and for the decrease (A:LIGHT POTENTIOMETER:3, PERCENT) 10 - 0 max 3 (>K:2:LIGHT_POTENTIOMETER_SET) "100 min" and "0 max" limit the value being passed on to the K-Event to the range between 0 and 100. The "3" in this script is the index of the potentiometer. You just have to find the right one. You would typically do this using the MSFS developer mode. Activate dev mode, open Tools->Behaviors, then click back into the sim, hover your mouse over the control you are interested in and press Ctrl-G. This will usually bring up the behavior code of the knob/button/lever that you are targetting. Check out the "MouseRect" components to find out what happens when you use the mouse on this control, and replicate that in AAO. With MSFS 2024 there often are InputEvents/BVars in play - you will find those in AAO too, in the tab "MSFS Input Events". Not at my sim at the moment, but I will try to look into the 152 later and post an example. Edited January 5, 20251 yr by Lorby_SI LORBY-SI
January 5, 20251 yr Author Thank you that does look a much simpler way to write it. Im struggling with the glareshield woth it not being a potentiometer but I'll try what you've suggested to find it on Dev mode.. Managed every thing I wanted so far with the 152 but the glareshield of all things has alluded me haha Thank you for the advice and thanks for the awesome programme as its adding so much more to the hobby.
January 5, 20251 yr Commercial Member 1 hour ago, Sanguinus0014 said: Thank you that does look a much simpler way to write it. Im struggling with the glareshield woth it not being a potentiometer but I'll try what you've suggested to find it on Dev mode.. Managed every thing I wanted so far with the 152 but the glareshield of all things has alluded me haha Thank you for the advice and thanks for the awesome programme as its adding so much more to the hobby. I assume that you are talking about the knob to the right of the Magneto switch/Ignition key? That one is controlled by an InputEvent - no need to dive that deep into the simulator code and dabble in AVars or KEvents. (IE:LIGHTING_GLARESHIELD_1) will suffice. You can find this input event in AAO too, when you are sitting in the cockpit, open the script editor, press "Insert simevent", immediately start typing "glareshield" and press "Enter". This will apply the filter feature and reduce all the lists to items that have "glareshield" in their name. Now go to the tab "MSFS IEs" - there it is. Doubleclick it into the script editor so you can play with it. When there is an IE, you have several options: 1. Use a script much like the ones above: (IE:LIGHTING_GLARESHIELD_1) 10 + 100 min (>IE:LIGHTING_GLARESHIELD_1) (IE:LIGHTING_GLARESHIELD_1) 10 - 0 max (>IE:LIGHTING_GLARESHIELD_1) 2. But you don't have to. Most IEs can be accessed as a BVar (as you will see in the behavior code) by simply adding a "do-word" at the end of the name: 1 (>B:LIGHTING_GLARESHIELD_1_Inc) 1 (>B:LIGHTING_GLARESHIELD_1_Dec) To read the value use either (IE:LIGHTING_GLARESHIELD_1) or (B:LIGHTING_GLARESHIELD_1) (On the StreamDeck you just select type "B:" and put "LIGHTING_GLARESHIELD_1_Inc" into the box, plus the 1 as the event value.) IMHO, for most applications the BVar is the most convenient option. (btw: you can enter entire scripts on the StreamDeck actions too - by using type "S:" and just pasting the entire code into the box. Don't forget the event value, that can't be empty). Edited January 5, 20251 yr by Lorby_SI LORBY-SI
January 5, 20251 yr Author Thank you so much As soon as I get home I will give this a try!! Hopefully over the coming weeks I'll get a deeper understanding as this is the first time I've ever tried anything like this. 😀
January 5, 20251 yr Commercial Member Especially with MSFS2024, using "Scripting->Watch Simulator Events" in AAO is a good option too. Select "Ignore spam", and when things calm down, operate the knob/button/lever that you are interested in with the mouse. If the developer chose to implement inpute events, they will appear on the dialog, including their value(s) (which are very important). LORBY-SI
Create an account or sign in to comment