How to build custom load outs for CFS2

Original information by Martin Wright
Document composed by Daisuke Iga

Introduction

CFS2 has a cool feature that enables to add working external load outs to planes. MS prepared some kinds of bombs and drop tanks for default planes come with CFS2. But once you fly add-ons, you will notice that there are very limited kinds and soon you will become to think there should be more. External load outs are implemented with Library Object BGL, which was first introduced with FS98 for scenery design. If you have ever build a plane, or a MDL file, it is easy to convert it to a library object. So, this tutorial is written mainly for people who have experience of building aircraft. Since there is not any cute utility that automatically convert MDL files to BGL files, there will be some step-by-step editing, though. I will tell you the method I used to build Japanese 800kg bomb load.

Step0: Things you have to prepare

You need following software to build custom load outs. Aircraft Factory99 or FSDS to build MDL files. Compatibility of AD2000 is not confirmed. MdlDisAs written by Trevor de Stigter to de-compile a MDL file to a SCASM source code. Any text editor to alter the source code. SCASM.exe to re-compile the source code to a BGL file. MDLpatchw to patch the aircraft which you whish to add external load outs.

Step1: Build an object

The first step is building a 3D model of external load out you whish. Build it with AF99 or FSDS and compile a MDL file just as usual. Don't forget to properly apply textures to the object if necessary. I used FSDS this time. I confirmed an object built with AF99 also worked fine as an external load out. Here is a sample picture of 800kg bomb we will build.

Setp2: De-compile a MDL to a SCASM source code

After building a MDL file, de-compile it to a SCASM source code with MdlDisAs. I don't go to the detail of how to use MdlDisAs. Please refer to the document comes with it. MdlDisAs generates a source code like below.

Step3: Edit the source code

The source codes that MdlDisAs generates are not compatible with Library Object, the one you need for custom load outs. You need some manual editing of the source code. First, delete all the statements down to the one which says ";*** Start of Main Aircraft Code ***". Then insert statements below at the top of the source code.

Header( 1 90 -89 180 -179 )
LibID(
xxxxxx xxxxxxx xxxxxxxx xxxxxxxx )
LibObj( SCALE 0.002 NAME
_object_name )

Header is a header. You don't need to know any further detail for it. LibID statement determines the ID number of an object. 4 sets of 32bits hex number, described with xxxxxxxx above, are the identifier of the object that you are building. These numbers must be unique to all the other library objects that will appear in the game.

LibObj determines the scale factor and the name of the object. 0.002 is the magic number that makes it appear with correct size in the game. If you encounter size problem, add or take some. Then you will identify the specific _object_name of the object after the NAME option. This is the name of the load out which appears in the message field when you cycle through ordinances.

Next, search a pair of statements of "IfVarAnd( :Lxxxxxx 7E 0001 )" and "Jump (: Lxxxxxx)". Where Lxxxxxx is a label to a statement. You don't need to know about the label number now, so let's proceed. Comment out both statements with semi-colon. If you forget this, the load out will flash in and out during the game play. There will be several sets of these statements in the source code, so be sure you'll comment out all of them.

Finally, go to the very end of the source code. You will see "EndA" statement, which is the terminator of the source code. Change it to "EndObj". Then save the source code.

Step4: Compile Library Object BGL

Open a DOS prompt and run SCASM to compile a BGL file.

scasm <input file name> <output file name>

That's all. Congratulations! You have a BGL that contains YOUR OWN BUILT load out inside. If you encounter an error message, most probably you edited the source code wrongly. Check if there is anything incorrect.

Step5: Prepare a dp file for the load out

After compiling a custom load out, you need to prepare a dp file to make it work in the game. I don't go to the detail but most of the syntax is similar to that of CFS1. You can find good tutorials elsewhere. The best way is copy and alter a default dp file. For our 800kg bomb, I used the dp of US's 2000lb bomb. After you finished a dp file, save it with a file name of "_object_name" you have entered when you determined the name of the object in the LibObj statement in Step3. You'll use this name again when you edit the dp file of your aircraft to add the 800kg bomb.

Step6: Copy the files to CFS2 system folder

Copy the corresponding files to the CFS2's system folders.

****.bgl: ....\SCENARYDB\weapons\scenary
Textures: ....\SCENARYDB\weapons\texture
****.dp : ....\OBJECTS_DP

Step7: Patch an aircraft and update the corresponding dp file

OK, this is the final step. Patch the aircraft you want to add your load out with MdlPatchw.exe. And then, edit the dp file of your aircraft appropriately. Well done! Now you have your aircraft equipped with your custom load outs. Here is a sample picture of 800kg bomb we've build hanged on the pylon. And it actually drops and explodes.

It hangs on the pylon...

... and it drops.

ACKNOWLIDGEMENT

The editor would like to thank Martin Wright to give me instructions for how to build custom load outs and an opportunity to compose this tutorial.

Back to HOME