HOW TO BREAK YOUR PLANE IN CFS2 (WITH A LITTLE HELP FROM FSDS 2.1) ------------------------------- by Hayden Scott-Williams Firstly, let me state categorically that while I present this document as a 'how-to' for creating breakable models for CFS2 using FSDS2.1, I am fully aware that the methods outlined here may not be the only, or even the most efficient way of doing this. I'm sure that there is still a lot to learn about the whole breakable parts story but this is what I have discovered thus far and I present it to help those questing for knowledge along the road to enlightenment. Secondly, and possibly most importantly, I have to thank Corrado La Posta for his tutorial on how to create breakable parts using SCASM editing. It was the extensive information contained in his document that pointed me to the right variables and values needed to get the job done. INTRODUCTION ------------ The trick to creating breakable parts for CFS2 aircraft using FSDS2.1 is not, as so many of us (including myself) assumed, in the naming of the parts, but rather in the pre-processing assigned to each part. This is also what makes the process so tedious, as you have to add a pre-process to EVERY part in the model to have the model break up correctly. Let me start of with a brief explanation of what CFS does when it renders broken parts. At each pass through the mdl code, CFS checks the 'crash' variable (variable 90) to see whether each part is, in fact, still attached to the aircraft. If it isn't (i.e. it has broken off or been shot off) it spawns another model of the plane showing only the part that has broken off and then hides this part on the main model. At least, that's how it is supposed to work. This begins to explain why many of you will have had planes that generate 2 or even 3 copies of itself when it gets shot to ribbons in CFS2. What happens is that when the part reaches max damage, CFS2 sees that this part is supposed to break off (a BREAK parameter in the effects section of the dp file for that part) and thus spawns the new model. The problem comes in at this point, because the mdl file does not contain the correct code to tell CFS2 which parts to hide in the main model and show in the spawned model, so CFS2 shows ALL the parts. I know of two ways to solve this. This first is the easy way. Go through the dp file and wherever there is a BREAK parameter with a number following it, remove the number. e.g.: [EFFECTS.0] ; System = Nose Structure Location = -0.007,0.003,1.615 . . . effect.4=100,BREAK,6, Changes to: [EFFECTS.0] ; System = Nose Structure Location = -0.007,0.003,1.615 . . . effect.4=100,BREAK,, What this will do is stop the multi-model re-spawning problem, but at the same time, your plane will remain whole, no matter how hard you hit it. The second method is the hard way (well, ok, not as hard as editing and re-compiling SCASM code). It involves adding the code to tell CFS2 what to do when a part breaks. This involves adding a pre-process to each part in your model, telling CFS2 what parts to show and hide whenever the crash flag is set for that part. HOW TO DO IT ------------ As far as I know (and here is one of the places where I'm wide open to correction), CFS recognises 11 basic part groups. (Actually, I know of 15, but I don't have parameters for the other 4) These are: Part Name dp var 90 Param Param ------------- ----- ----- Left Wing 01 2 ; corrected 27MAR03 Right Wing 02 1 ; corrected 27MAR03 Tail 03 4 Left Wingtip 04 256 Right Wingtip 05 512 Nose 06 2048 Engine1 07 4096 Engine2 08 8192 Engine3 09 16384 Engine4 10 32768 Fuselage 8 Each part in your FSDS model will be assigned to one of these groups and will be hidden or displayed depending on whether the corresponding group has 'crashed' or not. The dp Parameter number is the parameter assigned to the BREAK command in the effects section corresponding to that part group. (Hence the 6 following the BREAK in the example above). More on these later. The var 90 Param (parts_visible variable) is the value you will use in your pre-process command to tell CFS2 which part group you are assigning the selected part to. Now you could, of course, head off to your FSDS model right now and begin assigning pre-processes to each part based on the information I have given above. but entering all the data can be a little tiresome, so kind old uncle Hayden has made it a little easier for you. Here's what you do: 1) Look in your FSDS main folder for a file called 'VarPresets2002.cfg' and open it in notepad. 2) Scroll to the end of the file. The last entry you see should read 'Parts Visible:parts_visible:And:8:0:A' 3) Paste the following in after this last entry: Left Wing Visible:parts_visible:And:2:0:A ;corrected 27MAR03 Left Wing Tip Visible:parts_visible:And:256:0:A Right Wing Visible:parts_visible:And:1:0:A ;corrected 27MAR03 Right Wing Tip Visible:parts_visible:And:512:0:A Tail Visible:parts_visible:And:4:0:A Engine 1 Visible:parts_visible:And:4096:0:A Engine 2 Visible:parts_visible:And:8192:0:A Engine 3 Visible:parts_visible:And:16384:0:A Engine 4 Visible:parts_visible:And:32768:0:A Nose Visible:parts_visible:And:2048:0:A Fuselage Visible:parts_visible:And:8:0:A 4) Save and close the 'VarPresets2002.cfg' file. This has added a number of pre-process preset conditions for you to assign to the parts in your FSDS project. Now all you need to do is go through your project, assigning each part to one of the part groups by assigning a pre-process condition to it. You do this by: 5) Selecting the part, (you don't need to actually 'select' the part. just make it the current part) 6) Press 'F2' or select 'Edit' and then 'Part Properties' from the menu bar. 7) In the Part Properties window, you will see the 'Pre-Process' section on the bottom, left-hand side. Click the 'Add' button. 8) Click the 'Condition' button on the 'Add Predraw Process' dialogue. 9) In the 'Display Condition' window, click the 'Load Preset' button to bring up the list of preset conditions. 10) Scroll to the bottom of the list and you will see the presets we added above. 11) Select the preset corresponding to the part group you wish to assign the current part to. 12) Click 'Ok' to close the 'Display Condition' window. 13) You should now see the selected process in the pre-process list. Click 'Ok' to close the 'Part Properties' window. 14) select the next part and repeat the process from step 5 above for each part in the project. A point to remember is that CFS2 takes the fuselage as being the main model when it splits up, so whatever parts you assign to the 'fuselage visible' preset will remain with the main model as the plane crashes. Once you have added a pre-process to each part in your project, compile the project. Now to the dp file. Open the dp file for your aircraft in notepad. You are looking for entries beginning like this: [EFFECTS.x] where x represents the number of the effect. The next line after this heading should tell you which part group it applies to. You are looking for the following part groups: ; System = Nose Structure ; System = Engine (or Engine1 etc) ; System = Port Wing Structure ; System = Port Wing Tip Structure ; System = Starboard Wing Structure ; System = Starboard Wing Tip Structure ; System = Tail (fwd) Structure ; System = Tail (rear) Structure The last entry for each of the effect entries you are looking for should be something like this: effect.4=100,BREAK,6, or effect.4=100,BREAK,, If there is a number, make sure it corresponds to the correct dp parameter for that part group listed in the table above. Thus, the nose structure entry should read something like this: [EFFECTS.0] ; System = Nose Structure Location = -0.007,0.003,1.615 effect.0=10,LIBRARY,fx_smkpuff_s, effect.1=30,LIBRARY,fx_engfire_s, effect.2=60,LIBRARY,fx_engfire_m, effect.3=95,LIBRARY,fx_airexpl_l, effect.4=100,BREAK,6, and the right wing should be: [EFFECTS.19] ; System = Starboard Wing Structure Location = 0.587,-0.511,-0.406 effect.0=10,LIBRARY,fx_smkpuff_s, effect.1=30,LIBRARY,fx_engfire_s, effect.2=60,LIBRARY,fx_wingfire, effect.3=95,LIBRARY,fx_airexpl_s, effect.4=100,BREAK,2, (Remember, Port = Left and Starboard = Right) Don't worry if the effects don't all look like these examples. The important one is the last one with the BREAK command. Once you have made sure all the part groups have the correct break parameter, save the dp file, fire up CFS2 and try shooting the stuffing out of your plane in Quick Combat. Hopefully she'll break up just as you want her to. Well that's it for now. No doubt, I'll be revising this document on a regular basis as I get comments, questions, criticisms and new information. Keep looking out for an updated version. In addition, If you have any comments, criticisms, questions or new information to add, PLEASE mail me at: fang@pyromania.co.za I'll be only to happy to hear from you. Happy flying (and breaking) Hayden "Fang V^V" Scott-Williams fang@pyromania.co.za