• 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 - "Position" Simprocompiler ??

Messages
497
Country
unitedstates
In the Current (and all past SDKs) there is an example of some Gauge XML

Code:
<Element>
  <[b]Position[/b] X="18" Y="18"/> 
  <MaskImage Name="ap_ahi_window.bmp">
    <Axis X="61.5" Y="61.5"/>
  </MaskImage>
  <Image Name="ap_ahi_dial.bmp" PointsTo="North">
    <Axis X="59" Y="59"/>
  </Image>
  <Rotate>
    <Value Minimum="-90" Maximum="90">(A:Attitude indicator bank degrees:1,degrees) -90 max 90 min</Value> 
  </Rotate>
</Element>

Where does this POSITION element come from ??
The SDK does NOT define it a a child of ELEMENT, but then gives an example of it's use as such !!

It seems to PARSER without errors when used in a gauge ( XMLDEBUG switch turned on in Prepar3d.cfg)

HOWEVER, the SPB compiler will error-out at the POSITION, but will accept the SDK Defined Child FLOATPOSITION.

I see quite a few XML gauges using "POSITION" -- what is going on here -- Does not appear to be very consistent.

FSX XML programming is tedious enough, without a decent PARSER that gives usefull Error Messages -- now there appears to be other Rules and Exceptions, that are not covered in the SDK ??

Shouldn't ALL P3D XML code BOTH pass the PARSER "AND" SPB compiler, without error. ??

----------------
Also, the ACES editor is the only Editor I have found that will NICELY format FSX XML. ( Correctly Indenting).
But why, when that nicely INDENTED XML is passed through the COMPILER, does it not remove all the UNNECESSARY TABS.
( It removes <!-- COMMENTS --> , so why not LEADING TABS (and LEADING and TRAILING Spaces) ??
Isn't one purpose of the Compiler, to make the Binary as small as possible, so it loads quicker.

Sorry -- after being in FSX XML "HELL" for the past few weeks, I am extremely Frustrated with the process of debugging this XML in the FSX environment. It's enough to drive anyone to program all gauges in C++ !!!

Geoff
 
<Position> is FS9 XML Schema

<FloatPosition> is FSX XML Schema

The two Schemas are totally incompatible...

...and the SPB compiler will only work with FSX XML Schema!
 
There is a little tool, included in the FSX SDK, that seems to cope with all the positioning when it comes to FSX XML syntax.

It's called psd2xml.exe; I use to position all the parts in photoshop as layers, create the paths for rotation axis, and the tool creates the base XML file with all parts in the correct places, and it even creates the bitmaps and masks in the process, although I prefer to create them myself; then is just a matter of chosing variables and the necessary code to complete the gauge. I believe this was intended to work together with the ace.exe XML editor, and in fact, it saves a lot of work. I believe the majority of the default FSX gauges were made this way, psd2xml.exe + ace.exe, but I notice everybody seems to be so anti-ace.exe, when it comes to XML gauge programing, or maybe its just me, because I don't have a FS9 past...


(Sorry if this is a bit out of topic)
 
<Position> is FS9 XML Schema

<FloatPosition> is FSX XML Schema

The two Schemas are totally incompatible...

...and the SPB compiler will only work with FSX XML Schema!

Thanks Bill..

Then why on earth is there examples of Gauge XML code in the FSX SDK, using "Position" ? !!! (sigh) -- carried over into ESP, and then over into P3D. (tripple sigh)

Geoff
 
----------------
Also, the ACES editor is the only Editor I have found that will NICELY format FSX XML. ( Correctly Indenting).
But why, when that nicely INDENTED XML is passed through the COMPILER, does it not remove all the UNNECESSARY TABS.
( It removes <!-- COMMENTS --> , so why not LEADING TABS (and LEADING and TRAILING Spaces) ??
Isn't one purpose of the Compiler, to make the Binary as small as possible, so it loads quicker.

Actually all irrelevant code between <Tags> is removed, including tabs, spaces, etc. What may confuse you is when you edit the .spb in hex, you still see spaces between <Tags>, but those are fixed bytes that are members of the memory block they're assigned in.
Other thing are the spaces and tabs included in scripts; they are indeed kept because a script is a text string that is going to be evaluated at runtime; the compiler knows nothing about it contents so it cannot alter anything there.

Tom
 
Actually all irrelevant code between <Tags> is removed, including tabs, spaces, etc. What may confuse you is when you edit the .spb in hex, you still see spaces between <Tags>, but those are fixed bytes that are members of the memory block they're assigned in.
Other thing are the spaces and tabs included in scripts; they are indeed kept because a script is a text string that is going to be evaluated at runtime; the compiler knows nothing about it contents so it cannot alter anything there.

Tom

But the simprocompile should (could) know that leading and trailing spaces and Tabs can be removed ?

Geoff
 
But the simprocompile should (could) know that leading and trailing spaces and Tabs can be removed ?

Geoff

But which spaces are you taking about, those between structures or those within the text scripts?

Tom
 
Back
Top