Terms of use • Privacy statement  

Home Page > All Articles > Flight Simulator Development > Making a Hard Surface and Using Attachpoints


 All Recent Articles
 Hovercontrol News
 Flight Simulator Enjoyment
 Flight Simulator Setup
 Hovercontrol Training
 Flightsim Development
 Multiplayer Setup
 Multiplayer Events

Making a Hard Surface and Using Attachpoints

Bookmark and Share
• Print Article        

One of the great new features of FSDS v3.5.1 is the ability to create hard and landable surfaces as well as using attach points to add lights. Today I’m going to create a building and add a helipad to the top of it. Then I’m going to add some lights around the helipad.

I’ll start in FSDS by clicking the box icon on the primitive parts toolbar on the left side of the FSDS screen. I’ll set the box to be 70 wide and 70 deep and 250 high. Since my FSDS Preferences are set to feet, this will make it 250′ high, 70′ high and 70′ wide.

I will also click the Origin At Bottom check box to place the box on the origin or horizon. This way it will sit on the ground in FS. if you forget this step, all you have to do is move it up.

Here is my box in FSDS after zooming out and centering the views.

Since the idea here is that this will be a helipad on top of a building, I’ll add a helipad texture to the top of it. It turns out that FSX has a helipad texture in the main Texture folder that we can borrow. So in Part mode, I’ll press F4 to open the Part Texture Assignments dialog. Here I’ll click the Select button for the Top.

This will open the Texture List dialog, which is blank. I’ll click the Add button. Now I’ll click the Browse button and select the helipad texture from the FSX’s main texture folder. The file name I’ll use is helo3.bmp

I will ignore the File Format Warning since this texture comes from FSX. It must be a compressed texture.

Next I’ll click OK on the Texture Definition box. Now I will click helo3.bmp from the list and click OK.

This will open the Texture Properties window where I will select the area of the texture to be applied to the Top of the box. I’ll use the H in the bottom left corner. I’ll be careful not to select any of the black area around.

After clicking OK on the Texture Properties and OK again on the Part Texture Assignments, I can see the H is now on top of the box in FSDS.

The next step is to create a 4-sided polygon, perpendicular to the Y axis and position it on top of the box. This polygon will be the hard surface. I’ll click the triangle icon on the Primitive Parts toolbar on the left and enter 4 for the number of sides and 50 for the Radius and click OK.

This will put a polygon facing up, but lying on the ground and rotated about 45ยบ. So I will use rotate mode and rotate it to line up with the existing box. I will also use the Part | Reset Axis Rotation menu to re-align the parts axis.

The last step here is to move the polygon up so it sits at the top of the box. I will zoom in here and set this new polygon just under the polygon on top of the box. This new polygon will be the hard surface.

Here I’ve zoomed in and moved the polygon up in the Y axis. I used Move Mode and constrained the X and Z axis so it will only move in the Y axis. I have positioned it just under the top polygon.

Now we are all set to make this polygon a hard surface. A hard surface in FSDS works like an animation in that you have to assign a specific part name. All of the animation names in the Part Properties (found by clicking the Browse button) are pulled from a control file. For FSX, this control file is called the ModelDef.XML file. You may recall having to locate this file when setting up the FSDS Preferences when you first ran FSDS. The ModelDef.xml file contains all of these special names. After these special names are a series of parameters. These parameters tell the compiler (XtoMDL) how to handle the part. So when you use the part “door_0″ and you compile an aircraft, XtoMDL looks at the ModelDef.xml file and says ‘oh, this part is a door and it has animation on it and this animation is shown when the open door command is used’ in FSX (CRTL + E in this case). Every part name in your project is checked against the ModelDef.xml file to see if it has a special condition. Most will not obviously.

So what does this have to do with my hard surface? Not much - but it helps to understand what we’re about to do. The hitch with the hard surface is that the specific parts name for a hard surface and attach points are not in the list of names in the Part Properties - in other words, they are not in the ModelDef.xml file. So how do we get the hard surface? This is where FSDS v3.5.1 comes in. Included with FSDS v3.5.1 is a file called PartDataDefs.txt (short for Part Data Definitions). This file contains information similar to that found in the ModelDef.xml. It includes the special handling information required to do attach points and hard surfaces. The nice part about this is, it is a text file and is easily edited.

The PartDataDefs.txt file does more than hard surfaces and attach points. It also supports multiple part name animation. In the ModelDef.xml file, you have “l_tire_still” and “l_tire_blurred”. What if you have 2 left tires and you want to animate them both? FSDS automatically renames the parts when you compile. So how can both tires be animated? The answer is the PartDataDefs.txt. This file provides support for these conditions as well as allowing you to have multiple tires with the same part name and have them all be animated.

