July 21, 20241 yr Commercial Member 53 minutes ago, joker20001911 said: No problem. Yes it seems that way. The read variable for the cabin only seems to work if a cabin light is on, not when you flip the cabin switch. Hmm OK, I get it now. There problem here is, that reading the value like I did above actually doesn't work like that. This is something that only the sim can do internally. You will have to create a script like this: Group: Scripts (or whatever you want) Title: UpdateBus1516 Code: (SIMPROC) 16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool) (>L:BusCon1615, Number) Then, on the StreamDeck, you establish this as an autoscript (at the bottom of the page) "Scripts-UpdateBus1516" and as the read variable you use "L:" and "BusCon1615, Number" in the box, ON Value = 1 I am using the "Toggle" SD Action. What is happening now is that the SD action directs the sim to write the desired value into an LVar, which can then be read from anywhere. Yes, this is more involved than usual. Normally developers provide LVars to read the switch position. That you stumbled right into the mess of the electrical bus lookup was just bad luck, normally the process is not that involved. Edited July 21, 20241 yr by Lorby_SI LORBY-SI
July 21, 20241 yr 14 minutes ago, Lorby_SI said: OK, I get it now. There problem here is, that reading the value like I did above actually doesn't work like that. This is something that only the sim can do internally. You will have to create a script like this: Group: Scripts (or whatever you want) Title: UpdateBus1516 Code: (SIMPROC) 16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool) (>L:BusCon1615, Number) Then, on the StreamDeck, you establish this as an autoscript (at the bottom of the page) "Scripts-UpdateBus1516" and as the read variable you use "L:" and "BusCon1615, Number" in the box, ON Value = 1 I am using the "Toggle" SD Action. What is happening now is that the SD action directs the sim to write the desired value into an LVar, which can then be read from anywhere. Yes, this is more involved than usual. Normally developers provide LVars to read the switch position. That you stumbled right into the mess of the electrical bus lookup was just bad luck, normally the process is not that involved. This definitely worked! I never would have known that. Thank you so much for your help. I will try to do the same for the access button to have it change state on the SD too. But pushing the button on SD does make it work in game. Thank you again!
July 21, 20241 yr Commercial Member Btw. when you know that you will always only be using the StreamDeck and not click on the switch from within the cockpit, you could wrap it into one single line of code that you assign to the Down event: (SIMPROC) 15 16 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE) 16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool) (>L:BusCon1615, Number) This would toggle the bus connection and immediately write the value into the LVar, that you can then read with the action. You don't need an autoscript with this, but it will not show the state of the switch correctly when you click on the switch in the cockpit with the mouse. LORBY-SI
July 21, 20241 yr Commercial Member 5 minutes ago, joker20001911 said: I will try to do the same for the access button to have it change state on the SD too. That is just an LVar. No way near as complicated. I posted that somewhere above. Read variable is type "L" and "var_AccessLights_Button, Number" goes into the box. ON value is "1" Edited July 21, 20241 yr by Lorby_SI LORBY-SI
July 21, 20241 yr 4 minutes ago, Lorby_SI said: Btw. when you know that you will always only be using the StreamDeck and not click on the switch from within the cockpit, you could wrap it into one single line of code that you assign to the Down event: (SIMPROC) 15 16 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE) 16 (>A:BUS LOOKUP INDEX, Number) (A:BUS CONNECTION ON:15, Bool) (>L:BusCon1615, Number) This would toggle the bus connection and immediately write the value into the LVar, that you can then read with the action. You don't need an autoscript with this, but it will not show the state of the switch correctly when you click on the switch in the cockpit with the mouse. I do like to click the switches now and then. I appreciate that code and may use in the future if I will only be using SD.
July 21, 20241 yr Alright. Thank you again for the help! Now on to the avionics switches. LOL! Should I create a new topic if I can't find it within a search on this site for additional assistance?
July 21, 20241 yr Commercial Member Just now, joker20001911 said: Alright. Thank you again for the help! Now on to the avionics switches. LOL! Should I create a new topic if I can't find it within a search on this site for additional assistance? The procedure is always the same. 1. Look for a ready made scripts package or SD profile for this aircraft on flightsim.to 2. If you don't find any, or want to do it yourself, - Maybe try the default simulator events first - then/or look for an MSFS Input Event in the event group of that name in the usual event treelist in AAO. - then/or use the MSFS developer mode (Tools->Behaviors, "click back into the sim, hover the mouse over the button/switch/lever and press Ctrl-G") to find out how a switch is operated and what the variable is that controls its animation. Replicate that in AAO/on the StreamDeck LORBY-SI
July 21, 20241 yr Commercial Member 6 minutes ago, joker20001911 said: Now on to the avionics switches. TBM850 (BlackSquare) StreamDeck XL & PLUS profile and AAO Scripts for Microsoft Flight Simulator | MSFS LORBY-SI
July 21, 20241 yr 1 minute ago, Lorby_SI said: TBM850 (BlackSquare) StreamDeck XL & PLUS profile and AAO Scripts for Microsoft Flight Simulator | MSFS The creator of that profile says to do this Import the AAO script AxisAndOhsScripts_BKSQ_TBM.xml according to the AAO manual how do I do that! I actually saw that one but didn’t know how to import them and I did read the manual but may have missed it
July 21, 20241 yr Commercial Member 3 minutes ago, joker20001911 said: may have missed it Scripting->Import Scripts LORBY-SI
Create an account or sign in to comment