- Messages
- 10,163
- Country

Hey all,
I have created a neat little 'emergency landing gear crank' system that has an appearence code, will crank the gear down, etc. But, it must be cranked/clicked 36 times to get the landing gear down.
I was curious, if there is a way to loop a command to function 36 times. Realizing that switches cycle 18 times a second, this would have to cycle every rotation of the crank.
Flowchart;
* Click on crank (has already appeared)
* Landing gear lever is toggled down
* Crank turns once, resets, turns again
* At turn 36, it stops, landing gear is down.
I need to also figure out a Y axis rotation, as the back and fourth motion isnt very realistic, lol... I am working on that.
Here is the code so far which includes the appearence code, but not a loop system as of yet.
I have created a neat little 'emergency landing gear crank' system that has an appearence code, will crank the gear down, etc. But, it must be cranked/clicked 36 times to get the landing gear down.
I was curious, if there is a way to loop a command to function 36 times. Realizing that switches cycle 18 times a second, this would have to cycle every rotation of the crank.
Flowchart;
* Click on crank (has already appeared)
* Landing gear lever is toggled down
* Crank turns once, resets, turns again
* At turn 36, it stops, landing gear is down.
I need to also figure out a Y axis rotation, as the back and fourth motion isnt very realistic, lol... I am working on that.
Here is the code so far which includes the appearence code, but not a loop system as of yet.
Code:
<part>
<name>ave_gearcrank_switch</name>
<animation>
<parameter>
<code>(L:AVEauxGEARcrankANIM, bool) 100 * </code>
<lag>150</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>Crank Down Landing Gear</tooltip_text>
<callback_code>
(L:AVEauxGEARcrankANIM, bool) ! (>L:AVEauxGEARcrankANIM, bool)
(>K:GEAR_PUMP, bool)
1 (>L:XMLSND73,enum)
</callback_code>
</mouserect>
</part>
<part>
<name>lhc_aux_gearcrank_appear</name>
<animation>
<parameter>
<code>
(L:PUSHaveAUXgearCrank,bool) 10 *
</code>
<lag>100</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>Fuselage Selector System (%((L:AVEgearCrank_DISPLAY,enum))%{case}%{:0}Emergency Gear Crank Socket)%{:1}Emergency Landing Gear Deployment Sys)%{End}</tooltip_text>
<mouse_flags>LeftSingle+LeftRelease</mouse_flags>
<callback_code>(M:Event) 'LeftSingle' scmp 0 == if{ (L:AVEgearCrank_DISPLAY,enum) 1 + 2 % (>L:AVEgearCrank_DISPLAY,enum) 1 (>L:XMLSND73,enum) 1 (>L:PUSHaveAUXgearCrank,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:PUSHaveAUXgearCrank,bool) }</callback_code>
</mouserect>
</part>
<part>
<name>ave_gearcrank</name>
<visible_in_range>
<parameter>
<code>(L:AVEgearCrank_DISPLAY,enum) 1 ==</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>




