• 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.

FS2004 Simple Macro question (SOLVED)

Messages
1,451
Country
mexico
Good evening!

I am following Fr. Leaming Wiki on XML: Using Macros and I have a little problem... I hope some kind soul would give me some hints about this:

Defining some macros inside the MFD code:
Code:
<Gauge Name="Multy Functional Display Bell 429" Version="1.0">
          <Element>
                <Visible>(A:Circuit general panel on, bool)</Visible>
                  <Image Name="mfd_background.bmp" Luminous="Yes" Bright="Yes"/>

<!-- List of Conditional Macros for MFD's EICAS page
      <Macro Name ="Condition9"></Macro>-->

        <Macro Name="Condition1">((A:General Eng Fuel Valve:2,bool))</Macro>  <!-- For "FUEL 1 CLOSED" message -->
        <Macro Name="Condition2">((A:General Eng Fuel Valve:3,bool))</Macro>  <!-- For "FUEL 2 CLOSED" message -->
        <Macro Name="Condition3">((L:Inverter1,bool))</Macro>  <!-- For "INV 1" message toogles on(white color)/ off(yellow) -->
        <Macro Name="Condition4">((L:Inverter1,bool))</Macro>  <!-- For "INV 2" message toogles on(white color)/ off(yellow) -->
        <Macro Name="Condition5">((L:Hydr1On,bool))</Macro>  <!-- For "HYD 1 PRESS" message toogles on(white color)/ off(yellow) -->
        <Macro Name="Condition6">((L:Hydr1On,bool))</Macro>  <!-- For "HYD 2 PRESS" message toogles on(white color)/ off(yellow) -->
        <Macro Name ="Condition7">((A:ENG TRANSMISSION PRESSURE, psi) 25 &lt;)</Macro>  <!-- for "XMSN OIL PRESS" -->
        <Macro Name="Condition8">((A:GENERAL ENG2 GENERATOR ACTIVE,bool) ! (A:GENERAL ENG3 GENERATOR ACTIVE,bool) ! and)</Macro>

When I call the Condition8 in a simple visibily condition, is not working:
Code:
          <!-- Conditional.1.4=================================DUAL GEN =========================================-->
          <!--  Generators 1 & 2 On/Off status . the conditional is by a macro named "Condition8"-->
        
              <Element>
              <Visible>@Condition8</Visible>
                    <Position X="270" Y="582"/>
                          <Element>
                                    <Rectangle Width="200" Height="26" FillColor="#FF3A34" Transparency="0.5" Bright="Yes"/>
                         </Element>
          </Element>
        
          <Element>
              <Visible>@Condition8</Visible>
                    <Position X="270" Y="582"/>
                        <FormattedText X="150" Y="20" Font="Arial" FontSize="20" Color="#FFFFFF" Adjust="Center" VerticalAdjust="Center" Bright="Yes">
                            <String>DUAL GEN</String>
                        </FormattedText>
              </Element>

I tested with the code inside "Condition8" and works like a charm if and only if I use the "direct" code:
(A:GENERAL ENG2 GENERATOR ACTIVE,bool) ! (A:GENERAL ENG3 GENERATOR ACTIVE,bool) ! and
instead @Condition8

What I am doing wrong?

In advance, thank you all.
Sergio.
 
Why the double parentheses? Try with only one set...

Whatever is between the > and < in the macro is precisely what will be placed. The superfluous set of parentheses is what is killing your script(s).
Code:
<Macro Name="Condition8">(A:GENERAL ENG2 GENERATOR ACTIVE,bool) ! (A:GENERAL ENG3 GENERATOR ACTIVE,bool) ! and</Macro>
 
Last edited:
Hello Mr. Leaming

This will be very useful because it will help me to reduce complexity in favor of readability!
Now everything works as it should.

Thank you and all the best,
Sergio.

P.S. When I insert code -no matter the option I choose- my indentation is altered. :confused:
 
Last edited:
Back
Top