Jump to content
Sign in to follow this  
martinlest2

Way in over my head. Help - please!

Recommended Posts

Could anyone kindly help me re. decompliling & recompiling bgl files? With the old, 'FS8' type files I am pretty OK with disassembling, editing the .sca file and recompiling with SCASM - nothing to it really. But I am at a loss with the new FS9 XML type files. My current 'project' is a case in point: I have a hefty scenery library bgl file, some 1000kb, which I can see is the cause of my having buildings on one of my runways. I have BGLAnalyze (FS9), MSXML4 & BGLCOMP_SDK. I've tried going through the FS2004BGLCompSDK.doc, but I don't understand too much of it, I'm afraid .....What I've done thus far is use BGLAnalyze to disassemble the bgl: if I do so to XML I get a few dozen lines each starting "ModelData name=", then a long code and the source file. When I choose text, I get dozens of small .mdl files. And that's as far as I can get.Clearly I am almost beyond hope here!! Even so, if there were anyone with huge patience who would be kind enough to show me what to do now, I'd be most grateful! How do I now do what I could so easily manage if I were dealing with one of the earlier bgl format files: find where the offending bitmaps are located, delete them from the code and recompile to a new bgl? (I assume SCASM won't work with the XML format and I do indeed need the BGLCOMP_SDK).Thank you very much in advance!!!Martin

Share this post


Link to post
Share on other sites

Oh, I did look through the 'Beginner's Guide to Scenery Design' sticky post here, but didn't really see the answers I was looking for....

Share this post


Link to post
Share on other sites

Hello Martin,Bad news, what you want cannot be done anymore (at least, not easily.)When you decompile an object library in the new format, all you get is the models in mdl format, plus the list of the contents (objects) in the library.We do not yet have any tools for taking apart a mdl file (and finding the relevant textures), but perhaps Arno has some way of doing this.Best regards.Luis

Share this post


Link to post
Share on other sites

Well, that's not the answer I was expecting, I must admit. I am really surprised. Thanks for the comment of course Luis. I suppose at least I have the compensation of realising I wasn't being quite as thick as I had imagined!Looks like, for the sake of the runway buildings, I am going to have to delete the whole bgl file - that clears the problem, but at over 1MB I imagine I will be throwing away one ####-of-a lot of baby with the bathwater ...Martin

Share this post


Link to post
Share on other sites

One other thing occurs to me - you say we cannot take apartan mdl file, but is it possible for me to recompile the bgl file from the various mdl files, leaving out one or two until I find the culprit (i.e. treat the mdl files as if they were objects in an FS8 bgl file)?MartinAVSIM is very censorious, isn't it. I only wrote LLEH (backwards) and it got replaced by #### !!!

Share this post


Link to post
Share on other sites

Oh dear, one other thing too. I shouldn't hit the 'Post Message' button to fast!!This is for my own interest but why is it that writing an exclusion line in the scenery file will not work with so much addon scenery? If the object is embedded within a bgl file (but aren't they all??) my impeccably written exclusions (LOL) have no effect at all. What's the reason for this?Thanks again,M.

Share this post


Link to post
Share on other sites

Sorry, Martin, I am the one who was being thick. Too early in the morning for me without my coffee!Anyway, you can definitely just recompile the library while leaving out objects until you find the one on the runway.Or, you can just create an exclusion for it - try ExcBuilder instead of exclusion lines in the scenery.cfg.Don't know why your exclusion won't work I never use this type of exclusion and did not even know that they still worked.But, perhaps the reference point (the center point) of the object is not located near that object. It may even be that there is not just one object, but rather a bunch of buildings together in the mdl file, of which only one shows up on the runway. In which case, you would have to find the reference point of the group of buildings in order to exclude them all, not just the one.Best regards.Luis

Share this post


Link to post
Share on other sites

