Sign in to follow this  
martinlest2

Editing BGL files

Recommended Posts

I am I suppose a relative beginner here, so maybe I am making some stupid errors. I'd really appreciate some advice.Basic editing of bgls is OK I think - I use BglAnalyze or NewBglAnalyze to decompile the bgl files and SCASM to recompile. I also use an XML editor to edit XML files directly and BGLComp_SDK to remake the bgl. No problems there - usually.But I am lost when I decompile a scenery bgl file to an XML and find I get a tiny XML file as a result plus dozens of small (or one large) .mdl file(s). What do I do then? I am trying to remove some static ships from some scenery, but am now up against a brick wall as I can't, clearly, get into the mdl files. The XML file produced has just one line of data.Any help gladly received.Thanks,Martin

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Jon "scruffyduck" Masterson has a spiffy little FS9 tool called Object Viewer (or maybe Library Object Viewer) which can draw those mdls. The model is actually placed, though, by a sceneryObject element, which might be in a different file than the mdl library.Go here and click on utilities to get:http://www.scruffyduckscenery.co.uk/scott s..

Share this post


Link to post
Share on other sites

Got it. Haven't tried it out yet, but many thanks for the lead. Will post back if I have problems!!Martin

Share this post


Link to post
Share on other sites

The MDL object "only" contains the actual object, so if you want to remove some statics you will not have to do anything to these files.You'll see that in the XML code the MDL object is assigned to a GUID with the ModelData command. This GUID is then used in the SceneryObject/LibraryObject command. So once you know the GUID of the object you want to have gone, you can just remove these placement lines from the XML.

Share this post


Link to post
Share on other sites

I'm at a bit of a loss here Arno! You mean that I should find out which mdl file contains what I want to get rid of, delete it, and recompile the remainder? Not sure I know how to recompile once I've got an xml file and several mdl files? Or do I? Maybe I do - I am getting a bit 'swimmy' now with all the possibilities!!The last bgl I decompiled ended up with a 1kb xml file and one large mdl file. I gave up at that point ...M.

Share this post


Link to post
Share on other sites

Hi,You can recompile the XML with BGLComp, which is part of the SDK. You will indeed have to figure out which MDL contains the objects you want to remove and than you need to remove the lines calling that object (not the MDL itself).

Share this post


Link to post
Share on other sites

Thanks, that is excatly what I would have done. The problem with the file I wanted to edit though is that when I decompile it I get one large mdl file (550kb as far as I recall) only and there is just one line in the xml file. There's nothing to edit as far as I can see.If this is odd I can copy what appears there and post it here?Martin

Share this post


Link to post
Share on other sites

Hello Martin,There are different types of scenery files: - a bgl containing the object models and placement information; - a bgl only containing the object models, also known as an object library; - a bgl that only contains placement information of objects that are contained in another bgl.It seems that you have decompiled an object library. It only has the models inside, and does not show where they are placed.You can do one of two things: - delete the model from the collection, recompile the object library, and since the unwanted model is no longer present in the library, it will no longer display in game; - or, find the placement bgl, decompile it, remove the placement information for that model, recompile it.Probably the second option is the best.Best regards.Luis

Share this post


Link to post
Share on other sites

Thanks both for your replies. I do already have lwmviewer installed, though I haven't used it for a while. I'll have a look and see how I get on.In the end, it's an awful lot of work (=learning!), just to remove one or two static aircraft, but the real point, of course, IS the learning: the removal of the static aircraft is a sort of reward at the end for having learned how to do it (if I ever get that far)!Thanks again,Martin

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