I have decided to have another go at coding my throttle levers contained in a 2D gauge, I was not happy with the select & shift elements I have used & decided to use only shift elements. The throttle lever needs two seperate elements, one from cut-off-idle & one from idle-full power where idle is 10% throttle, so I need to code the first element for the throttle lever to move from cut-off to idle (0%-10% throttle percentage) which when the starter is engaged the engine ignites at =>20% N2 & then the second element controls the throttle percentage from 10% to 100%. Here's the code I have come up with so far, the animation works but the engine ignition does not.
In the "Cut Off-Idle L" mouse script I changed the 16384.0 to 1638.0 as it is 10%, I am not sure what the (M:Y) 130 - 134 / 0 max 1 min 1 - /-/ 1 does or the s0 - * l0 +, still got lots to learn!
I would greatly appreciate any help with this.
Code:
<SimGauge.Macro id="Ignition Left" Name="Ignition_L">
<MacroValue>(A:TURB ENG IGNITION SWITCH:1,bool) 1 == if{ (A:Turb eng N2:1, percent) 20 > (A:General Eng1 Fuel Valve, bool) 1 == (A:GENERAL ENG1 FUEL PUMP SWITCH,bool) 1 == }</MacroValue>
</SimGauge.Macro>
<SimGauge.Element id="Cut Off-Idle L">
<FloatPosition>14.000,185.000</FloatPosition>
<Visibility>(A:General Eng Throttle Lever Position:1,percent) 0 ==</Visibility>
<Image id="Throttle_Cut_left.bmp" Name="Throttle_Cut_left.bmp">
<Transparent>True</Transparent>
<Bright>True</Bright>
</Image>
<MaskImage id="Throttle_lever_left_mask.bmp" Name="Throttle_lever_left_mask.bmp">
</MaskImage>
<Shift id="Shift">
<Scale>0.000,1.000</Scale>
<Expression id="Expression">
<Minimum>0.000</Minimum>
<Maximum>10.000</Maximum>
<Script>(A:General Eng Throttle Lever Position:1,percent) (L:Eng Cut:1, bool)</Script>
</Expression>
</Shift>
</SimGauge.Element>
<SimGauge.Element id="Throttle Left">
<FloatPosition>14.000,17.000</FloatPosition>
<Visibility>(A:General Eng Throttle Lever Position:1,percent) 0 ></Visibility>
<Image id="Throttle_lever_left.bmp" Name="Throttle_lever_left.bmp">
<Transparent>True</Transparent>
<Axis>-1.000,-165.000</Axis>
<Bright>True</Bright>
</Image>
<MaskImage id="Throttle_lever_left_mask.bmp" Name="Throttle_lever_left_mask.bmp">
</MaskImage>
<Shift id="Shift">
<Scale>0.000,-1.400</Scale>
<Expression id="Expression">
<Minimum>10.000</Minimum>
<Maximum>100.000</Maximum>
<Script>(A:General Eng Throttle Lever Position:1,percent)</Script>
</Expression>
</Shift>
</SimGauge.Element>
<SimGauge.MouseArea id="Cut Off-Idle L">
<FloatPosition>10.000,260.000</FloatPosition>
<Size>80,75</Size>
<CursorType>Hand</CursorType>
<MouseClick id="MouseClick">
<Script> (M:Y) 130 - 134 / 0 max 1 min 1 - /-/ 1
(A:Throttle lower limit,part)
s0 - * l0 + 1638.0 * (>K:THROTTLE1_SET)
(L:Eng Cut:1, bool) 10 == if{ (>K:MIXTURE1_RICH) (>@Ignition_L) }
(L:Eng Cut:1, bool) 0 == if{ (>K:MIXTURE1_LEAN) }</Script>
<ClickType>LeftSingle+LeftDrag</ClickType>
<MouseWheelFlip>True</MouseWheelFlip>
</MouseClick>
</SimGauge.MouseArea>
<SimGauge.MouseArea id="Throttle-Left">
<FloatPosition>10.000,5.000</FloatPosition>
<Size>80,250</Size>
<CursorType>Hand</CursorType>
<MouseClick id="MouseClick">
<Script>(M:Y) 130 - 134 / 0 max 1 min 1 - /-/ 1
(A:Throttle lower limit,part)
s0 - * l0 + 16384.0 * (>K:THROTTLE1_SET) </Script>
<ClickType>LeftSingle+LeftDrag</ClickType>
<MouseWheelFlip>True</MouseWheelFlip>
</MouseClick>
<Tooltip id="Tooltip">
<DefaultId>TOOLTIPTEXT_THROTTLE_ENG1_THROTTLE_PERCENT</DefaultId>
</Tooltip>
</SimGauge.MouseArea>
In the "Cut Off-Idle L" mouse script I changed the 16384.0 to 1638.0 as it is 10%, I am not sure what the (M:Y) 130 - 134 / 0 max 1 min 1 - /-/ 1 does or the s0 - * l0 +, still got lots to learn!
I would greatly appreciate any help with this.