Screen shake when shooting

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
Post Reply
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Screen shake when shooting

Post by JasonX »

Where can i change the value?
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

self.punchangle_x
i should not be here
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Post by JasonX »

By using this on, let's say, "i get hit", can i have the same effect?
lth
Posts: 144
Joined: Thu Nov 11, 2004 1:15 pm

Post by lth »

Yes. Punchangle is a field that is added to the player angles and gradually faded back to '0 0 0' by the engine. Very large punchangles look very silly since they can reveal bits of the viewmodel that are not supposed to be seen.

Also, you can't alter the rate punchangle fades back in QC (well... without re-implementing it in QC).
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

I'm wondering if the way it slowly fades punchangles back to '0 0 0' can be used to fade fog values from one to another...

perhaps, if (fog_r < desired_fog_r)
fog_r = fog_r +1
probably not how punchangles work, just going a bit off topic haha, sorry.
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
metlslime
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Post by metlslime »

blubswillrule wrote:I'm wondering if the way it slowly fades punchangles back to '0 0 0' can be used to fade fog values from one to another...

perhaps, if (fog_r < desired_fog_r)
fog_r = fog_r +1
probably not how punchangles work, just going a bit off topic haha, sorry.
That would be very framerate dependant.
necros
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Post by necros »

yeah, you'd want something more along the lines of
((endFogTime - currentTime) / fogDuration) * fogAmount to get a proper framerate independant fade.
Post Reply