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

Decompiling a BGL File

Status
Not open for further replies.
Hi Gary,
I don't understand what's going on here. When I click the Go button in the BGL2XML, I keep getting this message in the Log field:


Using ScruffyDuck Decompiler
Decompile Completed
[File was compiled with the FS9 Compiler]
Value cannot be null.
Parameter name: filename

What's the problem?
http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-711928

Sounds like you are using a version of Bgl2Xml that contains a bug. I believe we released an update.

I get the same error after attempting to de-compile another file from the same instance of BGL2XML version 1.6x which is still running in memory; this still occurs after BGL2XML is told to check for updates online. :banghead:

Try using BGL2XML v1.3.7x; do NOT update it or you may get the v1.6 with an as yet un-resolved and ongoing BUG ! :pushpin:


http://library.avsim.net/search.php?SearchTerm=Bgl2Xml&CatID=root&Go=Search

http://www.flightsim.com/vbfs/fslib.php?searchid=37567586

NOTE: I used version BGL2XML v1.5 for the tutorial above, but cannot find a separate download for it online; IIRC it was originally released as an auto-update for v1.3.7x



This is what it was doing before. In the Input field, are you telling me to browse to the folder and select the file bhm_bc00.bgl or select the KBHM_scenery.bgl? It looks like you're saying to select the bhm_bc00.bgl. I also noticed that you say go to the same folder and specify the file name "bhm_bc00.xml" to de-compile into. And whenever it says xml, it says bgl.xml. In other words, it says bhm_bc00.bgl.xml, instead of bhm_bc00.xml.

Please take another look at my previously posted explanation and work-around for this: ;)

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-712305


I'm just wondering if you're asking me to de-compile the bhm_bc00.bgl or is it KBHM_scenery.bgl.

Ken.


I understood that you already had de-compiled KBHM_scenery.BGL into KBHM_scenery.xml from your post here:

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-712282


If you misplaced that KBHM_scenery.xml file, please de-compile KBHM_scenery.BGL into KBHM_scenery.xml again ...to complete the task(s) in the tutorial above at:

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-712359


Hope this helps ! :)

GaryGB
 
Last edited:
Hi Gary,
The version 1.3.7 worked just fine. But when I drag and drop the KBHM_scenery.xml over the CompileHelper, all that comes up is the options menu. It doesn't report anything to me.

Ken.
 
Hi Gary,
The version 1.3.7 worked just fine. But when I drag and drop the KBHM_scenery.xml over the CompileHelper, all that comes up is the options menu. It doesn't report anything to me.

Ken.
Be sure that you have added the path to BGLComp.exe in CompileHelper "Options" dialog.

Also, be sure that both BGLComp.exe and BGLComp.xsd are in the same folder with each other. ;)

GaryGB
 
Be sure that you have added the path to BGLComp.exe in CompileHelper "Options" dialog.

Also, be sure that both BGLComp.exe and BGLComp.xsd are in the same folder with each other.

Hi Gary,
I've already done that in the Options Dialog and the BGLComp.xsd is in the same fold as the CompileHelper. I guess I have the path correct. I have the BGLComp9 path set to C:\SDK 2004\BGLComp\bglcomp.exe, which is where the SDK BGLComp.exe is located. Does the CompileHelper.exe take the place of the bglcomp.exe? I was just wondering if I should have drag and drop the KBHM_scenery.xml over the bglcomp.exe instead of CompileHelper. The thing I noticed is that after I copy and paste the updated placement, the KBHM_scenery.xml will not open in it's own XML after I saved it. I double click the file and I just get a blank page. Before I copy and pate, the KBHM_scenery.xml opens in its own XML. I even tired the original KBHM_scenery.xml and dragged it over the CompileHelper.exe and all I get is the Options menu. But I can drag it over the bglcomp.exe and it will re-compile to a bgl file. When I drag the copied and pasted KBHM_scenery.xml over the bglcomp.exe, it will not re-compile because this is the file that will not open in it's own XML. What I mean by "in its own file" is simply double clicking the XML file. Anytime it does not open in its own XML, it will not compile. But the original KBHM_scenery.xml will only compile if I use the bglcomp.exe. It will not compile or do anything if I use the CompileHelper. When I saved the KBHM_scenery.xml using the ConText, I clicked File and Save As to a certain folder. I've tried the File and Save, and it made no difference.

