• 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.
Messages
845
Hi,
I have the BGL2XLM program and I understand that it's supposed to decompile all bgl files. When I try to decompile the file bhm_a.bgl and bhm_bc.bgl, I get the following message:

Value cannot be null.
Parameter name: filename


Why want it decompile the files and what does this mean? These are the files that contain the main terminal building at KBHM. This is from the BHM2008.zip Birmingham Airport file. By the way, I did get permission to edit them. He said that the terminal was designed using GMax and can be edited using GMax but he stated that he thought the files would have to be decompiled first. I also need to reposition the terminal but do I use GMax to do that or do I use the XML after decompiling? I explained that I need to remodel the C concourse and then add the brand new terminal to it.

Ken.
 
Messages
6,904
Country
us-illinois
[EDITED]

As a followup to the OP's previous recent thread which on "page-2" ...mentioned KBHM at:

http://www.fsdeveloper.com/forum/threads/new-project-is-not-showing-in-fs.433891/page-2


The 2 BGL files cited above are both FS9 BGLComp format scenery object libraries.

http://www.flightsim.com/vbfs/fslib.php?do=copyright&fid=119370


Each of the scenery object library BGL files cited above contain (1) MDL each, and are "Geo-locked" (they have both the MDL and its BGLComp-XML placement info inside the same file).

[END_EDIT]

These BGLs may be imported into ModelConverterX (aka "MCX"); export objects to a file that can be imported into GMAX for edits. :idea:

GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,595
Country
unitedkingdom
Sounds like you are using a version of Bgl2Xml that contains a bug. I believe we released an update.
 
Messages
6,904
Country
us-illinois
I've tried your suggestions but I'm still not doing something right. Will you be more specific and give complete details.

Ken.

AFAIK, GMAX does not have the ability to open and edit MDL files, so IMHO, you may not need to use BGL2XML for your task. :idea:


BGL2XML is certainly an excellent utility for other purposes, however. :wizard:


Assuming you have the author's permission, and you have the latest development version of ModelConverterX installed, what is it that you believe you are not doing right with the (thus far) briefly described workflow ? :scratchch

"Please" 'be more specific and give complete details' ...of what you need /want help with. ;)


[EDITED]

Assuming also that this project is exclusively for your own personal use, you could download a newer, more detailed KBHM terminal as a KMZ model ("BHM.kmz") ...from the 3D Warehouse at:

https://3dwarehouse.sketchup.com/model.html?id=464e5bbce31cfe2dc8c59bc53bd5954c


...and edit it in Sketchup (or import / convert / export it to a file that GMAX can use via MCX)

Sketchup Menu > Import > { file type: Google Earth/COLLADA Files (*.kmz, *.dae) } > [file name: "BHM.kmz" ]

NOTE: This textured 3D model can be seen in Google Earth using this location query string:

"Birmingham Airport, KBHM, Birmingham, AL"


BTW: Sketchup can directly import aerial images with terrain from Google Maps (almost always the same dated imagery seen in Google Earth), and the current imagery at KBHM is very good, with perfect lighting to distinguish detail of buildings (which can be modeled / textured after 'extruding' their footprints traced on the imported "Google snapshot" imagery).



PS: You may find some other 3D building models for Birmingham, AL which might be of use if your project area extends outside the airport ...at this URL:

https://3dwarehouse.sketchup.com/search.html?q=Birmingham AL&rsi=sbis&backendClass=entity


Hope this helps with exploring your options. :)

[END_EDIT]

GaryGB
 
Last edited:
Messages
845
AFAIK, GMAX does not have the ability to open and edit MDL files, so IMHO, you may not need to use BGL2XML for your task. :idea:


BGL2XML is certainly an excellent utility for other purposes, however. :wizard:


Assuming you have the author's permission, and you have the latest development version of ModelConverterX installed, what is it that you believe you are not doing right with the (thus far) briefly described workflow ? :scratchch

"Please" 'be more specific and give complete details' ...of what you need /want help with. ;)


[EDITED]

Assuming also that this project is exclusively for your own personal use, you could download a newer, more detailed KBHM terminal as a KMZ model ("BHM.kmz") ...from the 3D Warehouse at:

https://3dwarehouse.sketchup.com/model.html?id=464e5bbce31cfe2dc8c59bc53bd5954c


