- Messages
- 58
So I have a simple fuel selector gauge animated and coded along with a visual tag to initiate the selector but keep seeing this bug.
The fuel draw upon loading the aircraft always comes from my center 2 tank regardless of the position of the selector. Only after I mouse click and change selector position does the draw come from the appropriate tank. There are only 3 positions (OFF, Center 2, Center 1). Also upon loading the aircraft, fuel will continue to draw from Center 2 until empty and then begin drawing from Center 1 instead of cutting off. Turning the switch remedies this and the switch works as designed but not sure why this happens to a a newly loaded aircraft with a fuel selector untouched.
Below is my code. and Center1 and Center2 tanks are defined in the .cfg
Any help greatly appreciated
The fuel draw upon loading the aircraft always comes from my center 2 tank regardless of the position of the selector. Only after I mouse click and change selector position does the draw come from the appropriate tank. There are only 3 positions (OFF, Center 2, Center 1). Also upon loading the aircraft, fuel will continue to draw from Center 2 until empty and then begin drawing from Center 1 instead of cutting off. Turning the switch remedies this and the switch works as designed but not sure why this happens to a a newly loaded aircraft with a fuel selector untouched.
Below is my code. and Center1 and Center2 tanks are defined in the .cfg
Any help greatly appreciated
Code:
<PartInfo>
<Name>aircraft_initialize_fuel</Name>
<Visibility>
<Parameter>
<Code>
(L:myplane_init, bool) 0 ==
if{
0 (>L:fuel switch, enum)
1 (>L:myplane_init, bool)
and }
</Code>
</Parameter>
</Visibility>
</PartInfo>
<PartInfo>
<Name>aircraft_fuel_selector</Name>
<AnimLength>120</AnimLength>
<Animation>
<Parameter>
<Code>(L:fuel switch, enum) 60 *</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>hand</Cursor>
<MouseFlags>WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'WheelUp' scmp 0 == if{ (L:fuel switch, enum) ++ 2 min (>L:fuel switch, enum) }
(M:Event) 'WheelDown' scmp 0 == if{ (L:fuel switch, enum) -- 0 max (>L:fuel switch, enum) }
(L:fuel switch, enum) 0 == if{ 0 (>K:FUEL_SELECTOR_SET) }
(L:fuel switch, enum) 1 == if{ 7 (>K:FUEL_SELECTOR_SET) }
(L:fuel switch, enum) 2 == if{ 6 (>K:FUEL_SELECTOR_SET) }
</CallbackCode>
</MouseRect>
</PartInfo>