January 25Jan 25 Hi all, I preface this by saying that I'm not great at scripting, although I am a bit of a hack at getting things to work on various releases and asking lots of questions. I have been trying to program a few switches on the SR-71 with no success, I am aware that it's an early access addon. However, I am persistant. I am trying at this stage, to get at least a few switches programmed to aid in flying this technological marvel, and make it a little more user freindly. I tried using the MSFS IEs without success, as it no inputs are recognised I've also Had a look at behaviors section of the SDK but have'nt been able to figure the scripting aspects of this yet. For example: The Inter panel call button. In the Mouserect section all I have is this: 0x111E4 (>L:SR71_EVENT,enum) and in the Animations/Events Section this: (L:SRFN0C0,bool) 100 * I hoping I might get some guidance moving forward on how to program some these switches to make them operable via hardware peripherals. Kind Regards. T. FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Commercial Member 51 minutes ago, toucanair said: 0x111E4 (>L:SR71_EVENT,enum) That should be almost the same in AAO: 0x111E4 (>L:SR71_EVENT, Number) or 70116 (>L:SR71_EVENT, Number) 0x denotes a hexadecimal number. 111E4 converted to decimal is 70116. "Number" is just a personal preference, "Enum" should work too as Unit. 53 minutes ago, toucanair said: (L:SRFN0C0,bool) 100 * This apparently controls an animation with 100 frames. If you want to know the state of the switch, you would query (L:SRFN0C0, Bool) and get 0 or 1 back. 54 minutes ago, toucanair said: I hoping I might get some guidance moving forward on how to program some these switches to make them operable via hardware peripherals Depends on what kind of peripherals. If you want a toggle on a momentary button, the first script should do the trick. But if you have actual two state switches, you have to create dedicated On and Off scripts using the state variable. LORBY-SI
January 25Jan 25 Commercial Member The developer of this plane also implemented Input Events, which you will find on the normal Event selection dialog in AAO, on the tab "MSFS IEs". Interestingly, the IE assigned to this particular button doesn't seem to work. Only the script from the mouserect at least does "something". Edit: none of the IEs seem to work. Very odd, I wonder why they bothered with implementing them in the first place. Edited January 25Jan 25 by Lorby_SI LORBY-SI
January 25Jan 25 Author 5 hours ago, Lorby_SI said: The developer of this plane also implemented Input Events, which you will find on the normal Event selection dialog in AAO, on the tab "MSFS IEs". Interestingly, the IE assigned to this particular button doesn't seem to work. Only the script from the mouserect at least does "something". Edit: none of the IEs seem to work. Very odd, I wonder why they bothered with implementing them in the first place. Yeah, I thought the same thing. It is a WIP so who really knows what their end game is at this stage. FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Author 6 hours ago, Lorby_SI said: That should be almost the same in AAO: 0x111E4 (>L:SR71_EVENT, Number) or 70116 (>L:SR71_EVENT, Number) 0x denotes a hexadecimal number. 111E4 converted to decimal is 70116. "Number" is just a personal preference, "Enum" should work too as Unit. This apparently controls an animation with 100 frames. If you want to know the state of the switch, you would query (L:SRFN0C0, Bool) and get 0 or 1 back. Depends on what kind of peripherals. If you want a toggle on a momentary button, the first script should do the trick. But if you have actual two state switches, you have to create dedicated On and Off scripts using the state variable. I think in this case, it would be a press and release action, or a toggle button press, e.g The Landing Gear warning silence button on a Thustmaster Warthog Throttle perhaps. Although happy to learn, I'm not proficient at converting hexadecimal to decimal numbers yet. so could probably script just using it's default state for now. I've found most of the switches are a simple on/off two way switch though. Except for the odd lever that has a 0,1,2,3,4 state. I'll try and find an example one of those. I too, did find a list of Lvars in the documents in .xls with a bit of a guide on how they are implemented, although it was a bit above my paygrade understanding it. FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Commercial Member 3 minutes ago, toucanair said: Although happy to learn, I'm not proficient at converting hexadecimal to decimal numbers yet. so could probably script just using it's default state for now. Both scripts work. AAO understands the hexadecimal notation too. And just FYI, you do this conversion with the bog standard Windows Calculator, by setting it to "Programmer" mode. Edited January 25Jan 25 by Lorby_SI LORBY-SI
January 25Jan 25 Author Thank you for this, I just copy/pasted this into Scripts Editor and works like a charm, that was almost too easy. 70116 (>L:SR71_EVENT, Number) the following is a litte more complex and have trouble understanding how it works. It relates to Throttle 1 inlet aft bypass lever, and gets a bit of use in the climb mach acceleration phase and a bit fiddly to use as via a mouse action. probably the best way to implement it would be via a press release down and press release up switch/button hardware. thus this Mousrect: (M:Event) 'WheelUp' scmi 0 == if{ 0x11183 (>L:SR71_EVENT,enum) } els{ (M:Event) 'WheelDown' scmi 0 == if{ 0x11184 (>L:SR71_EVENT,enum) } els{ (M:Event) 'LeftSingle' scmi 0 == if{ (M:RelativeX) (>O:_MouseDownRelativePosX) (E:SIMULATION TIME, seconds) 0.4 + (>O:XMLVAR_FirstUpdateTime) (O:_MouseDownRelativePosX) 0 > if{ 0x11183 (>L:SR71_EVENT,enum) } els{ (O:_MouseDownRelativePosX) 0 < if{ 0x11184 (>L:SR71_EVENT,enum) } } } els{ (M:Event) 'LeftRelease' scmi 0 == if{ 0 (>O:_MouseDownRelativePosX) } } } } FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Author Also, thanks for the explanation. I'll have a practise converting the notation with windows calculator in programmer mode too FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Commercial Member 5 minutes ago, toucanair said: I'll have a practise converting the notation with windows calculator in programmer mode too You don't have to. Just use the native hexadecimals. LORBY-SI
January 25Jan 25 Commercial Member 9 minutes ago, toucanair said: probably the best way to implement it would be via a press release down and press release up switch/button hardware. Or use two separate buttons. Or create a toggle script using the animation variable (assuming that there is one?) LORBY-SI
January 25Jan 25 Author 18 minutes ago, Lorby_SI said: Or use two separate buttons. Or create a toggle script using the animation variable (assuming that there is one?) This is the Animation Variable: (L:SRFF088,number). As to how I would write it out in the actual script section of the script editor, I am still a little lost, sorry. But yes, two separate buttons would work quite well. Edited January 25Jan 25 by toucanair for disambiguity FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Commercial Member 14 minutes ago, toucanair said: As to how I would write it out in the actual script section of the script editor, I am still a little lost, sorry. Isolate the mouse actions and implement the script that they trigger. In this case I would use wheel up and wheel down. One script is 0x11183 (>L:SR71_EVENT, Number) and the other 0x11184 (>L:SR71_EVENT, Number) A toggle script would be a lot more complex, it requires extra code and variables so the app can keep track of what it is supposed to do in which state of the switch. Each press of the button makes the dial turn left, until it reaches the end, then the direction is reversed and each button press makes it go down) (I was probably looking at the wrong dial? The rotary thing directly to the left of the thrust lever? My 0x values are different from yours) (L:SRFF089,·Number)·s0· l0·0·==·if{·1·(>L:ByPassDir)·}· l0·3·==·if{·0·(>L:ByPassDir)·}· (SPLIT:100)· (L:ByPassDir)·1·==·if{·0x11186·(>L:SR71_EVENT,·Number)·}·els{·0x11185·(>L:SR71_EVENT,·Number)·} Edited January 25Jan 25 by Lorby_SI LORBY-SI
January 25Jan 25 Commercial Member This script would move both inlet dials at the same time. But you have to make sure that they are both in the same position initially. (L:SRFF089,·Number)·s0· l0·0·==·if{·1·(>L:ByPassDir)·}· l0·3·==·if{·0·(>L:ByPassDir)·}· (SPLIT:100) (L:ByPassDir)·1·==·if{·0x11186·(>L:SR71_EVENT,·Number)·}·els{·0x11185·(>L:SR71_EVENT,·Number)·} (SPLIT:100) (L:ByPassDir)·1·==·if{·0x11184·(>L:SR71_EVENT,·Number)·}·els{·0x11183·(>L:SR71_EVENT,·Number)·} LORBY-SI
January 25Jan 25 Author 47 minutes ago, Lorby_SI said: :SRFF089,·Number)·s0· l0·0·==·if{·1·(>L:ByPassDir)·}· l0·3·==·if{·0·(>L:ByPassDir)·}· (SPLIT:100)· (L:ByPassDir)·1·==·if{·0x11186·(>L:SR71_EVENT,·Number)·}·els{·0x11185·(>L:SR71_EVENT,·Number)·} Holy Moley! I would never have thought of that at all, that's so clever. Especially the "ByPassDir" part. how does one even come up with that! I modified it somewhat to this. Script Title: LHPanel_LH_Inlet_Bypass_Lever (L:SRFF088,·Number)·s0· l0·0·==·if{·1·(>L:ByPassDir)·}· l0·3·==·if{·0·(>L:ByPassDir)·}· (SPLIT:100)· (L:ByPassDir)·1·==·if{·0x11184·(>L:SR71_EVENT,·Number)·}·els{·0x11183·(>L:SR71_EVENT,·Number)·} and Script Title: LHPanel_RH_Inlet_Bypass_Lever (L:SRFF089,·Number)·s0· l0·0·==·if{·1·(>L:ByPassDir)·}· l0·3·==·if{·0·(>L:ByPassDir)·}· (SPLIT:100)· (L:ByPassDir)·1·==·if{·0x11186·(>L:SR71_EVENT,·Number)·}·els{·0x11185·(>L:SR71_EVENT,·Number)·} 52 minutes ago, Lorby_SI said: (I was probably looking at the wrong dial? The rotary thing directly to the left of the thrust lever? My 0x values are different from yours) You were on the right track, ours are the same, however, there's a left and right lever, the RH lever is a bit obscured by the throttle assembly though. 55 minutes ago, Lorby_SI said: One script is 0x11183 (>L:SR71_EVENT, Number) and the other 0x11184 (>L:SR71_EVENT, Number) having said that, I'll probably go with this format though as I am fortunate enough to have a few switches at my disposal luckily enough. The hardest thing for me is deciphering what the script is telling me it's trying to achieve. FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
January 25Jan 25 Author This one ( MAIN_INST_PANEL_FWD_TRANSFER_SWITCH) seems to be programmed as a toggle: 0x1121E (>L:SR71_EVENT,enum) How would script to be a two way on 1 and then a separate off 0 script. rather than a toggle..... and finally this curveball. which is three way switch for the fuel Derich System on the lower LH console left/off/right: I really do appreciate your guidance and expertise on the above previous by the way, Thank you (O:SwitchState) (>O:PreviousPos) (M:Event) 'WheelUp' scmi 0 == if{ 1 (>O:GoToRelease) g1 } els{ (M:Event) 'WheelDown' scmi 0 == if{ 1 (>O:GoToRelease) g2 } els{ (M:Event) 'LeftSingle' scmi 0 == if{ (M:RelativeY) 0 > if{ g1 } els{ g2 } } els{ (M:Event) 'LeftRelease' scmi 0 == if{ g3 } } } } quit :1 (O:SwitchState) 2 == if{ 1 if{ 1 (>O:SwitchState) (L:SRFA06C,number) 2 == if{ 0x11155 (>L:SR71_EVENT,enum) 1 (>L:SRFA06C,enum) } (L:SRFA06C,number) 0 == if{ 0x11156 (>L:SR71_EVENT,enum) 1 (>L:SRFA06C,enum) } } } els{ (O:SwitchState) 1 == if{ 1 if{ 0 (>O:SwitchState) 0x11156 (>L:SR71_EVENT,enum) 2 (>L:SRFA06C,enum) } } } (O:GoToRelease) if{ g3 } quit :2 (O:SwitchState) 0 == if{ 1 if{ 1 (>O:SwitchState) (L:SRFA06C,number) 2 == if{ 0x11155 (>L:SR71_EVENT,enum) 1 (>L:SRFA06C,enum) } (L:SRFA06C,number) 0 == if{ 0x11156 (>L:SR71_EVENT,enum) 1 (>L:SRFA06C,enum) } } } els{ (O:SwitchState) 1 == if{ 1 if{ 2 (>O:SwitchState) 0x11155 (>L:SR71_EVENT,enum) 0 (>L:SRFA06C,enum) } } } (O:GoToRelease) if{ g3 } quit :3 0 (>O:GoToRelease) quit (O:SwitchState) 100 * (>O:XMLVAR_Fuel_derich_switch_Animation_Position) (O:SwitchState) 100 * (>O:XMLVAR_Fuel_derich_switch_Animation_Target_Position) Edited January 25Jan 25 by toucanair grammer FAA ATP, CASA ATPL(A), MEIR, NVFR, Type Rated: A320, B747,B737, E120, B1900D/C KA350, Multi Ratings: PA31-350, BE58, C310, PN68, PA44, BE76. Checked out on: C210, R114, C206, PA28, C172, C152. Processor: Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz (20 CPUs), ~3.3GHzMemory: 64MB RAM, NVIDIA GeForce RTX 3080 Ti, Multi Monitor.
Create an account or sign in to comment