...and edit it in Sketchup (or import / convert / export it to a file that GMAX can use via MCX)

Sketchup Menu > Import > { file type: Google Earth/COLLADA Files (*.kmz, *.dae) } > [file name: "BHM.kmz" ]

NOTE: This textured 3D model can be seen in Google Earth using this location query string:

"Birmingham Airport, KBHM, Birmingham, AL"


BTW: Sketchup can directly import aerial images with terrain from Google Maps (almost always the same dated imagery seen in Google Earth), and the current imagery at KBHM is very good, with perfect lighting to distinguish detail of buildings (which can be modeled / textured after 'extruding' their footprints traced on the imported "Google snapshot" imagery).



PS: You may find some other 3D building models for Birmingham, AL which might be of use if your project area extends outside the airport ...at this URL:

https://3dwarehouse.sketchup.com/search.html?q=Birmingham AL&rsi=sbis&backendClass=entity


Hope this helps with exploring your options. :)

[END_EDIT]

GaryGB


Hi Gary,
Here's what I've done so far. I've downloaded and installed the development release of Model ConverterX. I've watched a video on YouTube that explains placing and converting objects so here's what I did. As I explained, I wanted to reposition the main terminal build that is in the file bhm_bc.bgl. This is the file that has the model terminal in it in the BHM2008.zip. When I open the ConverterX, I clicked on the Wizard button and click select the Convert and Place Object Wizard. In the Convert window that opens, I select the file to convert, which is the bhm_bc.bgl by clicking the button. I left the Select Output Folder as is. It was set to C:\FS9\Addon Scenery. The Output Name was given bhm_bc00. I selected the FS version, which is FS2004. Then I clicked Show Map. I positioned the crosshair over the terminal location using the satellite image. Then I clicked the Convert button. I ran FS and it did the index of the new scenery files At first, the top view of the terminal in FS was still in the same location. So, I closed the simulator and place the file bhm_bc00 in different locations. The bhm_bc.bgl is actually in the BHM2008 Scenery folder, not in the Addon Scenery folder where the Output Folder was set in ConverterX. I'm not sure if this is what it means. So, I tried it again and set the Output Folder to C:\FS9\Addon Scenery\BHM2008\Scenery. This is the where the bhm_bc.bgl is located. This time when I ran FS and looked at the Top Down view, there were 2 of these models, the original and the one I repositioned. So now I have 2 terminals. I've even removed the bhm_bc.bgl from the BHM2008 but I still get 2 terminals side by side. It's just like if I've copied and made another one. So, I must have left something out. If I did this correctly, how do I remove the original terminal? Should I just have used the Import and Export buttons after repositioning the model or would that made any difference? It seems that repositioning the object worked fine but the old object still remains. Does it have the be excluded?

Ken.
 
Last edited:
Messages
6,904
Country
us-illinois
Hi Ken:

I shall assume this project is for your own personal use, and is not to be re-distributed to others.


When BHM2008 is installed:

BHM2008\Scenery\bhm_bc.BGL contains only (1) object, and is a scenery library only ...with NO placement information.

BHM2008\Scenery\KBHM_scenery.bgl contains only placement information for scenery library objects (...and is NOT a library)

By default when MCX imports the MDL from bhm_bc.BGL and exports / places it into bhm_bc00.BGL, it retains the same GUID.

Also, by requesting MCX to 'place' the new copy of that object ('from' the library entry sub-section of bhm_bc00.BGL), when MCX exported a new copy of that object, placement info was also written unto the bhm_bc00.BGL along with the new MDL.


Because the placement location assigned via MCX to the new copy of that object inside bhm_bc00.BGL is slightly offset from the placement location used in the original KBHM_scenery.bgl, when the identical GUID for the new copy of that object is placed (2) times by FS (once by the 'new' bhm_bc00.BGL, and once by the 'old' KBHM_scenery.bgl), the (2) "instances" of that same object ...are displayed offset from each other.


I'd recommend that you retain the same GUID for the original object when imported into MCX as before, but this time re-export from MCX without placement information, as the object has already been 'placed' via BHM2008\Scenery\KBHM_scenery.bgl.