Ken.
 
Please attach herein, a ZIP of the "copied and pasted KBHM_scenery.xml" that won't re-compile when Dragged onto bglcomp.exe. :scratchch

GaryGB
 
Please attach herein, a ZIP of the "copied and pasted KBHM_scenery.xml" that won't re-compile when Dragged onto bglcomp.exe.


Hi Gary,

Here's the KBHM_scenery.xml that will not compile onto bglcomp.exe. But let me make sure I understand you correctly. You said in the instructions to drag and drop the KBHM_scenery.xml over the CompileHelper, and that's what I did. But did you mean to say CompileHelper or bglcom.exe? I'm sending you this file first and I'm going to send you another file, just like this one, that will open in it's own XML. Keep this in mind: The first one I'm sending you, which is this one, is after being copied and paste using the ConText. The next KBHM_scenery.xml that I'll send you has not been copied and paste and will compile onto bglcomp.exe, but neither one will not compile using the CopileHelper.exe. I'm sending them separately so that you want get them mixed up because they'll both have the same file name. The second one I'll be sending you has not been copied and paste by ConText, and that one will open in its own XML. So, the problem with not opening in its own XML is only after I copy and paste using the ConText. Let me make sure you understand what I mean when I say "in its own XML." What I mean is when using an XML editor, but I'm not using that when following your instructions. When the xml file is not doing what it's supposed to do, I used the editor to make sure it opens. It will open fine when I click on the View button or use the Context.

Ken.
 

Attachments

Last edited:
Please attach herein, a ZIP of the "copied and pasted KBHM_scenery.xml" that won't re-compile when Dragged onto bglcomp.exe.

Hi Gary,

Here's the second file, and this one will open in its own xml editor. This one has not been copied nor pasted using the Context.

Ken.
 

Attachments

The problem is that it is expecting a mdl file.

Was this created by AFD? If so, it is a model to exclude autogen.
 
Hi Ken:

Indeed, George is correct. :teacher:

The problem is that, due to an oversight on my part (late night ...at the end of a long day), I accidentally included the MDL definition portion of the XML "element" within the code copied from your edited "bhm_bc00.xml" ...which was intended to be pasted into "KBHM_scenery.xml".

I should have only included the "placement" info in the XML "element". :duck:


Corrected code is provided below; I have also edited the original in my post above on Page 1 of this thread < sorry ! :oops: > :


Code:
<SceneryObject
      lat="33.5612174123526"
      lon="-86.7512118816376"
      alt="0.0M"
      altitudeIsAgl="TRUE"
      pitch="0"
      bank="0"
      heading="0.999755859375"
      imageComplexity="VERY_SPARSE">
      <LibraryObject
         name="d22746774e738c67d58f1283da5cbc2f"
         scale="1.00"
         />
   </SceneryObject>

Please review the procedure again in the thread linked below, and paste the corrected code into the original "KBHM_scenery.xml" at the specified line numbers as also discussed previously; then re-compile to a BGL with FS 2004 SDK BGLComp. ;)

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-712359


I shall look forward to reading how this corrected code block works for you. :)

GaryGB
 
Last edited:
The problem is that, due to an oversight on my part (late night ...at the end of a long day), I accidentally included the MDL definition portion of the XML "element" within the code copied from your edited "bhm_bc00.xml" ...which was intended to be pasted into "KBHM_scenery.xml".


Hi Gary,

Thanks for correcting that. Okay, you stated here to re-compile to bgl with FS2004 SDK BGLComp but in the other thread, you said to re-compile to the CompileHelper. So, I'm confused as to which one I should use, or does it make any difference? Also, what is AFD? I think I knew it at one time and now I forget. I'll let you know how it turns out.

Ken.
 
Hi Gary,

Thanks for correcting that. Okay, you stated here to re-compile to bgl with FS2004 SDK BGLComp but in the other thread, you said to re-compile to the CompileHelper. So, I'm confused as to which one I should use, or does it make any difference?

If you have CompileHelper configured for use as a "front-end" GUI for BGLComp, then use that, as it will report results of BGLComp processing (and errors) in a message box.

