• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA XML TIMER LIGHT not working

Messages
1,749
Country
unitedstates
I have not written a 5 second timer in a while and it's not working. What am i doing wrong?
I want the light to come on when i flip the switch off or on and then go out. It just stays on!

The switch:
(L:FUEL_MAINPUMP1,bool) ! (>L:FUEL_MAINPUMP1,bool)


The light:
Code:
<Visibility>
<Parameter>
<Code>

(L:FUEL_MAINPUMP1,bool) (A:ELECTRICAL BATTERY BUS VOLTAGE,Volts) 3.0 &gt; and
if{ (E:ABSOLUTE TIME. Seconds) 0.5 + (>L:JET_TIMMER,Enum) }
(L:JET_TIMMER,Enum) (E:ABSOLUTE TIME. Seconds) >

</Code>
</Parameter>
</Visibility>
 
Here is the Steward's light on the OH panel of the VC10. If I left click it the light holder pushes in and illuminates and a ding is heard. When I release, the light holder returns to its default position and the light goes out. If I right click, the same happens to the light and the holder but a safety message is played. When the safety message has finished another message is played from the cabin during which the light is illuminated and stays on for a short period after the message has finished. A cabin message is also played after the doors are closed and also during final descent. So it's quite a complicated gauge! You need to trace the paths from the cabin messages which only illuminate the light in situ for the time of the message plus a little bit more.

This is the main gauge
Code:
<Gauge Name="Cabin Call" Version="1.0">

<Element>
      <Select>
         <Value>(L:CABIN CALL,number)</Value>
         <Case Value="0">
            <Image Name="ccallout.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="ccallin.bmp"/>
         </Case>
      </Select>
   </Element>

<Element>
      <Select>
         <Value>(L:CABIN CALL,number)</Value>    
         <Case Value="1">
            <Image Name="AMBER_ON_ON.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>

<Element>
      <Select>
        <Value>
     (L:CAB LIGHT 2,number) (P:local time, seconds) &gt; |
   </Value>    
         <Case Value="1">
            <Image Name="AMBER_STEW_ON_ON.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>

<Mouse>
         <Tooltip>Cabin Call</Tooltip>
         <Cursor Type="Hand"/>
    <Click Kind="LeftSingle+LeftRelease+RightSingle+RightRelease">
            (M:Event) 'LeftSingle' scmp 0 == if{ (L:CABIN CALL,number) ! (&gt;L:CABIN CALL,number)
2 (>L:Sound_attend2a,enum)
1 (>L:CAB LIGHT ON,number) }
            (M:Event) 'LeftRelease' scmp 0 == if{ (L:CABIN CALL,number) ! (&gt;L:CABIN CALL,number)
0 (>L:Sound_attend2a,enum)
0 (>L:CAB LIGHT ON,number) }
(M:Event) 'RightSingle' scmp 0 ==  if{ (L:CABIN CALL,number) ! (&gt;L:CABIN CALL,number)
2 (>L:Sound_attend2a,enum)
1 (>L:CAB LIGHT ON,number) }
(M:Event) 'RightRelease' scmp 0 == if{ (L:CABIN CALL,number) ! (&gt;L:CABIN CALL,number)
0 (>L:Sound_attend2a,enum)
0 (>L:CAB LIGHT ON,number) 1 (>L:Sound_BAsafety,enum)
1 (>L:Monitor_Sound, bool) }
        </Click>
   </Mouse>
</Gauge>

This runs the safety message but you want to look at 1 (>L:Sound_mes2,enum) (P:local time, seconds) 8.5 + (>L:CAB LIGHT 2,number) which is the message from the cabin to the flight deck.
Code:
<Gauge Name="Safety Vid" Version="1.0">
<Image Name="SWAP.bmp"/>
<Update>
(L:Monitor_Sound, bool)
if{ (L:Sound_BAsafety,enum) ! if{ 0 (>L:Monitor_Sound, bool) 1 (>L:Sound_mes2,enum) (P:local time, seconds) 8.5 + (>L:CAB LIGHT 2,number) }
}
</Update>

</Gauge>