When you re-export the new copy of that object into ex: bhm_bc00.BGL, direct the output path into the original BHM2008\Scenery\ sub-folder (...over-writing any prior exported copies of the bhm_bc00.BGL)

Then disable the original BHM2008\Scenery\bhm_bc.BGL scenery object library by adding a copy to a ZIP file as a backup , then delete that original BGL.

IIUC, you will want to retain all other files 'intact and un-edited' ...in the BHM2008\Scenery sub-folder, including the KBHM_scenery.bgl (...which places all scenery library objects at KBHM).


Hope this helps ! :)

GaryGB
 
Last edited:
Messages
845
but this time re-export from MCX without placement information, as the object has already been 'placed' via BHM2008\Scenery\KBHM_scenery.bgl.

Hi Gary,
Yes, this project is just for my own personal use and will not be re-distributed to others. I'm not sure if I understand you correctly but you mentioned that when I export from MCX, export it "without placement information." Do you mean without repositioning the terminal building? The reason I wanted to reposition the terminal is because it's position is off anywhere from 150 to 200 feet to the south, and I want to place it in the real world location. Sometimes, objects are just placed near where they should go, but not precisely. I noticed you keep saying KBHM_scenry.bgl, but I wanted to be sure you know that I did not import that one. The only one I imported is the bhm_bc.bgl. I went and imported the KBHM_scenery.bgl file, but nothing happens and the screen just remains blue and says No objects found in file at the bottom under message. So, if the KBHM_scenery.bgl has objects in this file, and since you said that the object has already been placed in this file, why is it that the object does not show up in MCX? I just assumed that it was a scenery file only. So, is it possible for me to reposition objections without it showing two objects?

Ken.
 
Last edited:
Messages
6,904
Country
us-illinois
The reason I wanted to reposition the terminal is because it's position is off anywhere from 150 to 200 feet to the south, and I want to place it in the real world location. Sometimes, objects are just placed near where they should go, but not precisely.

So, is it possible for me to reposition objections without it showing two objects?
OK, then if you wish to use the new copy of that object inside bhm_bc00.BGL with the same GUID, but with its updated and corrected placement location, you certainly can use that file without any changes from its current version.

However, you will instead have to:

1.) de-compile the KBHM_scenery.bgl into ex: 'KBHM_scenery.xml'

2.) edit the KBHM_scenery.xml to remove the placement info for the MDL GUID of that scenery object inside bhm_bc00.BGL

3.) re-compile the KBHM_scenery.xml back into KBHM_scenery.bgl with FS SDK BGLComp.

You will then have the MDL inside bhm_bc00.BGL placed only once, by the same BGL which contains both the object itself ...and its placement instructions.

I noticed you keep saying KBHM_scenry.bgl, but I wanted to be sure you know that I did not import that one. The only one I imported is the bhm_bc.bgl. I went and imported the KBHM_scenery.bgl file, but nothing happens and the screen just remains blue and says No objects found in file at the bottom under message. So, if the KBHM_scenery.bgl has objects in this file, and since you said that the object has already been placed in this file, why is it that the object does not show up in MCX? I just assumed that it was a scenery file only.

Ken.

Correct; MCX will not find any objects in KBHM_scenery.bgl as it only contains placement information ...not MDLs.

When I stated "the object has already been 'placed' via BHM2008\Scenery\KBHM_scenery.bgl", I meant that the object MDL is inside the scenery library BGL bhm_bc00.BGL and NOT inside KBHM_scenery.bgl.

KBHM_scenery.bgl contains
ONLY placement instructions which refer to the object MDL by its GUID; the FS run time rendering engine gets the actual MDL itself from the scenery library (inside bhm_bc00.BGL).


PS: If you attach a ZIP file of the bhm_bc00.BGL (which you exported from MCX containing both the MDL and updated / corrected placement info) to your post in this thread, someone here may be able to assist you with performing the de-compile / edit / re-compile procedure described above. ;)


Hope this helps explain things more clearly for you. :)

GaryGB
 
Last edited:
Messages
845
OK, then if you wish to use the new copy of that object inside bhm_bc00.BGL with the same GUID, but with its updated and corrected placement location, you certainly can use that file without any changes from its current version.

However, you will instead have to:

1.) de-compile the KBHM_scenery.bgl into ex: 'KBHM_scenery.xml'

