AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TF2/L4D*/?] [SNIPPET] Smoothly turning players (https://forums.alliedmods.net/showthread.php?t=311177)

Phil25 10-06-2018 14:20

[TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
I've found that view punch works really well with rotating the player because of its instant effect and smoothing towards the actual player view.

Applying it in the other direction, on the same frame, produces smooth turning effect with a little bit of wobbling at the end if the angle is wide enough. This only works in first person, other players just see the client spazzing about.

PHP Code:

stock void RotateClientSmooth(int clientfloat fAngle){
    
float fPunch[3], fEyeAng[3];
    
GetClientEyeAngles(clientfEyeAng);

    
fEyeAng[1] -= fAngle;
    
fPunch[1] += fAngle;

    
TeleportEntity(clientNULL_VECTORfEyeAngNULL_VECTOR);
    
SetEntPropVector(clientProp_Send"m_vecPunchAngle"fPunch);


PHP Code:

RotateClientSmooth(client30.0); // turns client 30 degrees to right 

I don't know if m_vecPunchAngle is available for mods other than TF2.

Psyk0tik 10-06-2018 15:13

Re: [TF2/?] [SNIPPET] Smoothly turning players
 
That netprop is available for L4D/L4D2 as well, so this stock will work for the L4D series.



Thanks btw! :D

Edit: This may be off-topic but I found that out by using your code for the Strong Recoil perk from your RTD plugin in a test plugin, which I tested in both L4D games. :)

Phil25 10-07-2018 01:08

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Very nice to hear it works in other mods! I imagine if the netprop was already present in OB, it has to be present in every Source game because of its broad usage, but can't be bothered to check. :p

Speaking of RTD, that method is used in the upcoming perk Drunk Walk, I bet that can be ported to L4D as well then. :D

Psyk0tik 10-07-2018 03:26

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Quote:

Originally Posted by Phil25 (Post 2618624)
Very nice to hear it works in other mods! I imagine if the netprop was already present in OB, it has to be present in every Source game because of its broad usage, but can't be bothered to check. :p

Speaking of RTD, that method is used in the upcoming perk Drunk Walk, I bet that can be ported to L4D as well then. :D

Yeah I just tried the stock in L4D2 and it works just fine. I was wondering if there's a way to increase the speed, because I have this idea to make the player spin around really fast so they can't aim. (I can be evil too :P)

ThatKidWhoGames 10-09-2018 08:32

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Thanks for this!!

404UserNotFound 10-16-2018 15:50

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Did....did Phil reply to himself as if he was a completely different person? Or is there a deleted post that I didn't see in between his two posts?

Psyk0tik 10-16-2018 15:58

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Quote:

Originally Posted by 404UNF (Post 2619972)
Did....did Phil reply to himself as if he was a completely different person? Or is there a deleted post that I didn't see in between his two posts?

He replied to me, and no I didn't delete my post.

404UserNotFound 10-16-2018 19:22

Re: [TF2/L4D*/?] [SNIPPET] Smoothly turning players
 
Quote:

Originally Posted by Crasher_3637 (Post 2619975)
He replied to me, and no I didn't delete my post.

That is weird because I didn't see the post on my lapt-...oh. I must've blocked an element of the forums with uBlock Origin which also affects the 1st reply of a thread being visible. Shit.

IGNORE ME!!!


All times are GMT -4. The time now is 20:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.