How to make your own CFS2 payloads
By Simon Porter
This is a little tutorial I wrote to explain how to make bombs, rocks, drop tanks, etc. for Microsoft Combat Flight Simulator. Special thanks to Martin Wright; he told me how to do it in the first place.
Daisuke Iga has also done a similar tutorial to this (I only saw after I had started ;) which compiles a bomb as an aircraft and then decompiles it. The procedure described here is better for making weapons to go along with a plane you are making, while his is geared more towards a multiple-use weapon.
CFS2 weapons (stored in <cfs2 directory>\SCENEDB\weapons\scenery) are just standard scenery objects, like everything else in the SCENEDB directory. In fact, it's possible to use houses and barns as weapons, except for the fact that you can't take off from the weight! Aircraft can be used as weapons also, but that just clutters up your AIRCRAFT folder. The procedure described assumes the use of FS Design Studio (FSDS), but can be done with another aircraft design program by creating an aircraft and converting it to an api.
1. Make the payload in FSDS
2. Create the api
3. Convert it to a sca file
4. Compile
5. Create its dp file
6. Try it out
Just make it FSDS.
If you are making it for a specific FSDS aircraft, make it with the aircraft and then
spilt it off. Otherwise, just use any aircraft as a size guide.
Now click on File|Create FS Object File|Scasm Macro
file (.api/.scm) and save it as an api.
1. Make the payload in FSDS
3. Convert it to a sca file
Open the api up in notepad (or wordpad) and delete everything from the top till where it says "; CRASH Detection" and replace it with:
Header( 1 90 -89 180 -179 )
LibID( xxxxxx xxxxxx xxxxxxx xxxxxxx ) ;any 4 32bit Hex numbers
LibObj(
SCALE 0.1 ;or whatever scale the object requires
NAME green_rocket ;or whatever you want to name it
)
< ... real
drawing code ... >
If you want to put more than one than one object in
the bgl (less redundant and smaller than 2 or 3 bgl's) do the same operation to
the second object's api except for the "Header" line and using
a different set of hex numbers and copy it to the bottom of the first api, like
this:
< ... real
drawing code of object 1 ... > < ... real
drawing code of object 2 ... >
EndObj ;replace EndA with this
Header( 1 90 -89 180 -179 )
LibID( xxxxxx xxxxxx xxxxxxx xxxxxxx ) ;any 4 32bit Hex numbers
LibObj(
SCALE 0.1 ;or whatever scale the object requires
NAME green_rocket ;or whatever you want to name it
)
EndObj ;end first object
LibID( xxxxxx xxxxxx xxxxxxx xxxxxxx ) ;4
more 32bit Hex numbers
;(just 1 number has to be
different)
LibObj(
SCALE 0.1 ;or whatever scale the object requires
NAME blue_rocket ;or whatever you want to name it
)
EndObj ;end second object
After doing all that, save it as a sca file (e.g. rocket.sca).
Compile the sca using scasm by typing:
<scasm directory>\scasm <wherever you put the
sca>\rocket.sca <cfs2 directory>\SCENEDB\weapons\scenery\rocket.bgl
into the Start|Run dialog box
Go to <cfs2 directory>\OBJECTS_DP and copy and paste the of a similar object (e.g. bomb, rocket, drop tank, palm tree...) and rename it in accordance with your object(s) (e.g. green_rocket.dp, blue_rocket.dp).
Now is also a good time to go and change the name of a similar payload in any aircraft to that of your object(s) to test them. For example,
[PAYLOAD.2]
mount.3=wep_pylon_ja_wing, 1, -1
mount.2=wep_ja_60kg_gp, 1, 4
mount.5=wep_pylon_ja_wing, 1, -1
mount.4=wep_ja_60kg_gp, 1, -1
becomes
[PAYLOAD.2]
mount.3=wep_pylon_ja_wing, 1, -1
mount.2=green_rocket, 1, 4
mount.5=wep_pylon_ja_wing, 1, -1
mount.4=green_rocket, 1, -1
Dp editing is a subject beyond this tutorial, but suffice
to say, you can learn alot form just reading dp files.
Run the test plane to see if your weapons
work, and then edit the dp your aircraft. If you're using FSDS you
will need to convert your mdl using MDLPatchW after compilation to get the
weapons to work. Also, I belive that the position in FSDS corresponds to
the positions in the dp file, so you can have accrate mount points. You
might also want to add a line in mdlnames.txt to get a better description in
Change/Modify dialog in CFS2.
Have Fun! Simon Porter
2/25/01