How to add BF2 Capes
Synopsis: You extract the MODL chunk from one msh file, and insert it into another one, while changing the variables that determine the size of the file.
Note: I'm using Hex Editor XVI32 I suggest you use it too
OTHER NOTES:
-There are more than one MODL chunks, don't get confused.
-When reading long ints with the data inspector, put the cursor on the first byte of the 4 byte long int, the number should appear in the data inspector after "long int"
-The msh format is broken up into chunks, which can be inside each other. Go here for a complete description and a visual.
-MODL chunks are wher MODELS are in. To find where they are located in a msh file, go to the msh reference above or search for them within the msh file.
#####IMPORTANT ADDENDUM LOCATED AT END OF FILE FOR YOU HEX EDITORS#####
Getting the cape
1. Find cape you want (which .msh, I'll use rep_inf_ep3sniper)
2. Open it up in hex editor
3. Search > find and search for: MODL
Note remember to start at begining. After MODL in the msh file, they'll be a MTYP MNDX and the NAME hedr. Make sure afer the NAME header is rep_inf_ep3sniper_cape, or whatever the cape is called.
4. Go to tools > data inspector you'll need it
5. Put the cursor afer the MODL header that includes the cape (not on the 'L' on the byte after it)
6. read the long int number on the Data Inspector, this is how many bytes are afer it. There will be a 4-byte long- int after each header telling how many bytes come after it.
7. Put cursor on last byte of the long int.
8. Go to address > go to. Select relative down, and type in the long int you read before (press ok for those who are literal)
9. This will put you at the end of the cape's MODL chunk. Make sure you are indeed at the end and not selecting another header.
10. Hold SHIFT and press the up arrow till you return to the begining of the cape's MODL chunk (the data should turn red)
11. Copy (CTRL + C) it and make a new file. Paste it and save this file as "sniper_cape" so you can use it over and over again. Make sure you got all of the cape, and only the cape MODL chunk.
Putting in the cape
1. Open up the model to be given a cape.
2. If you're cape is still on the clipboard, you're ok, otherwise go copy it again
3. Use the search to find the beginings of MODL chunks. The first MODL chunk may be a dummy root (Afer NAME is "dummy_root") skip this modl chunk and find the next one preferably.
4. When your cursor is at the begining of the MODL chunk (M is where the cursor is on) Press the INSERT key and then PASTE the cape MODL chunk into it. The cape should be in it without splitting the other MODL chunk into: M...(CAPE STUFF)...ODL <-- should not be like that should be --> (CAPE STUFF)...MODL (the other model's stuff)
Changing the size long ints in the HEDR and MSH2 headers
You increased the size of the msh file, now you need to change certain long ints that tell how many bytes are in the file. The cape is only under the HEDR and the MSH2 headers, so only these need to be changed.
HEDR
1. At the way beginning is the HEDR header. After this is a 4-byte long int that tells how long the file is after HEDR and the 4-byte long int. Use the data inspector to read it.
2. Go back to your cape MODL chunk you saved to a different file.
3. Put your cursor at the way end and read the address on the bottom left. Put this in a calculator.
4. Place the cursor on the first byte of the long int directly after HEDR (address is 4, remember, counting starts at 0).
5. Read the long int number in the data-inspector. Add this to the number in the calculator, and add 1 to the sum (cause reading the cape started at 0, now we want to count starting at 1)
6. Got to tools > encode number and type the result of step 5 and check the long int box, make sure to overwrite at current address (press ok).
7. The number should be encoded in binary format now.
MSH2
1. Read the long int after the MSH2 header (I assume you know how to do this by now)
2. Add the long int + cape size + 1
3. Encode the sum from step 2 after MSH2.
You're done. Save it (don't overwrite original) and put it in-game.
######ADDENDUM######
Also, a tip for hex editors, when writing the HEDR and MSH2 long ints, simply put your cursor on the 'C' of CL1L and read the index (decimal) at the bottom left of the window. That is what the HEDR size is. Also, put your cursor on the 'S' of SKL2 and read the index (decimal) at the bottom left of the window, and subtract 16. (IF There is no SKL2, put the cursor at CL1L and still subtract 16). This is the MSH2 size. This makes it so you can just throw in a bunch of modl chunks, then easily write the correct size. This also means you can disregard any of the steps that involve recording the size of the modl chunk and adding it to the HEDR.
Make sure not to forget the c_ meshes (collision), a list is in the COLL chunk (search for COLL, then look for MODL's with c_). Copy them as you would copy the cloth modl chunk. Same thing.
If you have trouble following or understanding this tutorial then please try THIS one.