2.) edit the KBHM_scenery.xml to remove the placement info for the MDL GUID of that scenery object inside bhm_bc00.BGL

3.) re-compile the KBHM_scenery.xml back into KBHM_scenery.bgl with FS SDK BGLComp.

You will then have the MDL inside bhm_bc00.BGL placed only once, by the same BGL which contains both the object itself ...and its placement instructions.



Correct; MCX will not find any objects in KBHM_scenery.bgl as it only contains placement information ...not MDLs.

When I stated "the object has already been 'placed' via BHM2008\Scenery\KBHM_scenery.bgl", I meant that the object MDL is inside the scenery library BGL bhm_bc00.BGL and NOT inside KBHM_scenery.bgl.

KBHM_scenery.bgl contains
ONLY placement instructions which refer to the object MDL by its GUID; the FS run time rendering engine gets the actual MDL itself from the scenery library (inside bhm_bc00.BGL).


PS: If you attach a ZIP file of the bhm_bc00.BGL (which you exported from MCX containing both the MDL and updated / corrected placement info) to your post in this thread, someone here may be able to assist you with performing the de-compile / edit / re-compile procedure described above. ;)


Hope this helps explain things more clearly for you. :)

GaryGB


Hi Gary,
Yes, I think I understand all of this better now. I removed the file KBHM_scenery.bgl from the BHM2008 and it did remove the original terminal and left it with only the one I re-positioned, but it also removed some of the other scenery elements, such as the parking information on the apron. So, now I better understand that this file only contains placement information and not the object. You mentioned to edit the KBHM_scenery.xml and remove the placement information for the MDL GUID that was inside bhm_bc00.GBL. Do I get that information clicking the Object Information button in MCX? I assume it's those long string of numbers you're referring to. If so, does that GUID number in the KBHM_scenery.xml suppose to match the one in the bhm_bc.00 exactly? I assume I use the BGL2XLM de-compiler to edit the KBHM_scenery.xml. I did that and I searched for that exact GUID number and I don't see that exact number, but the last one at the very bottom does come very close to it. So, I'm going to attach the zip file and let someone assist me to be sure I do this right. By the way, do I need an XML editor? Thanks so much for all of your help

Ken.
 

Attachments

  • bhm_bc00.zip
    78.2 KB · Views: 283
Last edited:
Messages
6,904
Country
us-illinois
Hi Ken:

Just to confirm... Which version of FS did you want the scenery object exported and placed for: FS9, FSX, or both ? :scratchch

I'll be back in town later today, and will look into this further at that time. :)

GaryGB
 
Messages
845
Hi Ken:

Just to confirm... Which version of FS did you want the scenery object exported and placed for: FS9, FSX, or both ? :scratchch

I'll be back in town later today, and will look into this further at that time. :)

GaryGB


Hi Gary,
The version I'm working on is FS9. When you said someone here may be able to assist me with performing the de-compile / edit / re-compile procedures, did you mean to do it for me or show me how to do it? I prefer to be shown how to do it. You mentioned to re-compile the KBHM_scenery.xml back into KBHM_scenery.bgl using FS SDK BGLComp. I've tried that but nothing happens. Let me explain: I Used the bgl2xml to de-compile the KBHM_scenery.gbl to KBHM_scenery.xml. After doing that, I've noticed that the file name says KBHM_scenery.bgl.xml. Is that the correct file name? It thought the file name should be KBHM_scenery.xml. My xmls are saved to C:User\Username\Desktop\Output XML. When I first tried to compile the KBHM_scenery.xml, I would double click the Compile2.exe in the SDK but a window would just pop up for a spilt second and go away. It appears to be a DOS application, but I could be wrong. It doesn't stay on the screen long enough to know anything. Then I read that I'm supposed to drag and drop the file over the Compile2.exe. They don't tell you that in the Compile2 SDK document manual. Well, I've tried that and it still does not do anything and I do have the MSXML 4.0 installed as well as MS Netframework 4.5. Based on what I've read in the AVSIM post, it's supposed to compile to KBHM_scenery.bgl in the same folder as the Compile2.exe. So, I don't understand why it's not doing that. In the mean time, I found out that I can de-compile using the XML2BGL. I've tried that and it seems to work. But the thing I noticed is that the file name would be KBHM_scenery.xml.bgl. What's with having both xml and bgl in the file name? I also noticed that when I de-compile using the BGL2XML, it opens the xml in a text file when I click the View button. Is this where I edit the xml or do I need to have an XML Editor? I do have one if I need it.