I invite you to open the PartDataDefs.txt file to take a peek at it. We’ll need to edit this file to add some more light later on in this tutorial. You can browse into the FSDS_v3.5 folder and double-click the file to open it with WordPad or Notepad, or you can use the Start | Find or Start | Search options to search for the file.

If you cannot find the file, make sure you are running FSDS v3.5.1. Open the Help | About FS Design Studio menu to verify your version. If you have 3.5 (not 3.5.1), then you will need to get the latest version from www.abacuspub.com. There is no charge for the update to 3.5.1.

The file can look very confusing when you open it. The problem is that each line in the text file is a separate operation and these operations can be long forcing them to run off of the screen and wrap onto the next line. This makes it difficult to read. You can maximize the file to fill your monitor to make it easier though.

At the top of the file we see “c_tire_still”. This is a part name that FSDS will recognize from your model. FSDS will apply the correct visibility parameters to the c_tire_still part if multiple copies of that part exist in the model. Looking down later in the file, you will notice “platform_CONCRETE_0″. This is what we are looking for. This line contains information that FSDS will use to apply a hard surface. A part with the name “platform_CONCRETE_0″ will be a hard surface.

From here I will select that part name by clicking and dragging my mouse of the letters and then I’ll copy that text (CTRL + C). You can simply write it down if you want - just be sure you get the exact spelling and capitalization correct.

Back into FSDS, with my new polygon as the current part, I’ll open the Part Properties and paste the part name I copied from the PartDataDefs.txt file. If you wrote it down, you can simply type in the part name and click OK.

Now I’ll compile this as a scenery object into the Addon Scenery\Scenery folder under FSX and open FSX. In FSX, I’ll switch to a helicopter and go to KSEA’s default runway. This will put me right next to the new building where I can fly up and land on it.

Make sure that FSX builds a new database for the scenery when you open FSX. If it did not, then either you saved the scenery file in the wrong folder, or the Addon Scenery folder is not active in the Scenery Library. To activate it, open the FSX and enter the Setting option on the opening screen. Click the Scenery Library button. Click Add, then double-click the Addon Scenery folder and click OK to return to FSX.

I can see the box made it.

I’ll fly up and see if the texture is there… Yup - so far so good!

Let’s see if I can land this baby… BooYaaa… 3 for 3…

Notice the skids are buried just a bit. This is because we tucked the hard surface polygon under the top of the building. You can try to adjust it to get it closer if you want. I’ll try doing that and adjusting the hard surface polygon to see what happens.

Much better… If you want to download this project from this point, you can get it here.

This looks good, but at night it will be pretty hard to see. Let’s add some red obstruction lights in each corner of the building. I’ll start by creating a small tube and shaping it to light shape. I created a tube as follows:

I shaped the top cross section a bit smaller and moved the center cross section up to give it shape. I then assigned a red material for the light in the Part Properties.

Now I’ll move the new light into position. I’ll place it in one of the corners.

Now I’ll copy and paste this into each of the 4 corners.

Next I’ll create a very small polygon and place it inside one of the lights. It does not ‘have’ to be placed inside the light, but this helps us position it.

Now I need to set the name of the light. I’ll again check in the PartDataDefs.txt file for the exact part name. I’ll use attachpt_obslight_1 as the part name of the polygon. Once I have this set, I’ll compile and replace the old building BGL file and switch to night and see how it looks.

I edited the image to increase the brightness and contrast to see everything better

You can see the new light in the bottom right corner of the image above. The light appears to be hanging off the side a bit. This must be way the effect was created - it must have been offset. I’ll adjust the position on the model to move it to sit just inside the light housing we made.

Ok, that takes care of one. Now I can copy and paste this and position it around the other lights right? WRONG… Remember the PartDataDefs.txt file is looking for specific part names. Currently the file is only set up to recognize attachpt_obslight_1. So what I’ll have to do is open that file and copy the line of code for the attachpt_obslight_1 and paste it 3 more times and make some changes to it. I need to change the names to attachpt_obslight_2, attachpt_obslight_3 and attachpt_obslight_4. I will have to change that part name 2 times for each line. The rest can stay exactly the same. In the file I click in front of the attachpt_obslight_1 and select all the text through and including the </FSMakeMdlData>.

Once selected, I will copy that information (Edit | Copy). Next I will click after the </FSMakeMdlData> and press enter to get to a new line and paste the information. This will give us 2 copies of the same information:

Here is the complete text I copied and pasted:

attachpt_obslight_1 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_1″> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>

