0% found this document useful (0 votes)
171 views

Adding Library Objects To Sbuilder BY Jon Masterson Scruffyduck Scenery

Sbuilder can be used to add FS9 objects (those made by Gmax and FSDS3) to your scenery. You can also add RWY12 objects which are in the same format. This tutorial focuses on objects which are not packaged as rwy12 libraries.

Uploaded by

Interim Interim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views

Adding Library Objects To Sbuilder BY Jon Masterson Scruffyduck Scenery

Sbuilder can be used to add FS9 objects (those made by Gmax and FSDS3) to your scenery. You can also add RWY12 objects which are in the same format. This tutorial focuses on objects which are not packaged as rwy12 libraries.

Uploaded by

Interim Interim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

ADDING LIBRARY OBJECTS TO SBUILDER

BY
JON MASTERSON
SCRUFFYDUCK SCENERY
www.scruffyduck.plus.com
Version 1.0

INTRODUCTION
Sbuilder can be used to add FS9 objects (those made by Gmax and now FSDS3) to your
scenery. You can also add RWY12 objects which are in the same format if you have
RWY12 installed on your system and have correctly added the folder location to your
Sbuilder preferences.



If you have RWY12 libraries that you wish to use in Sbuilder then I recommend that you
download RWY12 (it is free and available from AVSIM and other FS Sites) and use the
library objects from there. It is possible to use these libraries without installing RWY12
but you may find it easier to use them as shown above. In this tutorial I will
concentrate on objects which are not packaged as RWY12 libraries.

CREDITS
I would like to start by thanking Luis Sa for providing us with Sbuilder. Scott Gridley of
Freeflow Scenery for explaining how to do this; and Arno Gerretsen of
SceneryDesign.org for his work on products such as Library Creator XML and for
explaining the relationship between the MDL models and the xml code which places
them in the scenery or in a library

OBJECTS, OBJECTS EVERYWHERE
Lets start with what sort of objects we are talking about. Prior to FS9 the usual type of
scenery object available for scenery designers was the API macro. This is a text file
which when compiled into a bgl file can be seen in your scenery. They can be put into


libraries, but generally they are compiled into the scenery file itself. If you have the
same tree 20 times in your scenery then chances are it is compiled as 20 separate
objects.

With FS9 MDL models became the preferred way to create scenery objects. These are
quite different from API models. The format of a FS9 scenery file (bgl) is different from
that of scenery files from earlier versions. They have the same extension but have
different formats.

MDL objects are created using Gmax and FSDS3. A program called MakeMDL (part of a
Microsoft SDK) is needed to compile them. MDL Files are usually gathered together in
libraries. A library is a bgl file which contains a bunch of MDL objects. Each object is
identified by a GUID - Globally Unique Identifier. It is a long hexadecimal number and
FS uses it to identify where the object is stored. Scenery design and object placer
programs use the GUID to identify the object and where to place it in the scenery. The
placement code is in XML and is compiled using bglcomp.exe . The advantage of this
method is that only one copy of the object actually exists and multiple references are
made to it.

MDL Objects use textures in the same way that API macros do so you need to make
sure that you have the library and textures available in your scenery. A possible
disadvantage of libraries is that you would normally have to make all the textures
available even if you only use one of the objects in the library. Unless you know which
textures the object needs of course!.




Libraries are often stored together in one scenery
folder inside your Addon Scenery Folder. RWY12
uses a folder called the Static Objects Library. Any
scenery which uses a RWY12 object (and textures)
gets it from there.





Because the format of bgl files containing MDL objects is different from that of previous
versions Sbuilder will create a bgl file for each type of object.

._OB0.bgl contains API objects
._OB1.bgl contains MDL objects - well to be accurate a reference to them using
the GUID

If you attempt to decompile the first type using a program like bglxml or
newBGLAnalyze you will get an error since they can be need scdis or similar. The
opposite is true as well - you cannot decompile the second type using scdis.



HOW SBUILDER IDENTIFIES LIBRARY OBJECTS
To get these objects to show up in Sbuilder you need to tell the program about them.
Default FS Library objects are already done for you. Sbuilder uses text files which are
stored in the tools folder.



Near the bottom right is a file called objects and above that are a series of text files
called obj_name. The objects file contains references to the other files. The
obj_name files actually contain the information which Sbuilder needs to make the
object available to add into your scenery.

The main object listing file
Navigate to the tools directory and select the file objects.txt. Open it in Notepad. Be
careful not to change anything at this stage though!

This is How mine looks:





As you can see it is mostly a list of lines containing

include=obj_name.txt

And each of the files referred to needs to be in the tools folder as well.

At the bottom is something different

;[My Custom Objects]
;54690001267300F0022E0DB1C0F65F5C 0 1507.969 45.20223 1 Ponte_Vasco_Gama

It is commented out using the ; but it contains a description of an object and also
shows the format which Sbuilder needs to make the object available to you. We will
come back to format in a minute but first we need to look at the individual files. You
can close Notepad for the time being

Object Files
Navigate to obj_autogen.txt and open it in Notepad:







