Home Contests & Challenges Archives Team Fortress 2

Animating a pistol replacement - Help!

Hi, I'm new to polycount so if this is posted in the wrong place please forgive me :I

For the past several months a partner and I have been working on a pistol for the Engineer:
http://i.imgur.com/vah6UMb.jpg
http://i.imgur.com/t7S1ioz.jpg

My partner is the Blender master, and I take care of compiling. At this point we have a completed model, texture, and normal map that all work as a reskin of the stock pistol (for both scout and engineer, though it should only be for engie) Problem is, it needs custom animations because of the way it is designed, specifically for reload. See that red/blue knob thing at the back? The engie will pull a battery-clip out from that and load a new one in, similar to the syringe gun reload animaton.

yCarcnO.png

For the reskin, it currently replaces c_pistol.mdl. I've searched all over to figure out how animations work and I thought we should use the old v/w model system. We made a new .dmx reference with our weapon, replaced all the animations, and made sure the .qc was in order (I can post the qc if needed) but when we put it in game.. well it was pretty hilarious actually. No sign of our animations, instead there was a detextured arms model with our gun floating 2 feet below:

http://i.imgur.com/NKSTrUd.jpg
http://i.imgur.com/CvFPYtq.jpg
http://i.imgur.com/eMtOb8y.jpg

I figure either v and w models don't even work anymore, or I just royally screwed it up. I tried to replace v_pistol_engineer.mdl. Now I'm coming to you guys, because I have searched everywhere and cannot find a tutorial on how to set up/compile animations anywhere, and every other forum post I've made never got an answer. Here's what I really need to know:

- What file(s) should I be replacing to make animations work? Is it v/w models or c models?

- What do I need to look out for in the .qc?

If you don't know about this, please direct me to somewhere/someone who does. Getting no response is very depressing :P I've had to figure out most of this process myself for the first time since most tutorials are incomplete or out of date after the steampipe update, but with this issue I've hit a brick wall. ANY assistance you can give is hugely appreciated.


Thanks,
-CaptainGoodstuff

