July 20, 20232 yr Hi - My use of AAO is limited to getting the best out of my Virpil hardware, and exclusively in VR, so no panels, but it's still an awesome solution for doing that. Just gotten hold of the A2A Commanche, and falling in love with it.. My Virpil landing gear lever actually has three positions and so I was excited to see if I could make the best use of the possibility in the EFB of fully using the three way switch in-plane. Trouble is, there is still only the GEAR_UP and GEAR_DOWN functions to call. Obviously I need to program "if in this position and this button called then do this or do nothing" - but my understanding of the code is patchy to say the least - I have managed to create a script for setting or releasing the parking brake which is along the lines of "if parking brake is set, toggle" But - I don't really understand how to allow for "there are 4 positions for the lever, if it's in the top position and the middle button is pressed - move down, or in the bottom position and the middle button then move up" Any help welcome... Chris
July 20, 20232 yr Commercial Member 3 hours ago, BoneDaddy said: My Virpil landing gear lever actually has three positions How does that work exactly, is each position a separate joystick button? Not at my computer at the moment, but MSFS aircraft rarely use or depend on the default events. It will be necessary to take a close look at the gear lever code of this plane in MSFS developer mode. Most likely there are BVars in play. LORBY-SI
July 20, 20232 yr Author Control Panel with landing gear lever Yes - Three separate buttons, the physical lever is quite complex, but each of the three positions triggers a physical button. I'll try to figure this out myself, but hoping to use this as a deeper learning experience with AAO
July 20, 20232 yr Author From code written for StreamDeck (but confirmed does what is says on the tin) GEAR DOWN (L:Gear3waySwitch,·Number)·s1 l1·1·==·if{·0·(>L:Gear3waySwitch,·Number)·} (WAIT:100) 1·(>K:GEAR_DOWN) (WAIT:100) l1·1·==·if{·1·(>L:Gear3waySwitch,·Number)·} GEAR UP (L:Gear3waySwitch,·Number)·s1 l1·1·==·if{·0·(>L:Gear3waySwitch,·Number)·} (WAIT:100) 1·(>K:GEAR_UP) (WAIT:100) l1·1·==·if{·1·(>L:Gear3waySwitch,·Number)·} If the Plane is set to 3 way switch, then this results in (from neutral, off) GEAR UP - gear lever moves to up GEAR DOWN - gear lever moves to off GEAR DOWN - gear lever moves to down So - it will probably be immediately obvious to you, but I cannot fathom how the two codes can be identical except for the K call.
July 20, 20232 yr Author Also - GEAR TOGGLE 0·1·2·1·(L:LandingGearLeverPos,·Number)·(L:A2A3wayGearSw)· 4·iseq·(>L:LandingGearLeverPos,·Number)·(>L:A2A3wayGearSw) Has the effect of moving from off, to up, to off, to down, etc
July 20, 20232 yr Author Got it... tweaking the toggle code to this 1·(L:LandingGearLeverPos,·Number)·(L:A2A3wayGearSw)· 1·(>L:LandingGearLeverPos,·Number)·(>L:A2A3wayGearSw) takes the landing gear lever to the neutral position - knew there would be a way...
July 21, 20232 yr Commercial Member 9 hours ago, BoneDaddy said: Got it... tweaking the toggle code to this 1·(L:LandingGearLeverPos,·Number)·(L:A2A3wayGearSw)· 1·(>L:LandingGearLeverPos,·Number)·(>L:A2A3wayGearSw) takes the landing gear lever to the neutral position - knew there would be a way... I'm not sure what this script is supposed to do. The only active part is this: 1·(>L:LandingGearLeverPos,·Number) The rest does pretty much nothing at all. This LVar is apparently the one that controls the animation of the lever. Make sure that it operates the gear as well, that is not necessarily the case. I haven't got around to look at that lever yet, but I will. LORBY-SI
July 21, 20232 yr Commercial Member Btw. Guenseli has released a package for the Comanche on flightsim dot to. Never mind that it says StreamDeck in the title, the scripts that come with this package are not hardware specific. Edited July 21, 20232 yr by Lorby_SI LORBY-SI
July 21, 20232 yr Commercial Member The gear knob is controlled by a single LVar. If your physical lever sends three distinct Button events, you can either assign the LVar and the associated value directly to each button, or you use RPN scripts. 1. To use an LVar directly, go to "Scripting->Read LVars from Sim". Wait until the process has finished. Then create a new button in AAO and set the LVar as Key Down Event. You can find it by typing "LandingGearLeverPos" into the filter box. Doubleclick the LVar and it will appear in your button definition. Now use the mouse wheel to set the value (0,1 or 2) in the big numerical control box to the right of the KeyDownEvent control. 2. To use scripts instead, just create one for each gear knob position Up:0 (>L:LandingGearLeverPos, Number) Off: 1 (>L:LandingGearLeverPos, Number) Down: 2 (>L:LandingGearLeverPos, Number) Edited July 21, 20232 yr by Lorby_SI LORBY-SI
Archived
This topic is now archived and is closed to further replies.