- Messages
- 10,163
- Country

Hey guys,
I wish to make a starter switch that must behave a certain way and I cant find anything similar in the existing ModelDef, but I found something close.
On the Lear, you have two switches that have;
* Generator (up position)
* Off (middle position)
* Starter Mode (hold down for 'starter on' )
What I 'really really really' want is to be able to hold the mouse down on that starter toggle (drag it down, then release for off-starter) and after the engine ignites, click up two times to 'Generator mode on' position (top). Center would be off as stated.
Can it be done? Holding the mouse 'down' for startups?
Existing code;
I wish to make a starter switch that must behave a certain way and I cant find anything similar in the existing ModelDef, but I found something close.
On the Lear, you have two switches that have;
* Generator (up position)
* Off (middle position)
* Starter Mode (hold down for 'starter on' )
What I 'really really really' want is to be able to hold the mouse down on that starter toggle (drag it down, then release for off-starter) and after the engine ignites, click up two times to 'Generator mode on' position (top). Center would be off as stated.
Can it be done? Holding the mouse 'down' for startups?
Existing code;
Code:
<PartInfo>
<Name>switch_generator_starter1</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>(A:GENERAL ENG GENERATOR SWITCH:2, bool) d if{ (A:GENERAL ENG STARTER:2, bool) } + 25 *</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<HelpID>HELPID_GAUGE_STARTER_SWITCH</HelpID>
<TooltipID>TOOLTIPTEXT_ENG2_STARTER_SWITCH</TooltipID>
<MouseFlags>LeftSingle+LeftDrag+MoveRepeat+Wheel</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 ==
if{ (M:X) (>G:Var1) (A:GENERAL ENG GENERATOR SWITCH:2, bool) d if{ (A:GENERAL ENG STARTER:2, bool) } + (>G:Var2) }
els{ (M:X) (G:Var1) - 40 / int (G:Var2) + 0 max 2 min s0
l0 0 == if{ (A:GENERAL ENG GENERATOR SWITCH:2, bool) if{ (>K:TOGGLE_ALTERNATOR2) } }
l0 1 == if{ (A:GENERAL ENG GENERATOR SWITCH:2, bool) ! if{ (>K:TOGGLE_ALTERNATOR2) } }
l0 2 == if{ (A:GENERAL ENG GENERATOR SWITCH:2, bool) ! if{ (>K:TOGGLE_ALTERNATOR2) } (>K:TOGGLE_STARTER2) }
}
</CallbackCode>
</MouseRect>
</PartInfo>
