August 27, 20223 yr Hi, So - trying to learn how to use Axis and Ohs to write my own scripts, I'm trying to do a "landing gear up" command. OK, so look at the xml in the behaviors, I see in relevant parts; <!-- 455 - LANDING GEAR Lever ############################# --> <Component ID="ngx_switch_455_a" Node="ngx_switch_455_a"> <UseTemplate Name="ASOBO_GT_Anim_Code"> <ANIM_NAME>ngx_switch_455_a</ANIM_NAME> <PART_ID>NGX_SWITCH_455_A</PART_ID> <ANIM_LENGTH>100</ANIM_LENGTH> <ANIM_CODE> (L:switch_455_73X, number) <CALLBACKCODE> 455 100 * (>L:SwitchID, number) So, I read lvars from sim, and got 0, 30, 60 for the switch_455_73X changes when I use the gear handle, but I'm not sure how to convert these into my script to hit the K:ROTOR_BRAKE action? I've tried 45500 (>K:ROTOR_BRAKE) but it doesn't move the handle to up which the 0 value for switch 455 reads. Sorry for the basic question but my seach-fu hasn't found a formula for (switch number X plus value Y = Z to rotor_brake). TIA.
August 27, 20223 yr Commercial Member You left out the part where the behavior logic actually processes the mouse events ("LeftSingle" = single click with the left mouse button) <CALLBACKCODE> 455 100 * (>L:SwitchID, number) (M:Event) 'LeftSingle' scmp 0 == if{ (M:RelativeY) 0 > if{ (L:SwitchID, number) 2 + (>L:SwitchID, number) } els{ (L:SwitchID, number) 1 + (>L:SwitchID, number) } } (M:Event) 'Move' scmp 0 == if{ (L:SwitchID, number) 3 + (>L:SwitchID, number) } (M:Event) 'LeftRelease' scmp 0 == if{ (M:RelativeY) 0 > if{ (L:SwitchID, number) 5 + (>L:SwitchID, number) } els{ (L:SwitchID, number) 4 + (>L:SwitchID, number) } } (M:Event) 'RightRelease' scmp 0 == if{ (L:SwitchID, number) 5 + (>L:SwitchID, number) } (M:Event) 'MiddleSingle' scmp 0 == if{ (L:SwitchID, number) 6 + (>L:SwitchID, number) } (M:Event) 'WheelUp' scmp 0 == if{ (L:SwitchID, number) 7 + (>L:SwitchID, number) } (M:Event) 'WheelDown' scmp 0 == if{ (L:SwitchID, number) 8 + (>L:SwitchID, number) } (L:SwitchID, number) (>K:ROTOR_BRAKE) </CALLBACKCODE> So the correct ROTOR_BRAKE codes would be: (455 * 100) + n, and n going from 1 to 8. This particular lever is a bit tricky, because the actual code depends on where you click on the lever "(M:RelativeY)" Can't test it right now, but I assume that 45502 (>K:ROTOR_BRAKE) 45505 (>K:ROTOR_BRAKE) moves it one direction 45501 (>K:ROTOR_BRAKE) 45504 (>K:ROTOR_BRAKE) moves it the other direction It looks like you don't need the "LeftRelease" every time you send a "LeftSingle" mouse event. I just like to add them anyway, because I simply don't know if the 737 will handle mouse events correctly where the left button is always only pressed but never released. Edited August 27, 20223 yr by Lorby_SI LORBY-SI
August 27, 20223 yr Commercial Member Just for completeness sakes, you don't have to script this if you just want to assign it to a button. In this example: Select "ROTOR_BRAKE" as the key down event, then dial in 45501 into the little numerical box to the right of the selector (that box contains the value that is sent with this event). Or doubleclick the numerical box and type 45501. If you want to be thorough, do the same with key up, and set a value of 45504 there. LORBY-SI
August 27, 20223 yr Commercial Member And one last thing: be mindful that the LVar is the animation variable. It tells you that the lever in the VC is moving/has been moved - it does NOT tell you that the gear is up. Edited August 27, 20223 yr by Lorby_SI LORBY-SI
August 27, 20223 yr Author Ah, OK. I'll play around with those. Basically what I'm after is up, pause (10 seconds) then down (and vice-versa for gear up). Generically gear up should be starting from gear down, so from position (down) move to position (up). going down should start from off. Fun and games! Thanks for the pointers, Edited August 27, 20223 yr by Peter Clark
September 8, 20223 yr Here is the GEAR UP code: 1 (>K:GEAR_UP) (WAIT:10000) 45501 (>K:ROTOR_BRAKE) (WAIT:2000) 46002 (>K:ROTOR_BRAKE) | i7-14700KF - 4080 SUPER | 32 GB RAM | Win 11 Pro | HC Bravo | AAO | StreamDeck |
Archived
This topic is now archived and is closed to further replies.