• 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 Update and logic

Zeiten

Resource contributor
Messages
444
Country
norway
Hi.

Been looking trough more and more xml codes and examples, and now I found something all new! (off course not new to you guys:))

An update section!
What is that and where do it belong?

Is this both for 2D and 3D gauges?
 
Hi.

Been looking trough more and more xml codes and examples, and now I found something all new! (off course not new to you guys:))

An update section!
What is that and where do it belong?

Is this both for 2D and 3D gauges?

2D gauge only, and it can go pretty much anywhere between the <Gauge...> and </Gauge> tags, although most of the time I stick it near the top to keep it handy. You can have one -and only one- <Update>...</Update> section per <Gauge> though.

What it's for is to have a handy place where you want a calculation to be done every gauge cycle, such as:
Code:
<Update>
    <!-- STROBE LIGHT FLASHER -->
    (A:LIGHT STROBE,bool)
    (A:ELECTRICAL MASTER BATTERY,bool)
    and
    if{
    (P:Absolute time,seconds) 2 % 0.4 > !
    if{
    (P:Absolute time,seconds) 0.2 % 0.1 > !
    if{ 1 (>L:B737_Strobe,bool) }
    els{ 0 (>L:B737_Strobe,bool) }
    }
    }
</Update>
The above is a custom "double-flash" strobe light, just for information... :D

You can also have a "sort-of" <Update> section in a 3d model's modeldef.xml script as well, but in this case it's really a <Visibility> tag section. How is works is that you create a tiny polygon somewhere in your model, then "tag" it with the "AttachPoint Tool." For example:

Code:
  <!-- MILVIZ B737 XML Code -->
  <PartInfo>
    <Name>B737_Logic</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:B737_Init,bool) !
          if{
          1 (>L:PowerAvailableNow,bool)
          1 (>L:B737_Init,bool)
          }

          <!-- RESET ALT FLAPS-->
          (L:B737_AltFlaps,enum) 0 !=
          if{
          (L:Reset,enum) (E:local time, seconds) &gt;
          if{ }
          els{ 0 (>L:B737_AltFlaps, enum) 1 (>L:XMLSND5,bool) }
          }


        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>
 
Got a lot to learn, but it's coming.

It was one more thing I was wondering about, but can't remember what:scratchch
Well, well. Time will tell :)
 
Not sure how the timer stuff works and have not had any success so here we go.


I want an light to come on and stay on for, lets say 5 seconds.
Is that possible or do you need to make some more custom vars to control it?

Can't seem to find any simulator variables to control it.

The light is an announcement of that the APU doors are in transit.

Code:
           <PartInfo>
        <Name>fe_apu_door_in_transit_unlighted</Name>
        <AnimLength>50</AnimLength>
        <Visibility>
            <Parameter>
        	<Code>
	(A:ELECTRICAL MASTER BATTERY, bool)
	(L:fe apu master on,bool) 0 ==
           and
	(A:ELECTRICAL MASTER BATTERY, bool) 0 ==
	or
	</Code>
            </Parameter>
        </Visibility>
    </PartInfo>
	  
      <PartInfo>
        <Name>fe_apu_door_in_transit_lighted</Name>
        <AnimLength>50</AnimLength>
        <Visibility>
            <Parameter>
        	<Code>
	(L:fe apu master on,bool)
	(A:ELECTRICAL MASTER BATTERY, bool)
	and
             </Code>
            </Parameter>
        </Visibility>
    </PartInfo>
 
Last edited:
This is for the cabin doors in fs9. It also controls cargo hatch lights on the engineers panel etc. But the relevant part is the blue light which is illuminated only while the doors are in transit. Hope it gives you the idea. You could add a timer.
vololiberista
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>
[COLOR="Red"]
<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>
[/COLOR]
<Element>
		<Visible>(A:CANOPY OPEN,enum) 1== (L:BUS_SWITCH,number) (P:local time, seconds) &lt; and (L:doors_armed,bool) and</Visible>
		<Image Name="RED_ON.bmp" Bright="Yes"/>
		<Position X="0.5" Y="35.5"/>
</Element>
	
	<Mouse>
  <Tooltip>Open/Close Pass Doors</Tooltip>

<!-- Main Exit - Button -->
	<Area Left="6" Top="6" Width="30" Height="65">
		 [COLOR="Red"]<Click> (&gt;K:TOGGLE_AIRCRAFT_EXIT)[/COLOR]
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) 480.00 + (>L:front_galley_lit,number)
(P:local time, seconds) 478.50 + (>L:cargo,number) (P:local time, seconds) 720.00 + (>L:rear_galley_lit,number)
(P:local time, seconds) 718.50 + (>L:cargo2,number) (P:local time, seconds) 900.00 + (>L:front_hold_lit,number)
(P:local time, seconds) 898.50 + (>L:cargo3,number)
(P:local time, seconds) 945.00 + (>L:rear_hold_lit,number)
(P:local time, seconds) 943.50 + (>L:cargo4,number) }[COLOR="Red"]</Click>[/COLOR]
		<Cursor Type="Hand"/>
    </Area>
</Mouse>
</Gauge>
 
Back
Top