Ken.
 
Last edited:
Messages
6,904
Country
us-illinois
Hi Gary,
The version I'm working on is FS9. When you said someone here may be able to assist me with performing the de-compile / edit / re-compile procedures, did you mean to do it for me or show me how to do it? I prefer to be shown how to do it.
I intended to show you how to do it; pending your replies to the questions below, I anticipate having some time to further explain the process in some detail later today (Monday). ;)



You mentioned to re-compile the KBHM_scenery.xml back into KBHM_scenery.bgl using FS SDK BGLComp. I've tried that but nothing happens. Let me explain: I Used the bgl2xml to de-compile the KBHM_scenery.bgl to KBHM_scenery.xml. After doing that, I've noticed that the file name says KBHM_scenery.bgl.xml. Is that the correct file name? It thought the file name should be KBHM_scenery.xml.

In the mean time, I found out that I can de-compile using the XML2BGL BGL2XML. I've tried that and it seems to work. But the thing I noticed is that the file name would be KBHM_scenery.xml.bgl. What's with having both xml and bgl in the file name?
By default, BGL2XML would submit a name such as "KBHM_scenery.bgl.xml".

When using BGL2XML:

* in the "Input BGL field" you browse to a path (drive letter\sub-folder), and select a BGL file name to de-compile from

...and:

* in the "Output XML field" you browse to a path where the XML file is to written, and specify a file name to de-compile into

You can over-strike the name which BGL2XML submits by default to remove the extra ".bgl" string in the file name; thus you can instead use the name KBHM_scenery.xml, so that when it is re-compiled via FS 2004 SDK BGLComp.exe, it will have the same name as the original file you de-compiled.

My xmls are saved to C:User\Username\Desktop\Output XML. When I first tried to compile the KBHM_scenery.xml, I would double click the Compile2.exe in the SDK but a window would just pop up for a split second and go away. It appears to be a DOS application, but I could be wrong. It doesn't stay on the screen long enough to know anything. Then I read that I'm supposed to drag and drop the file over the Compile2.exe. They don't tell you that in the Compile2 SDK document manual. Well, I've tried that and it still does not do anything and I do have the MSXML 4.0 installed as well as MS Netframework 4.5. Based on what I've read in the AVSIM post, it's supposed to compile to KBHM_scenery.bgl in the same folder as the Compile2.exe. So, I don't understand why it's not doing that.
I am not familiar with a Compile2.exe, and Google returns no hits for that string; are you instead referring to FS SDK BGLComp.exe ?

Alternatively, are you using BGLComp linked with Arno's "CompileHelper.exe" utility ?

Also, please provide a link in this thread ...to the 'AVSIM post' you cited above.


BTW: FS SDK BGLComp.exe is indeed a "DOS" (aka "CMD / Command Mode") utility, and normally only briefly opens a CMD window, then immediately closes it when has finished its task.


I also noticed that when I de-compile using the BGL2XML, it opens the xml in a text file when I click the View button. Is this where I edit the xml or do I need to have an XML Editor? I do have one if I need it.
Ken.
A text editor such as Windows NotePad works OK, as long as you manually change the saved output file type aka 'Save as type' to "All Files (*.*)" each time to enable use of a XML file extension when finished editing (...rather than the default TXT file extension type).

GaryGB
 
Last edited:
Messages
845
I am not familiar with a Compile2.exe, and Google returns no hits for that string; are you instead referring to FS SDK BGLComp.exe ?

Alternatively, are you using BGLComp linked with Arno's "CompileHelper.exe" utility ?

Also, please provide a link in this thread ...to the 'AVSIM post' you cited above.


BTW: FS SDK BGLComp.exe is indeed a "DOS" (aka "CMD / Command Mode") utility, and normally only briefly opens a CMD window, then immediately closes it when has finished its task.