If you do not yet have CompileHelper configured for use as a GUI front-end to BGLComp, just use BGLComp.exe and see if the file will produce a working BGL.

Also, what is AFD? I think I knew it at one time and now I forget. I'll let you know how it turns out.

Ken.

George will likely clarify what he meant by "AFD" tomorrow. ;)

Typically in the context of a discussion regarding MSFS, it would mean "Airport Facilities Data", and legacy airports were at one time (in much earlier versions of MSFS) referred to as "AFD" files, and IIRC, actually had AFD file extensions ...rather than BGL file extensions.

But the context in which George used it above suggested an abbreviation for a FS utility ( AFCAD? AFX ? AFW ? etc.), so I'm not certain what connotation George intended.

GaryGB
 
Last edited:
Sorry, I meant the program AFX :oops:

As the file contains FSX format GUIDs, you will need to use the FSX or P3D BglComp.
 
Hi Ken:

This post is to re-affirm that the intended BGL output format for this project is the same as the original BGL source format used for BGL2XML and MCX input:

KBHM_2008 was a FS9 scenery, and your BGLComp output is also for FS9. :pushpin:

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-711903

http://www.fsdeveloper.com/forum/threads/decompiling-a-bgl-file.434183/#post-712089


It appears that BGL2XML version 1.3.7 and MCX both correctly retained the FS9 GUID format for the MDL in your bhm_bc00.BGL.

It is from that de-compiled BGL output as bhm_bc00.XML that I copied the XML code posted above ( ...which is intended to be pasted into the specified lines of KBHM_Scenery.XML prior to re-compilation to a FS9 BGL with FS2004 SDK BGLComp). ;)


PS: Regarding MSFS GUID formats:

http://www.fsdeveloper.com/forum/threads/converted-bgl-works-sort-of.425143/#post-629744

https://msdn.microsoft.com/en-us/library/cc526978.aspx#GUIDFormats

http://www.fsdeveloper.com/forum/resources/guid-processor.99/

http://stuff4fs.com/newpage.asp?Folder=Guid

GaryGB
 
Last edited:
Sorry, I'll shut up.

Perhaps only the eyelids, and for naught but a brief nap after "a wee dram" ? ;)

http://www.fsdeveloper.com/forum/threads/may-be-slow-to-respond-for-a-few-days.434266/#post-712706


But, afterwards, we'd be looking forward to seeing you "go do ...the voodoo ...that you do ...so well": :D

...which is, IMHO, sharing your considerable insights and keeping the standards for precision and quality in FS development "high" for the MSFS community (even if sometimes conveyed with well-intended acerbic wit !). :)

GaryGB
 
Hi Gary and George,
Just want to let you know that everything worked out okay. I have the terminal re-positioned but it still needs fine tuning. I have no way of knowing for sure if all of the dimensions are accurate unless there's a way I can measure it in MCX. Is that possible? I don't know if this will help but I'm going to use Google Earth and bring up the KBHM airport satellite image. I'm going to use the Ruler that's use to measure distance as well as the heading. I'm going to draw a straight line from the center of the C concourse to the center of the parking deck. This should give me an accurate heading so that I'll know how many degrees to rotate if needed as well as taking a note of the measurement. I also want to take note of the coordinates of each area that's needed, such as the parking outline on the apron. Now that I have the terminal placed near the correct location, I'll also need to re-position the parking outline that's on the apron, designating the parking spot for each gate. Since I have moved the terminal, the parking outline will also have to be moved so that they line up with the terminal and gates. I've tried this and it seems to work just fine, but tell me if I'm doing this right or not, and if there's a better way to re-position the parking outlines. In the BHM2008, there are 2 files, and I think they are model file, correct me if I'm wrong. The files are mldg_outline.bgl and mldg_outline2.bgl. When I import these 2 files using MCX, they show the parking outline. I use the button Place and convert and I bring up the Bing satellite image and line the cross over the image outline where it should go. I also took note of the coordinates. Then I exported the file and de-compiled it into xml. After doing this, I got to thinking that the parking outlines must also be in the KBHM_scenery.xml and sure enough it listed all 20 of those outlines, since there are 20 gates. I just wish it would list the gate number but all 20 of them have the same GUID number. I assume it doesn't matter which parking outline I use because they're not designated to any particular gate. The only thing I have to go by is the heading and coordinates and I'll have to keep up with what I've already replaced. What I'm doing is taking note of the coordinates and the headings of each outline, searched for the GUID number in the KBHM_scenery.xml using ConTEXT and edited or changed the coordinates and heading to match the real world. I ran FS and it moved the parking outline just fine, but it didn't line up perfectly. If there's a better way, let me know.