To adapt this to work for a second light, all I have to do is change the name in 2 places:

attachpt_obslight_2 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_2“> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>

This is now set up for 2 lights. I can set the name of another one of my polygons to attachpt_obslight_2. I will repeat this process to get a total of 4 lights. This will leave me with this text at the end of the file:

attachpt_obslight_1 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_1″> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>
attachpt_obslight_2 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_2″> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>
attachpt_obslight_3 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_3″> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>
attachpt_obslight_4 <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”attachpt_obslight_4″> <AttachedObject> <Effect effectName=”fx_lightObsRedSteady” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>

Don’t forget to save your changes! Here is a modified version of the PartDataDefs.txt file for you to download if you wish. It includes the information included in the FSDS v3.5.1 release version, but has a few extra goodies in here that are not. Download PartDataDefs.txt here. (NOTE: You might want to back up your existing file first just to be safe. Then you can right-click the file and choose Save As, Save Target or similar and then browse to your FSDS_v3.5 folder and save the file. Also be sure it gets saved as a text file (TXT) and not an XML file!)

OK, back to my project, I’ll copy my attach point light (attachpt_obslight_1) and paste it and move it into another corner, then change the name to attachpt_obslight_2. I’ll continue this for all of the remaining lights.

Now I’ll compile and check it out in FSX and see if it works!

I love it when it works… Note that I again adjusted the brightness and contrast to better see the image. If you want, you can move the lights up a bit to sit on top of the light tubes and further adjust the light position to sit right on top of the light tubes. If you want to download this project from this point, you can get it here.

Today we’ve learned how to do a simple hard surface by assigning a specific part name to a part with that part name pulled from the PartDataDefs.txt file. We also learned how to attach a light to an object and how to edit the PartDataDefs.txt file to duplicate multiple light entries.

Here is a list of the new and special part names that are included in the PartDataDefs.txt file that ships with FSDS v3.5.1. I’ve left out the ones that correct the display of multiple animated parts since you don’t need to do anything special with them. I’ve included only the effect attachments and hard surface information:

  • airspeed_effects_windshield……………………This allows you to apply special effects to the windshield of your aircraft
  • airspeed_noeffects_windshield………………..This allows you to apply special effects to the windshield of your aircraft
  • attachpt_Steam_Med_1…………………………..This allows you to add a medium steam effect
  • attachpt_Steam_Med_2…………………………..This allows you to add a second medium steam effect
  • attachpt_Steam_Med_4…………………………..This allows you to add a third medium steam effect (not sure why -3 is not included?)
  • platform_CONCRETE_0…………………………..This allows you to add a single hard surface to an object
  • attachpt_landing_1………………………………..This allows you to add a single landing light
  • attachpt_obslight_1……………………………….This allows you to a single solid red light

If you have downloaded the PartDataDefs.txt file above, then you have these additional entries:

  • attachpt_taxi_1……………………………………..This allows you to add a single taxi light
  • attachpt_landing_2………………………………..This allows you to add a flashing white light
  • attachpt_beacon_1…………………………………This allows you to add a second beacon light
  • attachpt_obslight_2……………………………….This allow you to add a second solid red light
  • attachpt_obslight_3……………………………….This allow you to add a third solid red light
  • attachpt_obslight_4……………………………….This allow you to add a fourth solid red light
  • attachpt_obslight_5……………………………….This allows you to add a single flashing red light
  • attachpt_obslight_6……………………………….This allows you to add a second flashing red light
  • attachpt_obslight_7……………………………….This allows you to add a third flashing red light
  • attachpt_obslight_8……………………………….This allows you to add a fourth flashing red light

If you want to experiment a bit with the PartDatDefs.txt file, I recommend you first back up your file. You can add a new light by following this basic guideline. The bold text is a variable that you can change:

<part_name> <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <FSMakeMdlData version=”9.0″> <Attachpoint name=”part_name“> <AttachedObject> <Effect effectName=”effect_file_name” effectParams=”"/> </AttachedObject> </Attachpoint> <Visibility name=”general_light”> </Visibility> </FSMakeMdlData>

  • part_name……………..This is a part name that you will used in FSDS. There should be no spaces, dashes (-) or dots (.) in the part name
  • effect_file_name……This is the name of an effect file from the FS’s \Effects folder. Do not include the “.fx”
  • You can leave the “Visibility name” blank for effects like steam

Special Thanks to Felix Rodriguez for his help and the extra information in the new PartDataDefs.txt file. Thanks also to everyone who has asked this question recently including Mark Self!

Posted with permission from Adam Howe and Abacus Publishing.

For more information visit Adam Howe's Flight Simulator Design Studio Blog!