Updated: October 2004

In this tutorial, you will learn how to modify weapon animations for Battlefield: 1942 and Battlefield: Vietnam

- Have completed the tutorial on creating a new mod, and how to edit a 3D Model
- Full installed game of Battlefield: 1942 or Battlefield: Vietnam
- Discreet® 3ds max® 5 or higher, or Discreet® Gmax® 1.2 or higher

Extracting the Animation Files

1. Install the needed toolset from the mod developer's kit by running the 3ds Max® or Gmax® toolset installer program if you haven't already.

2. Load up Max and you will find a menu named "Battlefield Tools". Choose "RFA Tools" from the "Battlefield Tools" menu.

3. Choose "Open .rfa" from the file menu.

4. Browse to the "/mods/bf1942" folder of your installed game's location. The "bf1942" mod folder contains Battlefield: 1942's data files for a normal game. (For Battlefield: Vietnam you will chose the folder "bfVietnam" instead of "bf1942".

5. Select "animation.rfa" and press "Open".

6. From the "Extract" menu choose "All".

7. Select the "My_Mod" folder in the "Browse for Folder" dialog and press "OK".

We have now extracted all the necessary animation files. The next thing is to extract the appropriate weapon files.

8. Open the "standardmesh.rfa" in winRFA and extract the following to your "My_Mod" folder (Extract the files with both the ".rs" and ".sm" extension):

If you are working with the colt in Battlefield: 1942:






Note: "Gunmag_m1" is the clip that is used on most weapons in Battlefield: 1942.

If you are working with the AK47 in Battlefield: Vietnam:





Note: You will not need "W_AK47_l1" or "W_AK47_l2". These are just LOD's that replace the weapon model at far distances.


Also note: from now on, we will be using the Colt from BF: 1942 for this tutorial. If you are working in BF: Vietnam, substitute the appropriate AK47 files. Additional info will be provided in those steps where the methods differ.


Importing the pieces

9. Using the Batlefield Tools, import all the pieces listed above for either the Colt or the AK47 into an empty Max scene. These files will only be used for reference when we do the animation, so only check the boxes next to "Only Main Vis LOD" and "Visible". Also make sure that Scale is set to 100%.

10. Once you have imported all the pieces, save the file with a descriptive name like "Colt_Pieces". Don't worry about the positioning of the pieces yet.

11. Now close this file and create a new, empty scene.

12. From the "Battlefield Tools" menu, choose "Skeleton and Skin" and make sure that "Ske/Skn" is selected from the row of buttons at the top of the window. It should look like the following screen.

13. Uncheck the boxes next to "As Boxes" and "Is Weapon" and then press "Import(.ske)". Once again, make sure that "Bone Size" is set to 100%. For the rest of the tutorial, make sure that all sizes stay at 100% when importing so as not to affect your animations.

14. Select "...My_Mod/animations/UsSoldier.ske" and press "Open". You should now see the soldier skeleton in our scene in a running pose if you are using Battlefield: 1942. If you are doing this for BFV, then the skeleton you import will be in a "default" pose, but will also be rotated. To rotate the BFV skeleton to the correct orientation, select the large box labeled "dummyROT", click on Max's rotate tool, and at the bottom of the screen where it says "-90" in the box next to the "X:" type in "0". The skeleton should now be facing forward instead of down.

15. With this scene still open, select the "skeleton and Skin" tool again from the Battlefield Tools menu if it is not still open. This time check the boxes next to both "Is Weapon" and "as Boxes".

16. Press "Import(.ske) once more and this time select "...My_Mod/animations/colt.ske". Double-click or press "Open" to import it into the scene. To make things easy in the next step, don't click on anything or do anything else after the import until you read the next step.


Merging The Skeleton With the Weapon

Here's where things get slightly tricky. The next step is to merge the weapon pieces with the skeleton so that we can see what we're animating, but before we can do that, we need to make some name changes.

17. If you've done everything right and have done nothing else after the import, all parts of the Colt should be highlighted in Max. Click on the "Select by Name" button on the Max toolbar. Notice that the names of the colt pieces are also highlighted in the selection list. Write down these names (or type them into notepad).

Note: all these names are case-sensitive. "Base" is not the same as "base". Make sure to write down all the parts that refer to the weapon. If you are using the Colt, then you will also notice that "Bip01_R_Hand" is also highlighted. Since this is part of the player skeleton and not the weapon, you don't have to worry about it. You'll also notice some names that may not make sense, like "hane". This is because some of the names are in Swedish. Fortunately, most of the names will be self-evident when you look at the files. There are also some extra pieces in the AK47 that you won't need, but just write them all down for now.

18. Close the "Select by Name" window and save your current scene. (the one with the skeleton) Name it something like "Skeleton_Colt_Default". This way if you do lots of weapon animations, you know that if you open this one up, you will get the skeleton with the Colt attached with the "default" player animation. We want to save it now before we do anything else to it that might cause us to have to start over. You may even want to make a copy of the scene under a different name just in case. This is always a good thing to do when trying something new.

19. Close the current scene.

20. Re-open the previous scene with the weapon pieces in it. (This would be "Colt_Pieces" if you were following the previous instructions.)

Note: when opening the scene, Max may bring up a window asking you to find the textures. You can either try to connect them or just click on "Continue". It doesn't matter either way because the pieces are just for reference.

21. Select each piece and rename it using the names that you wrote down in the previous step. For example: "LOD01_colt_mantel_m1-1" becomes "mantel, and so on. You are basically looking for the keyword in each piece that matches one of the pieces of the skeleton, like "mag". If the list you wrote has more names, then there are pieces, don't worry about it. It is only necessary that all pieces present in the weapon scene are named correctly.

Don't forget that the names are case-sensitive!

22. Save this scene again and open "Skeleton_Colt_Default" once again.

23. Select "File>Replace..." from the menu bar and then select "Colt_Pieces" yet again.

24. In the window that pops up, you should see a list of all the weapon parts. Select the parts that you want to replace, (which normally will be All" and press "OK". Click "Yes" if asked if you want to replace the materials along with the objects, although again, it won't make a difference unless you have actually reconnected all the textures.

What we've basically done is told Max to replace all the bones of the weapon with the actual models of the weapon parts. This was why it was important that all the names match up correctly.

Here is the scene before replacement showing just the gun "boxes":

And if everything went correctly, this is what it should look like after replacement (your scene will look a little different because you should also actually see the soldier skeleton connected to the gun:

If you are importing the AK47, you've probably noticed that there are still some boxes named "Sight", "blade", and "trigger". No, you didn't do anything wrong. It appears that these parts were eliminated for some reason, so there are no corresponding files for the bones. (That's right. There is no trigger to animate on the AK47) You can either just leave these boxes as they are or delete them. It won't affect your animations either way.

25. Save your scene again.


Animating and Exporting

You are now finally ready to animate. I would suggest that after all this work, you do a "Save As" and give it a name like "Colt_TestAnim_01" or something similar. This way you can now play as much as you like and yet you can still open up the default scene again at any time to return to a "clean" setup.

26. As a test, animate a piece of the weapon that is a "child" of the piece labeled "base". In this case we animated the "mantel". You can set keys for postion and rotation, but not for scale. Any animation done to scale will not have any effect and any scale animation keys will just be ignored. (Again, you're scene will look a little bit different because the soldier skeleton will also be visible.)

Now that you've done something suitably wacky as a test, we're ready to export the animation.

27. Select all the pieces of the weapon that you've animated and choose "Animation" from the Battlefield Tools menu.

28. Check the box next to "Use Active Segment" and "Is Weapon". Leave all other options at their default and click "Export Single .Baf".

29. In the export dialog box, navigate to "My_Mod\animations\Weapons\Colt\..." and select "ColtReload.baf" to replace it. Double-click on the file or click "save" and then select "Yes" from the confirmation box that pops up.

30. Close 3ds Max.


Testing the New Animation

The last step before starting up the game is to repack all the necessary files with the changes we just made.

31. Navigate to "My_Mod\archives" and run "PackRFA.exe". Select "animations" from the dropdown list and then click "Pack Folder" (you can also just press "All", which will repack all the files in your mod but will take a little longer.

32. Launch the game, select the Colt, fire off a few rounds, and click the Reload button to see your new animation.


Final notes:

This tutorial shows the basics on how to create a new weapon animation to replace an existing one. You can also modify an existing weapon animation by doing the following:

-Use WinRFA to re-extract the original "ColtReload.baf" into your mod's "...animations\weapons\Colt" directory. (see the beginning of this tutorial if you just want to re-extract the entire animation folder again.) This is so we can see the original reload animation as it appears in a normal game.

-In Max, open up your "Skeleton_Colt_Default" scene again. If you saved it correctly, you should have the player skeleton holding the Colt.

-Select "Animation" from the Battlefield Tools menu.

-Check the box next to "Is Weapon", make sure scale is set to 100%, and click on "Import .baf".

-Select "ColtReload.baf" from your "...My_Mod\animations\Weapons\Colt" directory (or whatever file you want to see) and press "Open"

The importer should automatically assign the right animations to the right pieces and adjust the timeline to match the animation. You can now scrub through the animation or press play to see how it looks.

Note that when an animation is exported, a keyframe is placed at every frame for every piece. When importing an animation you will see these extra keyframes. If you want to modify these keyframes, you will need a fairly good knowledge of animating with Max and how to deal with optimizing such data. This is beyond the scope of this tutorial.

Also note: To animate the interactivity of the hand with the weapon, you would import an existing weapon animation onto the weapon (or create a new one), and then also import the corresponding player reload animation (or create a new one), animate the appropriate soldier skeleton bones to match the weapon moves, and finally re-export the appropriate animations to the appropriate places. This is an advanced topic for another tutorial and I would suggest playing around with the basics presented here before moving on to more complex things.


--End of Tutorial--