This one runs a cabin call when the cabin is secure for landing
Code:
<!-- Cabin Call Landing -->
   <Element>
      <Select>
         <Value>(L:sound_played,bool) 0 == (A:RADIO HEIGHT,FEET) 6727 &lt; and
(L:Cabin_Rate_Select,number) 0 &lt; and (A:SIM ON GROUND, bool) 0 == and
if{ 1 (>L:Sound_mes3,number) 1 (>L:sound_played,bool) (P:local time, seconds) 11.5 + (>L:CAB LIGHT 2,number) }</Value>
      </Select>
   </Element>

This one runs off the door control. It's a bit more complex. Left clicking the door control lights up all the door/hatch lights for periods sufficient in which to do the all the pre-flight checks leaving only the main cabin door open. When that is closed a call from the cabin is received and the steward's light is illuminated. A right click to the door control just manages the main cabin doors without time delay and upon closing the message is received and the light illuminated.
Ignore (L:BUS_SWITCH,number) (P:local time, seconds) &lt; that is a system wide control on all the lights that causes them to flicker when the aircraft electrical system is switched from "ground" to "flight".
Code:
<Gauge Name="Doorcontrol" Version="0.1">
<Update>
(L:Monitor_door_sound, bool)
if{ (L:Sound_door,enum) ! (A:CANOPY OPEN,enum) 0 == and if{ 0 (>L:Monitor_door_sound, bool) 1 (>L:Sound_mes1,enum) (P:local time, seconds) 12.5 + (>L:CAB LIGHT 2,number) and }
}
</Update>

<Element>
<Visible>(A:CANOPY OPEN,enum) 0 &gt; (A:CANOPY OPEN,enum) 1 &lt; &amp;&amp; </Visible>
<Image Name="BLUE_ON2.bmp" Bright="Yes"/>
<Position X="3.5" Y="0.5"/>
</Element>

<Element>
<Visible>(A:CANOPY OPEN,enum) 1 == (L:BUS_SWITCH,number) (P:local time, seconds) &lt; and (L:doors_armed,bool) |</Visible>
<Image Name="RED_ON.bmp" Bright="Yes"/>
<Position X="0.5" Y="32.5"/>
</Element>

<Mouse>
<Tooltip>L:Toggle All Door/Hatch Indicators
R:Toggle Pass Doors Only</Tooltip>

<!-- Main Exit - Button -->
<Area Left="0" Top="0" Width="30" Height="65">
<Click Kind="LeftSingle+RightSingle">
(M:Event) 'LeftSingle' scmp 0 == if{ (&gt;K:TOGGLE_AIRCRAFT_EXIT) 1 (>L:Sound_door,enum) 1 (>L:Monitor_door_sound, bool) 1 (>L:nose_access_open,bool) (L:doors_armed,bool) ! (&gt;L:doors_armed,bool) (L:doors_armed,bool) 1 == if{ (P:local time, seconds) 540.00 + (>L:front_galley_lit,number) (P:local time, seconds) 538.50 + (>L:cargo,number) (P:local time, seconds) 680.00 + (>L:rear_galley_lit,number) (P:local time, seconds) 678.50 + (>L:cargo2,number) (P:local time, seconds) 800.00 + (>L:front_hold_lit,number) (P:local time, seconds) 798.50 + (>L:cargo3,number) (P:local time, seconds) 845.00 + (>L:rear_hold_lit,number) (P:local time, seconds) 843.50 + (>L:cargo4,number) } }
(M:Event) 'RightSingle' scmp 0 == if{ (&gt;K:TOGGLE_AIRCRAFT_EXIT) 1 (>L:Sound_door,enum) 1 (>L:Monitor_door_sound, bool) }
</Click>
<Cursor Type="Hand"/>
</Area>
</Mouse>
</Gauge>
 
Last edited:
This might be too much info. I need more info on why my code does not work. It's based off of other timer codes and should work.
 
Punctuation? Replace full stop by comma (twice!) in (E:ABSOLUTE TIME. Seconds) ?
 
Good eye on spotting that! As they are so close in size i must be going blind. I did inspect the code several times ans did not see it.:yikes:
Thank you!
 
Back
Top