But how do I recompile from mdl files? I only know the only SCASM method? That is the crux of my problem...I am toatlly mystified as to why many exclusions have to effect - maybe what you say has some bearing; even when I use Exclusion Builder, which I tend to do these days rather than edit the scenery.cfg (what a neat little programme it is!) I still get no joy.I have just spent hours moving the runway to a place where there are no trees and buildings, redoing the taxiways and parking accordingly and so on! Good job it's a labour of love!!If you (or anyone) can help me with the recompiling thing, that'd be great.Thanks again for your time,M.

Share this post


Link to post
Share on other sites

Hello Che,There is no mystery involved in recompiling these files. You will have to get the BGLComp S.D.K. and also install the MSXML that is indicated in the documentation.Then, with the decompiled xml list of objects, simply remove one of the lines referring to an object, save that list as an xml file, make sure all the mdl files are in the same directory as indicated in the xml file, drag the list over bglcomp, and you get a new object library.I always use Arno's CompileHelper, but that is because I think that all his tools are pretty neat - you don't really need it.If you have any problems, don't hesitate to ask, and I shall put together a more detailed and illustrated description.Oh, and when using ExcBuilder, you might want to try excluding "All objects" - this always gets rid of them.Best regards.Luis

Share this post


Link to post
Share on other sites
Guest archtx

I don't know if this helps or not, but if you open a mdl file in notepad you can identify in plain text the bmp textures for the mdl.

Share this post


Link to post
Share on other sites

Yes it helps - I can then edit the files. How to recompile them to a bgl though now? (Getting there!) ..Thank you..Martin

Share this post


Link to post
Share on other sites

Hi guys,(First a little warning, I only scanned through the previous discussion). So if I have missed something, sorry already :)).With MDL Tweaker II tool you should be able to see which textures are used in a MDL object.But your approach of finding the textures and then removing these from the source does not work in the new code. This is because you are only changing the object in the library. What you really want is to removed the placement of that object (that is an a SceneryObject XML command, not the ModelData command). So instead of chaging the library, just leave the library alone and try to find out in which BGL file the object is placed.You only have to remove the SceneryObject/LibraryObject line of the object and it will no longer be placed. Without affecting the ojbect itself, that might be used on a lot of different places.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi guys,(First a little warning, I only scanned through the previous discussion). So if I have missed something, sorry already :)).With MDL Tweaker II tool you should be able to see which textures are used in a MDL object.But your approach of finding the textures and then removing these from the source does not work in the new code. This is because you are only changing the object in the library. What you really want is to removed the placement of that object (that is an a SceneryObject XML command, not the ModelData command). So instead of chaging the library, just leave the library alone and try to find out in which BGL file the object is placed.You only have to remove the SceneryObject/LibraryObject line of the object and it will no longer be placed. Without affecting the ojbect itself, that might be used on a lot of different places.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Hi Arno - thanks for coming in on this. You say "try to find out in which BGL file the object is placed". .. There is just one, large bgl file, which contains all sorts of data. I'm just looking for one building sat in the middle of a runway. In FS8 it might take me w hile to locate the right object in the sca file, but the operation itself is fairly straightforward.If I disassemble my FS9 bgl to an xml file and remove the line of the object (htough I don't know how to identify which line it would be), as you say, what do I do with the modified xml file so that the new data reconstitutes a working bgl file?You know what? I get the impression I am barking up the wrong tree here somehow. As a stopgap measure (=cheat!) I just moved the runway somewhere where there are no trees, using AFCAD2. Still be good to get to the bottom of this though, if possible! I thought that if I can edit FS8 bgls OK, I'd be able to learn how to do FS9 files too - but I don't feel much wiser ebe now!Martin :-)

Share this post


Link to post
Share on other sites

Hi Martin,I think you have search the XML file for lines with the SceneryObject/LibraryObject commands. Try to look at the coordinates in the SceneryObject command and see which ones are from the object on your runway. If you then remove the SceneryObject command (and the LibraryObject command that is nested in it) you should have removed your building. No need to alter the object itself (MDL file).To get a new working BGL file out of the XML file, you need to compile it with BGLComp (you can download it from MS). Just drop your XML file on it should give you a BGL file already.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...