Jump to content
Official BF Editor Forums

Weapon animation tutorial for 3ds max


Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

One of the things that you should try to do when making a new weapon is to steal as much as you possibly can from the original game. Once you've exported your object and are successful in getting a .con file and .BUNDLEDMESH and .COLLISIONMESH files to show up, you need the rest of the code. For vehicles, you load up the simple object into the editor and run the car wizard. It associates the files and adds a tweak file. The tweak is where you set what you're looking for. What I do is take a weapon from BF2 that's close to mine and then I copy over every single file from both the objects_server.zip and objects_client.zip and put them into my /objects folder, which is in the root of my mod. I always take care to keep the same directory structure the core game uses, but I don't think it matters much except for organization. Once I have that, I rename everything, BUT THE SOUNDS, to my objects' name. The name of the tweak file, all instances of object names in the tweak file (I use CNTRL+H = find/replace), again skipping the sounds but CHANGING THE SOUND PATHS, and then you need to rename every single file in the animations 1p and 3p folders. Those are the .baf files for animation. Just change the names of the files, you can't open them. Use a rename utility because there's about 50-80 of them. Open the two animationsystem1p and3p.inc files and go through and use find/replace to rename all instances to your weapons name AND PATH. CAREFUL you want to make sure you get the path in the animationsystem files. If you accidentally rename the sounds, it just means one more step. Technically you should be replacing the sounds yourself, but I don't handle that part so I skip it altogether. BUT, if you do rename them in the tweak, you'll have to copy them and rename the files in your sounds folder. You get teh sounds from the objects_client.zip in /mods/bf2.

That should cover it.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...


Ok for the link click it and delete the rawdata.rar from the address, there in the Index of /files/3dsmax you can find the raw data. Except the raw data is point less and makes things a LOT more complicated.

So I think this tutorial could use a more in-depth explanation of WHY IN THE HELL ARE WE DOWNLODING THIS FILE :P ?

Link to comment
Share on other sites

I tried to follow this tutorial and got soooo lost. :x

me too.

junk since you seem to be a expert on animation could post a tutorial for noobs like me on how to mod a existing bf2 .baf file for new weapons and then re-saving the baf.

so far i have imported a baf into max,changed it but no clue on how to save it again as a baf.


Link to comment
Share on other sites

Sorry, i can't really make tutorials. I can't upload squat.

1. Import the 1p or 3p skeleton using Rex's tools

2. Rename the root object to "root_animation_whatever"

3. Create a new selection set named "ANIMATED" caps sensitive (select all objects and add them)

4. Import the 1p or 3p animation (.baf file) depending on what you used in number 1

5. Alter it if you like

6. Open the MAX exporter

7. Paste the full path to your 1p folder (starting with the folder immediately after objects)

8. Click Refresh then Export

9. The editor should update the animation automatically.

You can't skip number one when altering a baf. Only when completely replacing it. The reason is that you're gonna probably want to merge in your weapon pieces so you can have something to work with and that immediately removes the ID# from the object that the original BAF file is corresponding with. Get it? You'll have to replace mesh1 with your weapon part in order to see it. It's no longer the original mesh1 anymore, it's your new one. The old one would have taken the baf import. The trick is to import the animation before you merge your weapon parts. Sorry, I mis-numbered them. It would be between 3 and 4.

Now, you can do it differently, but I find this less than organizational and in the long-run, I find it harder to work with. You don't have to replace the mesh boxes with your weapons parts if you merely link your parts to the boxes and then zero the rotation/position by parent coordinate system. With that method, you can continually import .baf files with no problems. Using the above, all bones will get motion but the weapons parts you replaced will not. However, you now have to move the boxes instead of the weapons now AND, you lose the best feature of replacing the parts:

If you have a weapon that's say, 6 individually moving pieces. If you link to boxes and keep the boxes as controllers, you must merge, link, zero T/R to each piece individually and then reposition them. Alternately, you 'could' zero the T/R (translation/rotation btw) of the boxes to the weapon parts. But it's the same number of steps. If you replace the boxes, you merge all pieces, only link mesh1_fp_GenericFirearm to mesh1 and the rest follows. You then delete the corresponding boxes per how many weapon pieces you have and it's done in 11 seconds.