Gary, you said if I have CompileHelper configured for use as a "front-end" GUI for BGLComp, then use that. What do you mean by "front-end?"

Ken.
 
Last edited:
Hi Gary and George,
Just want to let you know that everything worked out okay. I have the terminal re-positioned but it still needs fine tuning. I have no way of knowing for sure if all of the dimensions are accurate unless there's a way I can measure it in MCX. Is that possible? I don't know if this will help but I'm going to use Google Earth and bring up the KBHM airport satellite image. I'm going to use the Ruler that's use to measure distance as well as the heading. I'm going to draw a straight line from the center of the C concourse to the center of the parking deck. This should give me an accurate heading so that I'll know how many degrees to rotate if needed as well as taking a note of the measurement. I also want to take note of the coordinates of each area that's needed, such as the parking outline on the apron. Now that I have the terminal placed near the correct location, I'll also need to re-position the parking outline that's on the apron, designating the parking spot for each gate. Since I have moved the terminal, the parking outline will also have to be moved so that they line up with the terminal and gates. I've tried this and it seems to work just fine, but tell me if I'm doing this right or not, and if there's a better way to re-position the parking outlines. In the BHM2008, there are 2 files, and I think they are model file, correct me if I'm wrong. The files are mldg_outline.bgl and mldg_outline2.bgl. When I import these 2 files using MCX, they show the parking outline. I use the button Place and convert and I bring up the Bing satellite image and line the cross over the image outline where it should go. I also took note of the coordinates. Then I exported the file and de-compiled it into xml. After doing this, I got to thinking that the parking outlines must also be in the KBHM_scenery.xml and sure enough it listed all 20 of those outlines, since there are 20 gates. I just wish it would list the gate number but all 20 of them have the same GUID number. I assume it doesn't matter which parking outline I use because they're not designated to any particular gate. The only thing I have to go by is the heading and coordinates and I'll have to keep up with what I've already replaced. What I'm doing is taking note of the coordinates and the headings of each outline, searched for the GUID number in the KBHM_scenery.xml using ConTEXT and edited or changed the coordinates and heading to match the real world. I ran FS and it moved the parking outline just fine, but it didn't line up perfectly. If there's a better way, let me know.
Congratulations on successfully editing the original bhm_bc model, and its placement location via your derived bhm_bc00.bgl and KBHM_scenery.bgl ! :D


Use Instant Scenery to re-position objects placed via BGLComp-type XML in KBHM_scenery.bgl; it's well worth the cost, and works in both FS9 and FSX:

FYI
: IIRC, the Instant Scenery fully-functional demo works within 50 Miles of Seattle :idea:

http://www.flight1.com/products.asp?product=iscen3


Gary, you said if I have CompileHelper configured for use as a "front-end" GUI for BGLComp, then use that. What do you mean by "front-end?"

CompileHelper provides a Windows GUI message box for console output by any of the CMD-mode FS compilers it can link to in the "Options" dialog.

GUI = "Graphical User Interface" (aka "front-end")

CMD-mode = Text characters at a "DOS-look-alike" command prompt


Hope this helps ! :)

GaryGB
 
Last edited:
Hi Gary,
What's the best way, or how do I go about disabling the original bgl files that I need to disable?

Ken.
 
I prefer adding a copy of 1 or more such files to a ZIP with a descriptive filename, then deleting the originals.

If the original copies are ever un-ZIPPED, they will have had no change in their file name, file size, or file date etc.

Hope this helps ! :)

GaryGB
 
Last edited:
I put the BGL files I no longer want active into the main scenery folder of that addon scenery (i.e. the parent folder of the scenery and texture folders). That way they are easily seen and understood to be removed from the active scenery. If you want something more, create a Removed folder and place them into that.
 
Status
Not open for further replies.
Back
Top