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

Xml2Bgl problem

Messages
687
Country
us-texas
I am attaching an xml file that will not compile. This is an Instant Scenery 3 placement bgl that I decompiled in order to add a <NoCrash/> command to approx 2600 entries. Once this was completed I attempted to compile using Xml2Bgl and I get almost as many errors as there are entries for that command. However when I click the "Show Line" button it goes to the very first block of information (line 20) in the xml. . .if that's any help.
 

Attachments

Looking at the FSX schema I see...

Code:
  <xs:complexType name="ctSceneryObject">
    <xs:sequence>
      <xs:element name="BiasXYZ" type="ctBias" minOccurs="0" maxOccurs="1" />
      <xs:sequence>
        <xs:element name="NoAutogenSuppression" type="ctNoAutogenSuppression" minOccurs="0" maxOccurs="1" />
        <xs:element name="NoCrash" type="ctNoCrash" minOccurs="0" maxOccurs="1" />
        <xs:element name="NoFog" type="ctNoFog" minOccurs="0" maxOccurs="1" />
        <xs:element name="NoShadow" type="ctNoShadow" minOccurs="0" maxOccurs="1" />
        <xs:element name="NoZWrite" type="ctNoZWrite" minOccurs="0" maxOccurs="1" />
        <xs:element name="NoZTest" type="ctNoZTest" minOccurs="0" maxOccurs="1" />
      </xs:sequence>
      <xs:choice>
        <xs:element name="Beacon" type="ctBeacon" minOccurs="0" maxOccurs="1" />
        <xs:element name="Effect" type="ctEffect" minOccurs="0" maxOccurs="1" />
        <xs:element name="GenericBuilding" type="ctGenericBuilding" minOccurs="0" maxOccurs="1" />
        <xs:element name="LibraryObject" type="ctLibraryObject" minOccurs="0" maxOccurs="1" />
        <xs:element name="Trigger" type="ctTrigger" minOccurs="0" maxOccurs="1" />
        <xs:element name="Windsock" type="ctWindsock" minOccurs="0" maxOccurs="1" />
      </xs:choice>
      <xs:element name="AttachedObject" type="ctAttachedObject" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>

The compiler might expect these entries to be in this order.

cheers,
Lane
 
Hi Ed:

The <NoCrash/> element must appear immediately before the <LibraryObject element ...and NOT after the <LibraryObject element.

Swapping those positions for the lines might be a tricky process, and I'll bet by now you're not wanting to do more 'manual' edits ! :oops:



To remedy this, one could use "Find and Replace" to replace the existing <NoCrash/> elements with 'nothing'

Then one could use "Find and Replace" to insert the <NoCrash/> element on a line just before the <LibraryObject element


I could also try to set up a macro in WordPerfect to fix the sequence of element positions in this file for you, if you like. :)

GaryGB
 
Thanks Lane, but while I have some ability as a scenery builder (rudimentary at best compared to others), I have zero ability in areas I'm having to delve into now. Coding is foreign to me so I have no idea what you're showing me. Sorry.
 
Hi Ed:

The <NoCrash/> element must appear immediately before the <LibraryObject element ...and NOT after the <LibraryObject element.

Swapping those positions for the lines might be a tricky process, and I'll bet by now you're not wanting to do more 'manual' edits ! :oops:



To remedy this, one could use "Find and Replace" to replace the existing <NoCrash/> elements with 'nothing'

Then one could use "Find and Replace" to insert the <NoCrash/> element on a line just before the <LibraryObject element


I could also try to set up a macro in WordPerfect to fix the sequence of element positions in this file for you, if you like. :)

GaryGB

Ok, this was what was suggested in the other forum concerning where the NoCrash line should go:

1.) under each <SceneryObject placement "element" section, and immediately before the closing </SceneryObject> line

(a) add the optional "<NoCrash/"> XML element


. . . .which is where it currently resides. . . .immediately before the closing statement, ie; the line above it. ??
 
Hi Ed:

Indeed, I should have explained that better in light of the mix of info I linked to from the SDK Docs, Arno, and George. :oops:



Please see this example and brief discussion
:

http://www.fsdeveloper.com/forum/threads/noautogensuppression.19971/



Between that and the positioning of the example "<BiasXYZ" XML element shown in the SDK Docs:

https://msdn.microsoft.com/en-us/library/Cc526978.aspx#XMLFormat


...I must conclude that the positioning of the <NoCrash/> element must be before the <LibraryObject element ...as I posted immediately above.



I have edited my post in the other (prior) thread in an attempt at greater clarity:

http://www.fsdeveloper.com/forum/threads/crash-boxes-off.435008/#post-720960


http://www.fsdeveloper.com/forum/threads/crash-boxes-off.435008/#post-720960

...the optional "<NoCrash/"> XML element must appear both before and after certain other optional Scenery object data elements in a specified order ...as alluded to here:

http://www.fsdeveloper.com/forum/threads/noautogensuppression.19971/



PS: As George and Lane suggest, apparently when one does use any or all of these:

"<!-- Scenery object data elements -->

<NoAutogenSuppression/>
<NoCrash/>
<NoFog/>
<NoShadow/>
<NoZWrite/>
<NoZTest/>


...they must be listed in the above order, as well as being positioned before the <LibraryObject element. :teacher:


Hope this helps ! :)

GaryGB
 
Last edited:
Sorry Ed,

What I intended to show you was...

Capture.JPG


...so you could see the NoCrash before the LibraryObject.

The file you uploaded has it after.

This is what Gary also posted in his latest post.

cheers,
Lane
 
(and FAST :yikes:)


Textpad macro, you record the keystrokes used to edit one <SceneryObject and then play them back through the end of the file. So something like this:

Find: <NoCrash/>
press END
press Shift+Home (press Home twice)
press Ctrl+X (cut)
backspace
Find: imageComplexity= (searching upwards)
press END
press Enter
Shift+Home
press Ctrl+V (paste)

Stop recording and playback the macro through end of file. I couldn't get through a day without Textpad :) .
 
Last edited:
Back
Top