This is how the autogen objects
look in the object dialog. The
first line of the text file defines
the object category so it is
important to include in the file.
It is just the category name
inside square brackets.

All the other information in this
dialog is drawn from the text file
(except for the thumbnail which
we will cover later)

So how does it get there?








The first line in the file after the category name describes the ag_barn that we are
looking at here:

6dc7e21e4f0c4d7395488dac102499a1 1 38 14 1 ag_barn

It consists of six parts separated by single spaces:

6dc7e21e4f0c4d7395488dac102499a1 This is the GUID which identifies the object
1 0 = FS2k2 library object; 1 = FS9 library object
38 Footprint width
14 Footprint length
1 Default scale
ag_barn Description shown in the dialog

There is one line for each object in the library. In fact the objects do not need to be in
the same physical library at all since what we are doing is referencing them and
provided that the GUID is valid and exists in a library on the users computer then it will
show up! This does mean that you can categorise objects by moving them from file to
file. This is a bit hit and miss and I will not be covering that here. At the time of
writing this (December 30, 2005) I am developing a program to manage library objects
called Library Object Manager. Progress updates are on my website This should be
available at the beginning of February 2006 and will automate the task of re-
categorizing library objects for Sbuilder and creating the text files automatically. For
now, we will look at dealing with adding whole libraries by hand.

Adding EZ-Scenery Libraries
There are a lot of new libraries being created for EZ-Scenery from Abacus. They are
easy to add and we will use one of them as an example of how it is done. Be aware
though that many of them are repackaged existing RWY12 libraries. The author will
usually mention this in the documentation. If you do not have RWY12 then you may
want to add these anyway. Also there are a number of re-packaged MS default objects
being published for EZ-Scenery to make it easier for users of that program to find the
object they want.

I am going to add the library called Small Airport Objects 2. The objects were created
by Frank Salter and repackaged with permission by Steve Ziegler. The file is called
small_airport_objects_2.zip and should be available from the usual sources.

Obtain this or a similar file. If you unzip it in a temporary folder then you will something
like see this. If you are using explorer then your list will look different but the files
should be the same:











In some cases the zip will contain sub
folders for the scenery bgl and the
textures. As in this case:
The important things to look for are the
.bgl file and the text file with the same
name as the bgl. In this case we want
small airport object 2.txt and small
airport objects 2.bgl.




Open the txt file in Notepad




This file is created by the EZ-Scenery Library Manager (developed by Arno Gerretsen) At
the top is some information about how it was created and the format of GUIDs. Now
we do not want to change this file but we do want to use it as the basis for our Sbuilder
object file. So first use Save As to create a file called
obj_small_airport_objects.txt and save it in your Sbuilder Tools folder - at least
then we can find it later and it is already in its intended place.






Now go delete all the information at the top down to but not including the first line
containing a GUID







In case we forget lets give it a category add
this as the first line:

[Small Airport Objects]




Remember the opening and closing square brackets. If the category does not show up
in Sbuilder then this is the first likely culprit - a bracket is missing. Now we need to
edit each object line - yep it is laborious which is why I am developing a program to do
it.

We only want to keep the first and last item in each line. The GUID and the
description. You might notice that there appear to be two GUIDs in this file. The
second one probably refers to an original GUID which has been changed when the
library was created. There does not seem to be total consistency in the way these files
look - the most important item is the GUID at far left - we must have that at least

After I remove the bits I do not want I am left with:





Now I need to add the
information about library
type. Footprint and
default scale. To save a
bit of time I add it to the
first line




Note the single space between each. So far I have told Sbuilder that the Yellow Cone is
an FS9 object with a 5m x 5m footprint and a scale of 1.

Now I copy and paste it to each of the other items in the list




Now each item is the same. We dont know the actual footprint size. There are ways to
get it from the MDL file itself. MDL Tweaker from Arno will do this, and my Library
Object Manager will extract the exact footprint. In the meantime I am going to have an
educated guess and change the numbers.

NOTE you can change these in Sbuilder when you are using the objects and we will
discuss that later.



It is worth noting that width and length are in the eye of the beholder (or more
precisely in the eye of the designer and user) One persons length is another persons
width!. Anyway I have made a stab at size. Now Save the text file and close Notepad

Adding the new library to Sbuilder
We have one more job to do. Open the objects.txt file in Notepad and add the line

Include=obj_small_airport_objects.txt










Make sure it is exactly the same as the
text file name you saved. Another
reason why the library will not show in
Sbuilder is if the file name is not
entered correctly

I added it at the bottom of the custom
objects list as shown.

Now save objects.txt and close
Notepad.

If you have Sbuilder open then close it
and re-open it, otherwise run it now.
Load a project. I suggest the Fort
Pierce project which we used in the
other tutorials.


Select object mode and click on the scenery

If you have done everything as described then you should find your new objects at the
bottom of the library object categories:





There they are - if you run through them the you will see the scale and footprint
information should reflect the numbers that you entered in the text file. Notice we have
no thumbnails so we will need to put that right in a minute. But before we do that..

