Weapon - Playing a sequence, not an animation.

I never would have needed help with this in the past, but I have forgotten how to do this. I created a model, but the animations don’t play ingame. In Hammer Editor, for the first version, the sequences play but the animations don’t, so I would like to know how to play the sequences ingame. I can’t guarantee it will fix my problem, but for other people who might want to know, this thread could help.

Please inform.
Thank you!

[editline]3rd May 2013[/editline]

What am I, dead? I’m being ignored quicker than a dust particle here…

If it isn’t possible, then just say that!

You made a model in Hammer?

What? No, I made it in 3Ds max… for source, which means I can use it in, oh, guess what, HAMMER! …:downs:

[editline]3rd May 2013[/editline]

With what I said I meant that the animations PLAY or DON’T PLAY, in Hammer, fine (as prop_dynamic)…
In game, however, they do not play at all. That doesn’t matter, what matters is the question: How do I make a Weapon play a Sequence, not an ACT, and have it stop when the sequence is over, even in lag, with Lua?

[editline]3rd May 2013[/editline]

I would humor you, but I am seriously looking for help here! The animations and sequences play perfectly in Hammer, in Model Viewer, and other Source SDK tools, but they don’t play in-game! I want to know how to fix this, and make the animations work in-game!

What are you trying to do exactly?
Weapon, ent?

Altrough, i think LookupSequence could work

What I think he means is a function similar to :SetSequence() but for the Weapon class.

If that’s what you’re looking for, unfortunately I don’t believe there is one. Awhile ago I had a project and I asked the same question and nobody ever answered with helpful information.

Oh. self.Owner:GetViewModel():ResetSequence() is what you are looking for.
But I highly recommend you adding ACT_VM_* stuff to your model, since ResetSequence is glitchy in multiplayer with weapons.

Uhm, I’m trying to get the weapon to play my custom view model’s animations? The “Animations” as they are called, such as “ACT_PRIMARYATTACK”, don’t work, I want to know how to play the sequence instead, like “shoot”.

Well, I’m not programming this weapon for Multiplayer, but that is good to know. It doesn’t currently work in Multiplayer, anyways, the variables don’t sync over networking.

[editline]4th May 2013[/editline]

But, if ACT_VM_PRIMARYATTACK is more likely to work, perhaps I need to rename the acts, then?

I believe I mean Activities, not Animations… for all of what I’ve said.

However, in the .qc file, sequences are made with $sequence <Name> <SMD File Location> <Options…> and Activities are made with $animation <name, like ACT_IDLE> <SMD File Location>; Please correct me if I’m wrong…

[editline]4th May 2013[/editline]

And reset sequence? The problem is the weapon just won’t play any ACT_ animations! It doesn’t draw, it doesn’t idle, it doesn’t do anything but sit there in the gun pose, but I did compile it with animations…

Here is the first .qc file I used:


$modelname "weapons\v_HeliGun.mdl"$scale 1.0
$cdmaterials "models"


$body "Body" "heligun\HeliGunReference.SMD"


$sequence "idle" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\idle1.SMD" rotate 90 fps 20 ACT_IDLE 1
$sequence "shoot" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire.SMD" rotate 90 fps 42 ACT_PRIMARYATTACK 1
$sequence "chargedshoot" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire2.SMD" rotate 90 fps 28 ACT_SECONDARYATTACK 1
$sequence "empty" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\dryfire.SMD" rotate 90 fps 30 ACT_DRYFIRE 1
$sequence "draw" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\draw.SMD" rotate 90 fps 20 ACT_DRAW 1
$sequence "lower" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lower.SMD" rotate 90 fps 30 ACT_LOWER 1
$sequence "lowered" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lowered.SMD" rotate 90 fps 15 ACT_LOWERIDLE 1
$sequence "tocombat" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun	ocombat.SMD" rotate 90 fps 15 ACT_RAISE 1
$sequence "recharge" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\recharge.SMD" rotate 90 fps 60 ACT_RECHARGE 1


$surfaceprop "metal"


$attachment "muzzle" "HeliMuzzle" 0.00 0.00 0.00 rotate 0 0 0
$attachment "1" "ValveBiped.eject" 0.00 0.00 0.00 rotate 0 0 0

Here is the final, and current .qc file I used in an effort to fix this glitch, it did not fix it at all:


