Sign in to follow this  
bob.bernstein

bglcomp code that works

Recommended Posts

Hi all.This code will place a steam effect on top of the roof of the airport building at Lake Lawn, Wisconsin ( C59 ).==============================<?xml version="1.0"?>==============================the effect is AGL plus the 3.0 meters specified in the alt=Note that the syntax in the SDK is wrong, again. The effect must end with '/>', not with ''.Here's some code that will exclude that building. If this BGL and the effect BGL are in the same "scenery" folder, the effect is not excluded... the exclusion pertains to the objects, effects, etc... of lower priority in the Scenery Library.==============================<?xml version="1.0"?>==============================Dick

Share this post


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

Here's a file I call C59allPlacement:==============================<?xml version="1.0"?>================================Note the exclusion is last on the list, and destroys the objects that exist previous to this Scenery Library level.I'm placing a fueling shack, some steam, a refuel area, and excluding the original building.Dick

Share this post


Link to post
Share on other sites

its starting to come together.I was just thinking, I'll bet folks like Derek Leung are coding like crazy right now! :-))Bob

Share this post


Link to post
Share on other sites

Hi all.Generic building code also is a bit different than the SDK:===========================<?xml version="1.0"?>===========================Note again the ending is '/>', not . For a little fun, you can play with the scale.Dick

Share this post


Link to post
Share on other sites

Sorry, I needed to repost with plain text:===========================<?xml version="1.0"?>===========================Dick

Share this post


Link to post
Share on other sites

Hi all.I'm attaching some code that's a bit long for a post as a zip.It uses the alteration of 'bglcomp.xsd' as Bob Bernstein posted that allows BiasXYZ. ( That is attached as well, as a zip file... just save the code, rename your old .XSD file as .OLD, unzip and rename the attachment as 'bglcomp.xsd' ).The BiasXYZ does work, but not quite as I expected. I use a common Lat-Long refpoint, but each object must exist as a separate SceneryObject... with it's own new Lat-Long stated. That seems a bit silly, but it will save some time computing new placement points, as Buildings can be biased apart by meters.Generic Buildings in the new code are ground-huggers. They cannot be placed at a relative altitude like effects, nor can the AGL be set to FALSE ( and an altitude stated ), nor can they be biased upwards ( or downwards ) on the biasY axis.biasX is East-West Axis( biasY would have been Up-Down Axis )biasZ is North-South AxisDick

Share this post


Link to post
Share on other sites

Thanks Dick.Something to read in my learning curve whilst i study XML :0)rgds Jeff

Share this post


Link to post
Share on other sites

Hi Jeff.Actually we don't need to know XML, as the code is only used because somebody at MS seems to be in love with that syntax!We're not writing XML, we are just writing pseudocode that uses the MXL syntax. They could just as easily have used BGLC by adding extensions to that compiler! Or invented an entirely different syntax or naming convention. They might have been better off using LOGO or pascal as a basis... or C++.A SCASM update might come to the rescue and give us some code that makes more sense.Just as always, the scenery engine looks at bits, bytes and words. If they had given us the BGLC extension, we would have been able to do much more with the code... as it stands, they have pretty much just given us a new BGLPlacer that has an XML syntatic interface, rather than a GUI front-end.I guess that's the point of this thread... we need to discover what actually works. The SDK writer obviously doesn't know, and MS doesn't seem to want us to know the inner workings of the scenery engine.Dick

Share this post


Link to post
Share on other sites

I noticed one think.You are saying that for some tags this doesn't work:a]orand this worksb]I took a closer look and found out that this works too:c]What is the difference between a] and c]??? It is simple. a] contains text betweens starting and ending tag and that is the think that is not allowed. Even just spaces, tags and enters are not allowed. So you can use both b] and c], but you can not use a].

Share this post


Link to post
Share on other sites

Hi Marky.What I follow is right from the SDK:Some scenery elements are not allowed to contain other sub-elements. The form of the XML is used to distinguish between these types of elements. Elements allowed to have sub-elements take this form:

Share this post


Link to post
Share on other sites

Hi DickThis appears to be an error in the SDK. From my reading of the schema, Beacon is allowed only as a sub-element of AttachedObject.Also, it appears from the schema that an AttachedObject should actually be at the same level as the LibraryObject it is attached to, and probably immediately following it, not contained within the LibraryObject as a sub-element as the SDK shows.You are certainly right about there being a few errors in the SDK and the examples it contains. It seems that Santa's quality control went to pot in his eagerness to get his goodies out to us wee little scenery designers ... :-)CheersGerrish