Changing Footprint and Scale Data



I decided that I did not like the numbers I set
on the storage shed. So I changed them







Notice that the Update button is now active.
Change this and click Update. Then OK

You should now be returned to the Sbuilder
design screen and have placed this object








Here it is in Fort Pierce facing North. Before we go see what it looks like there are
several things to do.

Take a look at the
obj_small_airport_objects.txt file. You
should see that Sbuilder has updated the footprint
for the Storage Shed.



Now we want to see what it looks like. So we need to add the bgl and textures to our
scenery. I am doing this the easy way for demonstration purposes. Sbuilder has not
changed anything related to the actual library file so if you already have it, and its
textures in your FS you will not need to do anything.

One problem we scenery designers face with libraries is knowing if the user has them or
not. For more experienced users it is easy enough to tell them which libraries are used
and let them sort out getting them and installing them for use. For less experienced
users this might be enough to stop them installing the scenery. In the long term it
would be nice to get an agreement on a common location for library files.

Until then add the library bgl to the scenery sub folder of your Fort Pierce scenery
and put all the textures in the texture sub folder. The textures are all the bmp files.
This way we can be sure that the object will show up for us.




Compile your scenery with the
storage shed in it. Make sure that
you have copy bgl files ticked.
Then run FS and go to Fort Pierce.
If you use the saved flight we
used before and you placed the
shed where I did then turn a bit to
the left



And there it is.






Adding Thumbnails
Sbuilder will display a thumbnail of the object if the image file
is a bmp or jpg file
named as the GUID
stored in the Sbuilder\Tools\Bmps Folder

If you have already downloaded an installed the thumbnails for FS library objects then
you can see them in the Bmps Folder.



If the author of the library has provided thumbnails then you may need to use an image
manager program to change the file. I use Irfanview which is free and can be obtained
from http://www.irfanview.com. Do the following things - if needed
Resize it to 256 x 256 pixels or thereabouts.
Save it a bmp or jpg using Save As into the Sbuilder Bmps folder
Rename it to the GUID. The easiest way to do this is to open
obj_small_airport_objects.txt and use copy and paste to put the GUID in as the
name

If the author has not provided a thumbnail then you need to complete the following
extra steps:
Install the object in FS. I have a test site which is free from buildings trees and so
on. This makes it easy for me to line up and photograph a whole bunch of objects
Run FS
Use a screen capture program that allows the selection of part of the screen. I use
Screen Hunter from http://www.wisdom-soft.com. There is a free version which is
very good for capturing thumbnail shots. All the images in my tutorials are taken
with Screen Hunter.
Capture a near as possible square section of the screen which includes the object
Save the image and then proceed as above.

I will use the image I captured above and add it to Sbuilder.






I loaded the screen cap into Irfanview and then selected <image>
<Resize/Resample>. The above dialog appears and I changed the size of the image
to about 256 x 256. If you have not managed to capture a square then you might make
the largest dimension 256.




Now I selected <Save As>
from the <File> Menu. I am
saving directly into the
Sbuilder\tools\Bmps Folder


I changed the name of the file
to the GUID. The easiest way
to do this is to open the text
file we created and copy the
relevant number from there






If you have followed this on your system then load up Sbuilder, go into object mode and
find the Storage shed in the library object list. You should now see that it has a
thumbnail as shown below.







OTHER OBJECT LIBRARIES
I have demonstrated how to add objects from an EZ-Scenery Library. You can do this
with any library provided that you know what objects are included and what the GUID
of each is. If the author provides a text file containing this information then you can
modify that to create the object file for Sbuilder. If not then it is more complicated.
Programs such as bgl xml can decompile a list of GUIDs but you will not have much to
go on. MDLTweaker from www.SceneryDesign.org (developed by Arno Gerretsen) can
give you all the information about an MDL file. Library Creator XML, also by Arno will
create new libraries from a bunch of MDL files. It can create an Sbuilder objects file
with accurate footprint data as well. You will need to add a Category though as this is
not provided. Alternatively you can add the output at the end of an existing obj_ file.
My Library Object Manager, when released will do all this for you and create the objects
file.

If you want to add RWY12 libraries then you will need to read the xml file which comes
with each library and use the information in there to create the objects file.

CONCLUSIONS
This tutorial has introduced you to the way in which Sbuilder stores information for FS9
library objects and shows how you can add libraries produced for EZ-Scenery to
Sbuilder. I have also covered adding thumbnails and a bit about adding other library
types

Please feel free to let me know what you think. Point out errors or better ways to do
things (I am a learner at this too!). You can do this via the support forum on my
website - www.scruffyduck.plus.com

LEGAL BITS
Please respect the copyrights of Luis Sa for Sbuilder. Also be aware that libraries and
the objects within them are copyright the designer. This tutorial is copyright Jon
Masterson 2005. You may distribute this but only as a complete document. You may
not extract portions of it and use them in any other document without my written
permission. Nothing in this tutorial should damage either your FlightSim program, your
computer, or you, However I take no responsibility for any side effects, or other
damage which you feel may result from using this tutorial.

You might also like