Replies

  • CaptainGoodstuff
    Anyone know about compiling animations? Just a very basic explanation is all I need.

    If not, is there a different place/person I should ask about this? Please, anything at all would help. I'm kinda stuck until I figure this out.
  • noCLUE
    Offline / Send Message
    noCLUE polycounter lvl 6
    I feel your pain, dude. Changing animations in tf2 is a huge pain in the ass and I'm still struggling to find out how to do it. I can't help you a lot unfortunately, as I haven't found out everything yet, but I THINK (not 100% sure) I can steer you in the right direction: You're looking in the wrong folder.

    When it comes to v and w models, I wouldn't bother with them anymore: Valve seems to phase them out gradually, instead using pure c_models (even engy's pda was changed to the c_models system in the recent love and war update, even though the v and w models are still in the game files). Your screenshots seem to confirm my suspicion, all you did was basically add an extra set of arms to the weapon model when it wasn't needed.

    The way it works now (again, I'm not 100% sure): All weapons use only one model now, the c_model, which are used together with a seperate "arms" model for each class. You can find those in the c_models folder and that is also where you will find the "CLASS_animations.mdl" files. That's where all the (first person) animations are stored and I assume that is the one you need to replace.

    HOW you can replace it on the other hand, is an entirely different question, that I unfortunately can't answer. You could try to decompile it with Crowbar and just recompile the files with your own animations, but I'm not sure how or if that works.

    If this doesn't help, you could check this link out, where a guy shows how to replace a taunt animation. Maybe you can use some of that for the first person animations?
    http://tf2.gamebanana.com/tuts/10817

    Hope I could help a little. Good luck! XD
  • Baddcog
    Offline / Send Message
    Baddcog polycounter lvl 9
    I haven't compiled new anims for a weapon, but you need the anims called in your qc file.

    Probably best to look for names of anims, then just compile your model/export anims with the stock names. Then you put those files in your tf2 models folder where the originals are.
    That shoulod override the stock ones for testing.

    $modelname "props\myfirstmodel.mdl"
    $body mybody "myfirstmodel-ref.smd"
    $staticprop
    $surfaceprop combine_metal
    $cdmaterials "models\props"

    $sequence idle "myfirstmodel-ref.smd"

    $collisionmodel "myfirstmodel-phys.smd" { $concave }


    you can add more $sequence lines. all static models use 'idle'. You can add others as needed.

    https://developer.valvesoftware.com/wiki/Sequence
  • CaptainGoodstuff
    Thank you both so much for replying, this is the first time in weeks that anyone has given me any kind of answer to this problem.

    noCLUE - Yeah, I think I saw somewhere that they were phasing out v and w models. What confused me is that the files aren't consistent, some are c and some are v/w. It would be nice if Valve would keep workshop submitters up to date on this stuff, or any catastrophic changes to the way the game works for that matter, but I'm sure we all feel that way xD

    I found c_engineer_animations.mdl and decompiled it. The animations are all screwed up, but the qc made it out ok. Instead I found a download with clean versions of all of them here. When I tried replacing the pistol files using the qc in there, there was no change. Maybe using the original qc would do it, I'll give that a try.




    Baddcog - for what you are saying, can I just put my animations in c_pistol.mdl and include everything in the qc? If you don't know since you haven't done weapon animations yet, better question: In my past attempts at compiling, the $sequence lines looked like this-
    (for c_engineer_animations.mdl)

    $sequence "pstl_reload" "pstl_reload.smd" {
    fps 30
    activity "ACT_SECONDARY_VM_RELOAD" 1
    { event 5004 14 "Weapon_Pistol.ClipIn" }
    }

    And for my attempt at v_models:

    $sequence reload "reload" ACT_VM_RELOAD 1 fps 30.00 {
    { event 5004 14 "Weapon_Pistol.ClipIn" }
    }

    They both include this "ACT_VM_(action) 1 fps 30.00" line that you don't have there, is that necessary?

    And one last thing- will I need a separate pistol mdl and animations mdl, or should they be combined?



    Thanks again. If you guys don't know anything about the followup questions that's alright (though it would be very helpful :>)
  • Baddcog
    Offline / Send Message
    Baddcog polycounter lvl 9
    Well, you need to export each anim seperately.
    gun_idle (base model/rig) 1 frame
    gun_reload
    gun_shoot (i dunno what you need exactly)

    each anim above needs a $sequence
  • CaptainGoodstuff
    Ok update, I got c_engineer_animations.mdl to compile correctly, and I'm pretty sure I got it to replace one of the animations with a test. When I loaded it up, there was nothing visible but the sounds were there and bullets fired. To make sure it actually recognized changes to the file, I went in and removed the {event 5004 14 "Weapon_Pistol.ClipIn" } line that controls the sound effect of reloading, and it responded to the change. Only problem is the game crashes immediately when I pull out my PDA, and obviously the lack of a model.

    So pretty much ignore what I asked above, now I just need to know how to get the model in there (separate c_pistol.mdl?), and how to make it not crash when pulling out the build PDA.

    Thanks!

    EDIT- Baddcog, yeah I used a separate smd for each animation, and as far as I can tell using $sequence did the trick. I don't think the ACT_VM_blahblah was necessary. SO I just need to figure out how to apply the animations to a specific model, cause when I put them into the custom folder it removed all of engineer's weapons entirely.

    EDIT AGAIN- Oh wait you're saying I can actually just put the animations into c_pistol.mdl and not mess with c_engineer_animations at all?
  • -DN-
    Offline / Send Message
    -DN- polycounter lvl 18
    Credit to TexDstZ

    https://www.youtube.com/watch?v=xpqA3exiZQA&list=UUTF_3naHnMk2cE0pUqfBXFA

    10 part series covering what you are asking about. Ran across you're post looking for most current practices for doing the very same thing myself.

    Good luck with you're project.
Sign In or Register to comment.