Hi Gary,
Yes, that's what I'm referring to, the FS SDK BGLComp.exe. I don't know why I put that 2 in there. As far as Arno's CompileHelper Utiltiy, I don't have it yet and I'll download it later. As far as nothing happening when I drag and drop the xml file over the SDK bglcomp.exe, I think I have it figured out. What I was doing was placing the xml file on my desktop and dragging it from the desktop over the bglcomp.exe in the SDK BGLComp folder. Apparently, the xml file must be inside the SDK BGLComp folder, where the bglcomp.exe is located. Then when I drag and drop the xml file over the bglcomp.exe, it compiled it into a bgl file. Here's the link to what I cited above, but it wasn't AVSIM, it was FS World.

http://www.flightsimworld.com/forums/topic/40564-bgl-compiler/

So, you can give me assistance now. I also need to know how I locate the correct GUID in the xml file because it lists a lot of them.

Ken.
 
Last edited:
Messages
6,904
Country
us-illinois
Here's the link to what I cited above, but it wasn't AVSIM, it was FS World.

Thanks for the link; I enjoy reading some of the posts by "Sarge" now and then ! :D
Sarge said:
http://www.flightsimworld.com/forums/topic/40564-bgl-compiler/

Ask and ye shall receive.
Knock and it shall be opened unto you.
Invite me in and I'll raid the refrigerator and liquor cabinet!
cool.png


So, you can give me assistance now. I also need to know how I locate the correct GUID in the xml file because it lists a lot of them.

Ken.

"Ask and ye shall receive.
Knock and it shall be opened unto you.
Invite me in and I'll raid the refrigerator and liquor cabinet!
"
cool.png


Well, OK... just joking. :laughing:

< Tutorial coming up shortly; starting this later than planned as I was called out onto the road again today ! ;) >

GaryGB
 
Last edited:
Messages
6,904
Country
us-illinois
Hi Ken:

I'll have to post this in stages as my limited available time permits this evening. :pushpin:


[Part 1 of 2 Parts]


First, lets prepare for an easier-to-troubleshoot edit of the KBHM_scenery.XML file using either of these excellent freeware text editors that I use (and presently have installed), ...and which feature an easy to toggle line-numbering mode:


Please use 1 of these, rather than NotePad or the XML editor you mentioned you already have, as it will save both of us some time and effort to get the edit completed promptly and correctly. ;)


* Download "Notepad++" at:

https://notepad-plus-plus.org/download/v6.7.8.2.html

I recommend that you get the basic "Notepad++ Installer"

https://notepad-plus-plus.org/repository/6.x/6.7.8.2/npp.6.7.8.2.Installer.exe



NOTE: In NotePad++ Menu > Settings > Preferences > Editing > 'check' "Display Line Number"


...or:


* Download "ConTEXT" at:

http://www.contexteditor.org/index.php

I recommend that you get the "Desktop version"



NOTE
: In Context Menu > Options > Environment Options > Editor > 'check' "Line Numbers"



Second, lets prepare for an easier-to-troubleshoot re-compile of the KBHM_scenery.XML file (...after it is edited.)

A) Download Arno's "CompileHelper 2.0":

http://www.fsdeveloper.com/forum/resources/compilehelper.121/


B) Install CompileHelper 2.0 into the FS9 BGL compiler SDK folder at:

[FS2004 SDK install path]\BGLComp_SDK


C) Configure CompileHelper 2.0 path to the FS9 version of BGLComp.exe under 'Options' per the Manual:

http://www.fsdeveloper.com/wiki/index.php?title=CompileHelper_2.0



< ...Continued below > :idea:

GaryGB
 
Last edited:
Messages
6,904
Country
us-illinois
[Part 2 of 2 Parts]

Third, lets get the info we need to edit the KBHM_scenery.XML file by de-compiling your bhm_bc00.BGL with BGL2XML


In BGL2XML GUI:

1.) in the "Input BGL field", browse to the sub-folder containing your bhm_bc00.BGL which has the updated placement location you assigned via MCX, and select that BGL file name to be de-compiled from

...and:

2.) in the "Output XML field", browse to the same path sub-folder containing the above bhm_bc00.BGL file, and specify the file name "bhm_bc00.xml" to de-compile into


3.)
Click "Go
"

4.) Click "View" ("bhm_bc00.xml" should open in ex: Windows NotePad; you may keep this NotePad window open for reference)


In "bhm_bc00.xml", select, then Menu > Edit > Copy all characters in this following section of that file open in NotePad:

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>


