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

XML Creation Script

Messages
135
Country
us-kentucky
For those of you who create XML gauges, or mixed mode gauges, you will find this script very handy.

If you have a gauge project directory, for example, "C5_Galaxy", which is mixed mode create an XML sub-directory like this:

Code:
C5_Galaxy
  assets    - C gauge bmp, sounds, etc.
  inc       - project specific inc files
  src       - C++ source files
  XML       - root of xml part of the project
    xml     - your source xml goes here
    spb     - encrypted spb's are compiled here

Now, if you are doing XML only, then you'd want something like this:

Code:
C5_Galaxy_XML
  xml
  spb

Once you have your xml done, and artwork copied to the spb folder, then just run this .bat file in the xml root directory to have the .bat file compile your source to the spb directory, CAB it, and place the CAB in your FSX gauges directory.

Type:

Code:
  xml_make /?

for usage and help.

In a future version, I will add some command line options to allow more control from a post-compile run from Visual Studio.

Let me know if you like it, or would like to see any feature added to it. I plan to add command line switches to turn compilation and CAB'ation on/off.

Enjoy,

Patrick
 

Attachments

Last edited:
Couple of notes:

1) The directories are user configurable.
2) Compile errors will NOT be reported.

If you want to get errors, you can modify the script to do so by getting rid of the " > nul: " redirection.

I did this because the compiler's copyright notification is messy (seems to have extra chars so I replaced it with a clean one), and I didn't want to display it for each file processed as really I'm not using this for debugging anyway. You could redirect the output to a log file, so you could look at it if desired too. In UNIX most command line programs would have switches so you could "silence" all the extra notifications, or you could use AWK. Since most people don't have AWK installed, I just did it this way to make it clean.

If anyone has questions, I'll be happy to answer them, but the script is most likely self-explanitory.

Has anyone tried it?

Patrick
 
Here is an updated version that corrects some problems and logs simpropcompiler output to a .log file on compile errors so that you can see what it is saying.

The script is now much improved and better documented with comments, allowing you to understand how to edit the user defined vars inside to get it to function the way you want on your system.

If MS fixes the simpropcompiler.exe (eliminating the duplicate copyright messages, etc.) then I'll update the script to take advantage of it's output (or you can).

Maybe somebody wants to write their own compiler, haha.

Patrick
 

Attachments

Last edited:
I'll confess to being somewhat puzzled why anyone would want to do this... It seems an unnecessarily cumbersome method to deal with XML scripts.

On another note, I've done some "real life" experiments with spb'd XML scripts and encountered far too many instances of real users having such gauges fail to display on their panels... :eek:
 
I'll confess to being somewhat puzzled why anyone would want to do this... It seems an unnecessarily cumbersome method to deal with XML scripts.

Actually, it lets the computer do all the work. After you create your .xml, all you do is double click on the script (or run it from the command line if you prefer), and it will then compile all the xml to spb and put the spb in an "spb" output directory where you have your art waiting, and then upon a successful compile of all the .xml files in you "source" xml directory, it will then automatically CAB it all up and place the CAB file in your FSX gauges directory.

All that for just one-click! =)

Otherwise, you would have to enter one command-line per file to compile, and then drag-n-drop the gauge directory over a CAB short-cut (or enter another command line) to CAB it all up.

Furthermore, if you are using VS, you can just have VS "make" the CAB file for you when you compile, so you don't even have to click!


On another note, I've done some "real life" experiments with spb'd XML scripts and encountered far too many instances of real users having such gauges fail to display on their panels... :eek:

If you can replicate that, it might be useful to determine what is causing the problem. If you can't replicate it, then I'd consider that suspect.

But anyway, one certainly need not use spb, or even CAB files. Later, I'll add a flag so you can turn off compilation if you just want a CAB file.

Try it, you might like it. :)

Patrick
 
If I ever find a spare moment, I just might.

Call me "old-fashioned" or even a "Luddite," but I truly use what has to be the simplest possible method...

During developement, all XML "stuff" is placed in a sub-folder of the a/c's \panel folder:

..\panel
.....\XMLGaugeName
........NewGauge.xml
........NG_bgnd.bmp
........NG_more.bmp
........NG_etc.bmp

Whenever desired, I simply select the folder name "XMLGaugeName" right-click, and choose SendTo/CABFile.

The entire folder structure is then "CABbed" and left in the ..\panel folder, ready for use. :cool:

I will state however that I have begun using the XML editor in my MSVC .NET 2003 IDE more and more, since I like the way it preserves my indenting scheme... :D
 
I am doing exactly as Bill does.
I appreciate your intentions Patrick, but I prefer to manage all my code manually, so I have my own scripts and batch files for moving/renaming/compiling-etc. the stuff I could need in a certain moment.

Tom
 
If I ever find a spare moment, I just might.

Spare moments are created, not found. :D


Call me "old-fashioned" or even a "Luddite," but I truly use what has to be the simplest possible method...

Rather than use the aircraft/game directory, I prefer to use a "project" directory (actually a sub-directory of the mixed mode project). I do this because it means that all my work can automatically be backed up by scheduled tasks to both on-site and off-site storage. If a hard drive ever fails, all work can be restored easily. All source files (c, xml, psd, etc.) are in one directory tree, not spread out in different places.


Whenever desired, I simply select the folder name "XMLGaugeName" right-click, and choose SendTo/CABFile.

Yes, this is nice, but it's not spb'ed. Instead, you could just have VS automatically do it when you press "compile". And, you could then use your SendTo when you just want a plain-text CAB.

Anyway, to each their own. Programmers who are used to making the make file do everything will understand the point, and how to integrate it into VS. But, depending on how you prefer to work, it might not be your cup-of-tea.

I just like being able to do everything from within the IDE.

Patrick
 
Back
Top