$modelname "weapons\v_HeliGun.mdl"
$scale 1.0
$cdmaterials "models"


$body "Body" "heligun\HeliGunReference.SMD"


$sequence "idle" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\idle1.SMD" rotate 90 fps 20 ACT_IDLE 1
$sequence "shoot" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire.SMD" rotate 90 fps 42 ACT_PRIMARYATTACK 1
$sequence "chargedshoot" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire2.SMD" rotate 90 fps 28 ACT_SECONDARYATTACK 1
$sequence "empty" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\dryfire.SMD" rotate 90 fps 30 ACT_DRYFIRE 1
$sequence "draw" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\draw.SMD" rotate 90 fps 20 ACT_DRAW 1
$sequence "lower" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lower.SMD" rotate 90 fps 30 ACT_LOWER 1
$sequence "lowered" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lowered.SMD" rotate 90 fps 15 ACT_LOWERIDLE 1
$sequence "tocombat" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun	ocombat.SMD" rotate 90 fps 15 ACT_RAISE 1
$sequence "recharge" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\recharge.SMD" rotate 90 fps 60 ACT_RECHARGE 1


$animation "ACT_IDLE" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\idle1.SMD"
$animation "ACT_PRIMARYATTACK" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire.SMD"
$animation "ACT_SECONDARYATTACK" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\fire2.SMD"
$animation "ACT_DRYFIRE" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\dryfire.SMD"
$animation "ACT_DRAW" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\draw.SMD"
$animation "ACT_LOWER" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lower.SMD"
$animation "ACT_LOWERIDLE" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\lowered.SMD"
$animation "ACT_RAISE" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun	ocombat.SMD"
$animation "ACT_RECHARGE" "E:\steam\steamapps\gordonfuxalyx\sourcesdk\bin\ep1\bin\heligun\recharge.SMD"


$surfaceprop "metal"


$attachment "muzzle" "HeliMuzzle" 0.00 0.00 0.00 rotate 0 0 0
$attachment "1" "ValveBiped.eject" 0.00 0.00 0.00 rotate 0 0 0

Yeah, you don’t like that? It replaces my real name, which I shall never share!!!

[editline]4th May 2013[/editline]

On top of that, please note that I did make my account name 6 years ago, when I was 12…

I really am tired of this title I have… “I GOT BRAIN DAMAGE BECAUSE I’M AN IDIOT” … It’s backwards, you see, it should say “I’M AN IDIOT BECAUSE I GOT BRAIN DAMAGE” … I didn’t pay for that title, nor did I ask for it… someone else decided to give my the title.

that is absolutely not what $animation is for

Well then, please tell me, how can I fix this all so that the Activities play in-game?

How about looking at valve wiki?

They shown me all the stuff about qc i had to know.

No freaking poop, that’s where I got $animation from -_-

Then your pooping it wrong dude.

Try and read carefully, i think on that situation that you only need $sequence.

Here, use one of my QCs as an example:


$cd "C:\OICW\SRC"
$modelname "weapons/v_ar2.mdl"
$model "studio" "AR2_reference.smd"
$includemodel "weapons/v_ar2_idle.mdl"

$cdmaterials "models\Weapons\V_hand\"
$cdmaterials "models\Weapons\V_ar2\"
$hboxset "default"
$hbox 0 "Bip01 L Forearm" -0.510  -3.273  -2.910  16.160  3.016  2.648
$hbox 0 "Bip01 L Hand" 0.000  -1.800  -2.727  5.087  1.633  2.281
$hbox 0 "Bip01 L Finger0" 0.000  -0.705  -1.261  1.518  0.789  0.811
$hbox 0 "Bip01 L Finger01" -0.394  -0.546  -0.685  1.222  0.630  0.675
$hbox 0 "Bip01 L Finger11" 0.000  -0.679  -0.650  1.781  0.401  0.523
$hbox 0 "Bip01 R Forearm" 0.000  -2.091  -0.992  15.997  1.716  1.503
$hbox 0 "Bip01 R Hand" -14.627  -1.579  -2.623  33.187  4.275  16.463
$hbox 0 "Bip01 R Finger0" 0.000  -0.706  -0.862  1.708  0.788  1.020
$hbox 0 "Bip01 R Finger01" 0.000  -0.548  -0.533  1.221  0.628  0.633
$hbox 0 "Bip01 R Finger2" 0.000  -0.308  -0.673  2.656  0.757  0.574
$hbox 0 "Dummy15" -3.724  -8.762  -0.562  2.258  2.061  0.617
$attachment "muzzle" "Bip01 R Hand" 32.00 2.60 5.60 rotate 0.00 0.00 90.00
$attachment "1" "Bip01 R Hand" 15.00 3.00 6.60 rotate -0.00 90.00 0.00
$surfaceprop ""
$illumposition -37.755 7.023 -13.341
$sequence AR2_idle "AR2_idle" loop ACT_VM_IDLE 1 fps 30.00
$sequence AR2_primary_fire "AR2_primary_fire" ACT_VM_PRIMARYATTACK 1 snap fps 30.00 node 2 {
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "weapon_muzzleflash_ar2 follow_attachment muzzle" }
  { event 6001 0 "1" }
}

