V Weap Animations in Quake

Discuss programming in the QuakeC language.
Post Reply
Snarboo
Posts: 2
Joined: Wed Mar 07, 2007 7:32 am

V Weap Animations in Quake

Post by Snarboo »

I've been playing around with perQuake and wanted to make a similar mod, but I'm not sure how view weapon animations are handled in Quake. In perQuake, the weapons have a bunch of new animations and doodads. For instance, a weapon will play an animation(cock the weapon, insert a magazine etc) when the corresponding impulse key is pressed. I want to copy ths, and I've read through the weapons and player QC in the clean 1.06 Progs and sort of understand how animations work in Quake, but I'm still confused. I've studied the weapon models in perQuake as well and they seem to have multiple frames(reload, fire, etc) like monsters, so I'm wondering if I should create a new QC file with $frame definitions?

Edit: I think I'm starting to figure this out now, but I'll keep this post open in case I need more help. Sorry about that. :/
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

defined player.qc's player_shot, player_rock etc... frames that set a self.weaponframe = blah. For smoother animation, toss in a self.nextthink = time + 0.03; or some other smaller than 0.1 number
i should not be here
RenegadeC
Posts: 391
Joined: Fri Oct 15, 2004 10:19 pm
Location: The freezing hell; Canada
Contact:

Post by RenegadeC »

You can also run self.weaponframe in playerprethink(); so that weapon frames do not rely on player animations. This is how I got the reloading shotgun frames in my Starship Troopers mod without the player "ice skating" around. Playerprethink runs every frame, so you'll have to define a new float in order to keep track of how fast the animation should play.
Snarboo
Posts: 2
Joined: Wed Mar 07, 2007 7:32 am

Post by Snarboo »

Thanks, that helps! I was thinking along those same lines after studying the .qc files more.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

The ice-skating and related problems baffled me for a good while when I was starting out. The fact that playermodel animations and viewmodel animations are tied in some cases, but in other cases not, is some seriously bad design by id. It should be either or :P
I was once a Quake modder
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

I don't think so... Unless they had multi-part animations in their model format, or run+shoot animations, it makes perfect sense to me :)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

Sajt: consistency > weirdness!
I was once a Quake modder
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

If you're talking about how the nailgun animation frames are what shoot the bullets, I agree with you...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Post Reply