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

Updating with XML in FS9

Messages
22
Country
us-texas
I am new to working with XML and gauges. I am needing to change values at other times than at a mouse click. I need to be able to do it with an element.

The first thing I am doing is having one gauge setting L: variables for another gauge. The mouse click works but, at startup, I am wanting to set defaults. I have seen simular code in FSX and I am trying to adapt the logic to FS9. I have been trying the following:

//---------- Initialize Local Values ----------//

<Element>
<Update>

(L:Init) 0 == if{
1 (&gt;L:Display Scale)
1 (&gt;L:MapItem Shown)
2 (&gt;L:EFIS Mode)
1 (&gt;L:Init) }

</Update>
</Element>

I have tried removing the <Element/> as this is the first statements in the gauge and I have removed the condition which I thought would have just made these constants. It looks like this whole <Update/> group is just being ingored.

thanks,
wayne
 
<Update> cannot be inside an <Element>...</Element> section...

Also, all custom variables require a unit tag: (L:var,unit)

And please, use the # Icon to wrap your XML inside the forums' "code" tags so it's easier to read... :teacher:

Code:
//---------- Initialize Local Values ----------//
<Update>
     (L:Init,bool) 0 ==
       if{ 
          1 (&gt;Lisplay Scale,number)
          1 (&gt;L:MapItem Shown,number)
          2 (&gt;L:EFIS Mode,number)
          1 (&gt;L:Init,bool) 
         }
</Update>
 
I think I tried this before but I will try it again. I know I tried removing the <Element> statements and I know I removed the condition completely. But I will give it another shot.

thanks,
wayne
 
Yes, that worked. I had not specified type on any of the L:vars. But this leads to another question.. If <Update> cannot be inside an <Element>, is there only one <Update> statement and that at the beginning? Or, can there be mulitple <Update> statements with all of them before any <Element>? Or does it make any difference as long as it is before <Mouse>?

thanks,
wayne
 
You may have as many <Update>...</Update> sections as you wish, provided they are on the same level as <Element> pairs...

...in other words, they must be stand-alone.

EDIT: I've since found out that the above is NOT TRUE! You may have only one <Update> section per gauge...


However, as a matter of adhering to the KISS principle, I have only ONE <Update> area per gauge script.

Remember that the "code" is executed sequentially from top to bottom, so by having the <Update> section at the top of the script, it will be done first... :D
 
Last edited:
I probably will have only one also unless there is a situation where it would be executed more than once depending on other switches.

thanks
wayne
 
Mr

<Update> cannot be inside an <Element>...</Element> section...

Is there some document that contains these little nuances related to XML gauge programming. I've read through the SDK and the tutorials and these kinds of things seem to be missing
 
Honestly there is not. Most everything has been posted at one time or another already, albiet scattered amongst many hundreds of posts, forums, and newsgroups... :yikes:
 
Back
Top