Link to comment
Share on other sites

  • 1 month later...

You'll need the above mentioned tools from doomlab. Best way is to use Rexman's latest files from Dec, 22nd and then replace the cooresponing files with those from Doomlab. Then you have the 'Necessary Tools' menu item.

On a sidenote: the Heightmap import is not directly suited for Navmesh editing, it needs to be scaled and mirrored :P

Link to comment
Share on other sites

OK I got everything working now, I think. Now I export and it thinks like normal but I dont have any files in my target directory. This is what I did.

-Imported the 1p skeleton

-Renamed the root to the animation naming convention

-Imported an existing .baf in this case the 1p claymore fire animation.

-Deleted the mesh1

-merged my new weapon into the scene and renamed it mesh1, linked to the root animation. BTW even though I had the same scale, my new weapon was huge in the scene, but I already exported this weapon to the editor/game and the size was fine. Not sure what the deal is here.

-created new selection set and added all pieces.

-Selected all objects and hit export, and nothing is in target directory. What am I doing wrong?

Link to comment
Share on other sites

Double check your target directory. I know that sounds dumb, but...

Your scale is off perhaps because in one of your files the units are different or you forgot to check the scale on all objects. Keep in mind it will not reset scale on heirarchies, only the roots of them. So you should always select each object individually. If any of your helpers are scaled, that translates to everything under it being scaled too.

Metric, 1unit = 0.1 meters. Check this on both the weapon export scene and your animation scene.

The instant that you rename the root object from root_skeleton_xxx to root_animation_xxx, it outputs a baf file. I've never had it fail to export one without an error, only that I often am looking in the wrong folder for where it's exporting.

Link to comment
Share on other sites

-Deleted the mesh1

-merged my new weapon into the scene and renamed it mesh1, linked to the root animation.

I don't think you should delete the mesh 1.

If you merge your weapon to the scene , i always link the weapon mesh to the mesh1 and in the selection set i leave out the weapon before i export and so far the animations that i exported worked ingame :)

Link to comment
Share on other sites

No, I'd never say that Blitz. I'm saying check the simple stuff :)

Seriously, import a new skeleton, rename the root to root_animation_xxx, select all, add to "ANIMATED" set and export to your desktop. Do you get a baf file? If that doesn't work, your tools are jacked.

And Tuut, what you described is the same thing. Now imagine a weapon with 12 parts. Your way you have to link each box to each piece and then move all the boxes by parent to line up with each piece one by one. My way, you import the weapon, delete the same number of boxes, delete the "_Fp__GenericFireArm" from all weapon names, add them to the set and it works. Your way is actually closer to what must be done for 3p, but 1p is VERY forgiving as I have yet to find a method that actually doesn't work. Cept forgeting to link the new pieces to the root, which results in a successful animation, but no weapons or stationary weapons.

Link to comment
Share on other sites

  • 5 years later...

Hi, First time user, sorry about the necro.

I hang out on the realitymod forums, and I have done weapon animation tutorials but I never used this site for reference until now.

Im hoping that this forum's oldest users are still around as i could really use some help. My animations are exporting just fine and i can use them in game because the animationsystem1p file is working properly. However WHen i get in game the actual weapon floats off to the right. THis is probibly due to my having borrowed the system file from a different weapon and renamed the paths. Or it could be down to my not using the proper mesh, I realised i may have used the wrong weaponmesh when i was stripping the model for 1p anims so i set it all back up made some animations and exported them.

The "hands" exported and animated just fine, but the weapon still floats and goes off screen. Are there any usual suspects for this error, im trying my best here.




Also im having a problem with the editor, it crashes every time i run physics, ever heard of this problem? everything should be set up correctly. thanks you in advance.

Edited by psykogundam
Link to comment
Share on other sites

  • 7 years later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Create New...