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

ACE xml "include" ?

Messages
58
Country
us-newyork
Ace offers the insert into base gauge or an element called "include"
Can anybody clue me in on what this can be used for?


<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document
Type="AceXML"
version="1,0"
id="Whats an include object">
<Descr>AceXML Document</Descr>
<Filename>Whats an include object.xml</Filename>
<SimGauge.Gauge id="No info in sdk fsx or esp">
<FloatPosition>0.000,0.000</FloatPosition>
<Element id="of curiosity of what this is, how to use it, or if it works.">
<FloatPosition>0.000,0.000</FloatPosition>
<Include id="Include" File="What does this mean?">
<Comment id="Comment">
</Comment>
</Include>
</Element>
<Include id="Include">
<Comment id="Comment">
</Comment>
</Include>
<Comment id="Comment">
<Value>seems only gauges and elements can be the parent of an include object, include objects can only be the parent of a comment.</Value>
</Comment>
</SimGauge.Gauge>
</SimBase.Document>

Joey
 
It 'includes' the contents of another XML file into the gauge, like an include in a real programming language. I'm not sure about the syntax, as I don't use it.
 
Not a single clue. There's absolutely no mention whatever of this in the FSX SDK...
 
Probably works, it's in the propdefs file.

The syntax is:
Code:
        <Include id="Namewhateveryoulike" File="file to include.xml">
        </Include>

Okay, but...

...what's the structure required for use in the "file to include.xml" file?

Does it have it's own unique (and unspecified) header tag declarations? Or can it be as simple as a collection of <Macro...> entries?

Since I absolutely decline to use the way-to-verbose and bloated, FSX XML Schema, I guess I'll never be able to experiment... ;)
 
Maybe try including a macro.xml file with this for contents:

Code:
  <Macro Name="ExtDigit">
    @1 sp0
    @3 0 >
    if{ l0 10 @3 pow * sp0 }
    l0 int 10 @2 pow % 10 @2 1 - 0 max pow / int
  </Macro>

And this in an <Update...> section:

Code:
    <!-- INTRODUCE SLIGHT DELAY TO ALLOW FOR DIRECT ENTRY FROM KNOBS -->
    (L:T38_Com_CompleteFreq,enum) (A:COM1 ACTIVE FREQUENCY,Mhz) !=
    (L:T38_Com_MouseActive,enum) (P:local time, seconds) &gt;
    and
    if{ }
    els{
    @ExtDigit((A:COM1 ACTIVE FREQUENCY,Khz),6,0) (>L:T38_Com_100_TUNE,enum)
    @ExtDigit((A:COM1 ACTIVE FREQUENCY,Khz),5,0) (>L:T38_Com_10_TUNE,enum)
    @ExtDigit((A:COM1 ACTIVE FREQUENCY,Khz),4,0) (>L:T38_Com_1_TUNE,enum)
    @ExtDigit((A:COM1 ACTIVE FREQUENCY,Khz),3,0) (>L:T38_Com_10ths_TUNE,enum)
    @ExtDigit((A:COM1 ACTIVE FREQUENCY,Khz),2,0) s0
    l0 0 == if{ 0 (>L:T38_Com_100ths_TUNE,enum) }
    l0 2 == if{ 1 (>L:T38_Com_100ths_TUNE,enum) }
    l0 5 == if{ 2 (>L:T38_Com_100ths_TUNE,enum) }
    l0 7 == if{ 3 (>L:T38_Com_100ths_TUNE,enum) }
    }
 
Doesn't appear to work either, I'm afraid. Gives errors as if it can't find the macro when run in FSX, and nothing displays.

I think this is just another case of a broken feature... Shame, I wouldn't have minded this one.
 
I think this is just another case of a broken feature... Shame, I wouldn't have minded this one.

Well, it's just possible that the auxilliary "include" .xml file requires some <Header> </Header> tags that we simply know nothing about since they never bothered to explain "how to use it..." :rolleyes:

Pity that, as it would have been kind of neat to be able to break the XML script into some standarized "modules" if for no other reason than that of being reusable!
 
Well, it's just possible that the auxilliary "include" .xml file requires some <Header> </Header> tags that we simply know nothing about since they never bothered to explain "how to use it..." :rolleyes:

Pity that, as it would have been kind of neat to be able to break the XML script into some standarized "modules" if for no other reason than that of being reusable!

Exactley!
Been playing with it for a while now, hasn't worked yet.
I assumed things like
<File>.othergaugeinsamecabfile.xml</file> or
<File>..\gauges\somecabfile\othergauge.xml</file>

Nobody knows if this is useable, would sure as heck save alot of space if it was.
 
The reason it's not documented is because it's not supported at runtime. The Include statement only works during the ACES internal build process for gauges (takes XML with enhanced formating (like includes) and then generates final XML (with the include stuff "included" in the main file) that then gets packed into the CAB file along with any images referenced, etc).
 
I note that in the FSX Modeldef.xml, that some parts carry a 'copy' string, but I guess that isnt the same as 'include'



<PartInfo>
<Name>rotor_still</Name>
<Copy>prop_anim</Copy>
<AnimLength>100</AnimLength>
<Visibility>
<Parameter>
<Code>
(A:ROTOR RPM PCT:1, percent) 40.0 &lt; if{ 1 } els{ 0 }
</Code>
</Parameter>
</Visibility>
<Animation>
<Parameter>
<Sim>
<Variable>ROTOR ROTATION ANGLE:1</Variable>
</Sim>
</Parameter>
</Animation>
</PartInfo>


Thats a cool blog you have Tim.
 
Last edited:
I note that in the FSX Modeldef.xml, that some parts carry a 'copy' string, but I guess that isnt the same as 'include'

<PartInfo>
<Name>rotor_still</Name>
<Copy>prop_anim</Copy>
<AnimLength>100</AnimLength>
<Visibility>
<Parameter>
<Code>
(A:ROTOR RPM PCT:1, percent) 40.0 &lt; if{ 1 } els{ 0 }
</Code>
</Parameter>
</Visibility>
<Animation>
<Parameter>
<Sim>
<Variable>ROTOR ROTATION ANGLE:1</Variable>
</Sim>
</Parameter>
</Animation>
</PartInfo>

looks interesting, where exactely in fsx is this modeldef.xml? having trouble locating in in fsx and sdk.
 
Modeldef.XML is In SDK/Environment SDK/Modeling/Bin/, I think( that's from memory.) It's the file that controls custom animations, mouserects and visibility code in the models at compile time.
 
I note that in the FSX Modeldef.xml, that some parts carry a 'copy' string, but I guess that isnt the same as 'include'

Code:
  <PartInfo>
        <Name>rotor_still</Name>
        <Copy>prop_anim</Copy>

No, it's not even close. That tag is documented quite well. What it does in effect is use the parts of prop_anim that's not explicitely defined in rotor_still for its parameters when being run in the sim.

Where <Copy> is used, it eliminates the need to duplicate really complex scripted forumlas in multiple places. Look at the script for throttle movement for an excellent example of use.

Compare the <MouseRect> sections of lever_throttle and lever_throttle0 for instance!
 
The reason it's not documented is because it's not supported at runtime.

Thanks for clearing that up, Tim. So, it is quite useless for non-ACES.exe purposes.

I can see its utility for ACES users though, since it would allow one to cut/paste already debugged hunks of XML script to outboard files, and thus reduce the linecount of the "in progress" XML project.
 
Back
Top