STEAM GROUP
Blender Tutorial Community BlenderTuts
STEAM GROUP
Blender Tutorial Community BlenderTuts
28
IN-GAME
187
ONLINE
Founded
October 16, 2012
Language
English
Location
United States 
Kilroy Aug 28, 2013 @ 2:30pm
how to make weapon parts move
i would like to start making weapons for so when valve adds back in the ability to upload weapons to tf2, ill have a bunch of ideas/designs and experience, but i do not know how to make the parts move for things like reloading and such. can anybody help me?
< >
Showing 1-7 of 7 comments
HellJumper Aug 28, 2013 @ 7:31pm 
I don't work with custom animations, but you can just use the in-game animations.

Modeling / Exporting a weapon is a very similar process to hat making. The key difference lies in the fact that instead of using the bone rig of the character model, we will be using the bones of a pre-existing weapon that we want to replace. So for example, if we wanted to make a Sandman replacement, we wouldn't import the scout model, but rather the Sandman model to see what bones it comes with. The following is a process on how to export a weapon from Blender (c_models):

  • Start a fresh, blank blender scene.
  • Extract a model that you want to replace from the team fortress 2 materials GCF (tf/models/weapons/c_models). Make sure to grab the .mdl file and any associated file (.vvd, .phy, etc)
  • Hex the extracted .mdl file by opening the file with notepad++ and changing the "IDST0" to "IDST,".
  • Decompile the hexed model file to get your weapon smd file.
  • Import the weapon smd into Blender.
  • Make your model without altering the imported decompiled model, and when you are ready, superimpose your model directly on top of the decompiled weapon. Make sure the properties of your model are all normal (you can check this by pressing "n" and making sure your scaling is all 1 and your positions are all 0. If they aren't just make sure you change them, and then reposition your model in edit mode).
  • Delete the decompiled weapon and assign the remaining bones to your model via the vertex groups panel. You can check to see that you assigned each bone to the appropriate vertex group via weight-paint mode. Melee weapons usually only have 1 bone whereas more complicated weapons will have a variety of bones that may or may not be shared between different groups of vertices. It is probably advisable to start with something simple like a melee weapon and work your way up to a more complicated model such as the huntsman (complicated!)
  • Now that you have assigned the bones to your model, the process is the same as exporting a hat.


For more complicated weapons, you just assign your model to multiple bones. The flaregun is a good example: Most of the model is assigned to weapon_bone, but the trigger and barrel are assigned to other bones. When you compile your model, the engine will use the animations for the flaregun, and the parts corresponding to your model will animate automatically. Custom animations are much harder since you'll need to create animation smds and then have the engine recognize them via the QC file.
Last edited by HellJumper; Aug 28, 2013 @ 7:32pm
Flat Penguin Nov 18, 2013 @ 4:26pm 
Hey Helljumper really good advice again! I'm interested in trying to do a weapon at some point when i'v got some spare time just for fun as I know Valve are unlikely to accept it. One thing though; not sure what you meant by " superimpose your model directly on top of the decompiled weapon".

Say if i wanted to create a weapon that was similar to the spycicle. I would import the model into blender then delete it once i had rigged my model in the same way using the same bones? This will give me the same animation as the spycicle ingame??

Thanks
HellJumper Nov 18, 2013 @ 5:28pm 
Yeah, the basic concept behind animating is that you use bones rather than geometry. Thus the position of the vertices in relation to the bones is how the model will animate. Basically if you were to use the animations of the spycicle, you'd need your model to be as close as possible position/size-wise in order for your model to animate properly.

So yeah, importing a decompiled weapon will do two things for you:
1) It will give you the necessary bones that you'll need to attach your own model to
2) It will give you a good idea of where to position your model

So once your done modeling your own weapon, you'll want to just position it correctly and then delete the spycicle.
Flat Penguin Nov 19, 2013 @ 12:32pm 
Thanks I understand now.

One thing I have imported the spy and spycicle into blender and assume there is a way to place the spycicle in the hand of the spy like it would appear in game or do you just have to in edit mode place it approximately? Just want to check iv decompiled all the correct stuff.

http://puu.sh/5nkix.jpg
Last edited by Flat Penguin; Nov 19, 2013 @ 2:08pm
HellJumper Nov 19, 2013 @ 4:53pm 
Careful with that... if you import 2 things you might get bones interfering with each other (i.e. both the spy and weapon have the weapon_bone armature...)

Also if you want to pose your character, you'll need to import animation .smd files. You can do that by decompiling a character model and then importing an animation smd file after importing the spy model.
Flat Penguin Dec 1, 2013 @ 9:57am 
I'v just stumbled along a problem where I want to compile my weapon model so i can see it in the test map but the GUIstudio mdl doesn't seem to want to work. I get the following messages:

http://puu.sh/5yXpU.png

http://puu.sh/5yXxS.png

I'm a bit concerned as I cant seem to find my Source sdk folder under my username:

http://puu.sh/5yXHf.jpg

Thanks
HellJumper Dec 1, 2013 @ 12:15pm 
I don't really know what's up with the GUIstudio compiler. I haven't tried using it since the steampipe update (which was during the beta import tf2 update), so as far as I know the update broke it. You could always just manually compile your models using valve's studiomdl compiler.
< >
Showing 1-7 of 7 comments
Per page: 1530 50