Fourth
, lets paste the copied XML source code into the target KBHM_scenery.XML file.


In either NotePad++ or Context, open the KBHM_scenery.XML file in ex:

[BHM2008 install path]\Scenery\ sub-folder


A) 'Select' line numbers 1533 through- and including- line 1545 (do NOT "copy" them; they are intended to be over-written)


B)
"Paste" to over-write those lines with text already copied into Windows clipboard from the above "bhm_bc00.xml" ...by:

* Holding down the {Ctrl} key and tapping the {"V"} key once (...which is the Windows 'Paste / Insert here' command)

...or:

* text editor menu > Edit > Paste


C)
Save the KBHM_scenery.XML file with the same file name and XML file extension; allow the original to be over-written.



Fifth
, lets re-compile the KBHM_scenery.XML file into a BGL file


A) Drag-and-Drop the edited / saved KBHM_scenery.XML file onto CompileHelper 2.0 in the FS9 BGL compiler SDK folder at ex:

[FS2004 SDK install path]\BGLComp_SDK


B)
CompileHelper 2.0 will report results of the requested re-compilation of KBHM_scenery.XML into KBHM_scenery.BGL


C)
If CompileHelper 2.0 reports "Parse Complete", the re-compiled KBHM_scenery.BGL is ready to test in FS9.


If there compile errors, problems, or questions, please post them in this thread, and I will try to offer further assistance with this. :teacher:


FYI: The name="d22746774e738c67d58f1283da5cbc2f" parameter value is the FS9-format GUID of your MDL object


PS
: Be sure the original [BHM2008 install path]\Scenery\bhm_bc.BGL is disabled. ;)


Hope this helps ! :)

GaryGB
 
Last edited:
Messages
845
< ...To be continued after you post back here that you have these 2 steps completed >

Hi Gary,
I've completed all of the steps you've posted. The link you posted http://www.fsdeveloper.com/forum/downloads.php?do=file&id=75 does not work at all and gives an error message. I got the CompilerHelper 2.0 under the Tools section. I've also got the ConTEXT installed and checked the Line Numbering box. As far as the CompilerHelper 2.0, I wanted to let you know where I have it installed so you can let me know if that's okay. When I installed the FS2004 SDK, I did not install it to the default location. I have it installed in C\SDK 2004, and of course, the BGLComp is in the SDK 2004 folder. So, the BGLComp.exe is in: C:\SDK 2004\BGLComp. The CompilerHelper 2.0 is in the C:\SDK 2004\BGLComp. I also configured the BGLComp9 path to C:\SDK 2004\BGLComp. This is what I've done so far.

Ken.
 
Messages
6,904
Country
us-illinois
< ...To be continued after you post back here that you have these 2 steps completed >

Hi Gary,
I've completed all of the steps you've posted. The link you posted http://www.fsdeveloper.com/forum/downloads.php?do=file&id=75 does not work at all and gives an error message. I got the CompilerHelper 2.0 under the Tools section. I've also got the ConTEXT installed and checked the Line Numbering box. As far as the CompilerHelper 2.0, I wanted to let you know where I have it installed so you can let me know if that's okay. When I installed the FS2004 SDK, I did not install it to the default location. I have it installed in C\SDK 2004, and of course, the BGLComp is in the SDK 2004 folder. So, the BGLComp.exe is in: C:\SDK 2004\BGLComp. The CompilerHelper 2.0 is in the C:\SDK 2004\BGLComp. I also configured the BGLComp9 path to C:\SDK 2004\BGLComp. This is what I've done so far.

Ken.

Configure CompileHelper 2.0 with an updated path to the FS9 version of BGLComp.exe under 'Options' per the Manual:

http://www.fsdeveloper.com/wiki/index.php?title=CompileHelper_2.0
Thanks for the heads up on the dead-end link; I've updated the link above to download CompileHelper 2.0.


AFAIK, as long as CompilerHelper 2.0 has the path to BGLComp.exe updated, the folder location can be wherever you wish. ;)

GaryGB
 
Last edited:
Messages
845
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? 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. I'm just wondering if you're asking me to de-compile the bhm_bc00.bgl or is it KBHM_scenery.bgl.

Ken.
 
Last edited:
Status
Not open for further replies.
Top