Share this post


Link to post
Share on other sites

Dick, quite a lot of the stuff I have figured out already and made BGLC macros for (over the last months). However, there is no real point using BGLC anymore. I can't come up with even one example where it would be an advantage to have access to the binary code rather than using xml and bglcomp. It looks like bglcomp is complete, not like in previous years where BGLC macros (like for generating airspace) where missing. At the moment, I'm suspecting MS was using the same version of bglcomp to generate the default scenery. Quite a step ahead...I'm sticking with BGLC for decompilation for now, mainly because once FS2006 comes out, it may come in handy (for new, undocumented commands). But for generating scenery, I'll make a switch to xml. The BGLC macros are more complicated...As far as xml is concerned, well, seems to be the fashion of most recent times. You just got to go xml nowadays, or your not hip...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi all.an example of Airport code that makes a simple airport ( viewable in Map and in the Go To Airport menu:================================<?xml version="1.0"?>================================It still needs a flatten, so I made one in SCASM:================================Header( 1 42.6322955804054 42.6322955804054 -88.5947021345747 -88.5947021345747 )LatRange( 42.6322955804054 42.6322955804054 ); FLATTEN Area16NElevation ( 299.00 ; elevation in meters42.640758091844 -88.595214002538442.640758091844 -88.593982424679642.6253333999386 -88.593982424679642.6253333999386 -88.5952140025384)End16================================It's name is 'Rhumba Regional' and is found in the heart of Rhumbaflappy, in the state of Mind, city of Delavan. Call Sign is 'RHMB';)Dick

Share this post


Link to post
Share on other sites

Hi Christian.I was hoping you'd found some nuggets in the hex code. :(I think you're right in that we'll need to get used to XML. Gerrish has indicated he'll look into the XML code as well, so we'll get a more balanced viewpoint than just my poking around.Anyone else looking into this needs to cross-reference the bglcomp.xsd file to get the real story on where elements and sub-elements go.In the above Airport example, the SDK might lead you to believe that adding extra start points to an Airport would be found as a 'Runway' sub-element ( like 'RunwayStart' ), when in fact the XSD shows us it is a separate Airport sub-element... an up-level equal to 'Runway'.The XSD will also help clue us into whether an element has sub-elements or not, and that affects how the statement is closed.Dick

Share this post


Link to post
Share on other sites

Hi guysYou'll be pleased to know that part of my work is already complete (i.e. divining the real structure of a BGLComp source file from bglcomp.xsd), but I need to flesh out my Help file with some text before I can release it on the world. In the meantime I can probably help with any queries ...By the way, Dick, I think that your problem with the generic buildings insisting on hugging the ground can be cured with a sub-element of GenericBuilding called BuildingBias that has been omitted from the current version of the SDK doc. The attributes are the same as for BiasXYZ. I haven't tested it yet though - too busy typing away at my Help file!Perhaps you would like to have a try? Use something like

<GenericBuilding ... >   <BuildingBias biasY="###" />   <RectangularBuilding ... /></GenericBuilding>

CheersGerrish

Share this post


Link to post
Share on other sites

Hi Dick, as I posted earlier somewhere, use region="". This is what all the default files do. It doesn't make any difference, but the region entry in the menu is gone in FS2004. No need to set this.What we need is a pinned thread with SDK ammenmends (I guess this thread is a good start)...I had a deeper look into the approaches. They are a tad more complicated. One thing I found is that the altitude descriptor is bull... There are only 4 values that equate to "at", "at and above", "at and below", ... FS2004 must decide which altitude to refer to by different means. I have to do much more research to come up with sensible approach commands though. I couldn't find any simple approaches yet, it looks to to me so far as if an NDB or VOR as a fix is not enough. FS2004 will also need at least one waypoint as an additional fix. I may be wrong though, more research has to be done...Christian

Share this post


Link to post
Share on other sites

Hi Gerrish.bglcomp.exe has a token list near the end of the program. ( do a case-sensitive search for 'Airport' or 'Approach' ).BuildingBias was left out of the tokens, and as a result is not allowed. I suspect there may be other Tokens missing. I don't know if bglcomp could be hacked to allow the missing tokens, but it seems a bit wayward of what we'd want to do.Dick

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