$sequence AR2_primary_fire2 "AR2_primary_fire2" ACT_VM_HITLEFT 1 snap fps 30.00 node 2 {
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "weapon_muzzleflash_ar2 follow_attachment muzzle" }
  { event 6001 0 "1" }
}

$sequence AR2_primary_fire3 "AR2_primary_fire3" ACT_VM_HITLEFT2 1 snap fps 30.00 node 2 {
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "weapon_muzzleflash_ar2 follow_attachment muzzle" }
  { event 6001 0 "1" }
}

$sequence AR2_primary_fire4 "AR2_primary_fire4" ACT_VM_HITRIGHT 1 snap fps 30.00 node 2 {
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "weapon_muzzleflash_ar2 follow_attachment muzzle" }
  { event 6001 0 "1" }
}

$sequence AR2_primary_dry "AR2_primary_dry" ACT_VM_DRYFIRE 1 fps 30.00
$sequence AR2_secondary_fire "AR2_secondary_fire" ACT_VM_SECONDARYATTACK 1 snap fps 30.00
$sequence AR2_draw "AR2_draw" ACT_VM_DRAW 1 fps 30.00
$sequence AR2_reload "AR2_reload" ACT_VM_RELOAD 1 fps 30.00 {
  { event 5004 11 "Weapon_OICW.Clipout" }
  { event 5004 36 "Weapon_OICW.Clipin" }
  { event 5004 47 "Weapon_OICW.Clipin2" } 
}
$sequence nothreatidle "nothreatidle" loop ACT_VM_IDLE_LOWERED 1 fps 30.00
$sequence nothreattoidle "nothreattoidle" ACT_VM_LOWERED_TO_IDLE 1 fps 30.00
$sequence idletonothreat "idletonothreat" ACT_VM_IDLE_TO_LOWERED 1 fps 30.00
$sequence attack1 "attack1" ACT_RANGE_ATTACK_AR2 1 snap fps 30.00
$sequence attack2 "attack2" ACT_RANGE_ATTACK_AR2_GRENADE 1 snap fps 30.00


$animation is only for creating an “internal” animation “file” for (pre)processing, e.g. blends, loop fixes etc

Well, okay, can anyone then explain why it is that the Sequences AND Acts work (and play properly) in the tools available within Source SDK (model viewer, Hammer Editor), but in-game they do not play?

No? No one can explain that? … :suicide: :downs: :tinfoil: :rolleyes:

[editline]9th May 2013[/editline]

Really? You think this comment warrants a dumb rating? I really want these animations to work, but no one has the :words: to try and help again, and I’m dumb for bringing it back? You’re pathetic if you believe that. :tinfoil:
Unless you can provide me with an A+ reasonable answer as to why.

If you want help, try showing people respect rather than getting pissed at people for not helping someone who clearly won’t appreciate the time and effort it took them to write a post.

I just can’t seem to find it on the VALVe wiki, I’ve been searching for days and days… and since the animations AND activities play when the model is placed in Hammer, I don’t believe that I’ve done anything wrong.

[editline]9th May 2013[/editline]

Excuse me? I’m upset that they just rate me dumb and act like that’s the end of it. People who do that simply don’t give a shit, about me or the cause, that’s how I see it.

[editline]9th May 2013[/editline]

P.S. This is not flaming… It would be a hell of a lot worse if it was… and trolling? That’s what I’m responding to, just rating me dumb and leaving IS trolling.