Forum

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.

Moderator: InsideQC Admins

Screen shake when shooting

Postby JasonX » Sun Apr 10, 2011 7:24 pm

Where can i change the value?
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Postby leileilol » Sun Apr 10, 2011 9:53 pm

self.punchangle_x
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby JasonX » Mon Apr 11, 2011 1:59 am

By using this on, let's say, "i get hit", can i have the same effect?
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Postby lth » Mon May 02, 2011 7:39 am

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).
User avatar
lth
 
Posts: 144
Joined: Thu Nov 11, 2004 1:15 pm

Postby blubswillrule » Mon May 02, 2011 8:58 pm

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Postby metlslime » Mon May 02, 2011 10:20 pm

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.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby necros » Mon Jun 06, 2011 10:35 pm

yeah, you'd want something more along the lines of
((endFogTime - currentTime) / fogDuration) * fogAmount to get a proper framerate independant fade.
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest