garrysmod-requests icon indicating copy to clipboard operation
garrysmod-requests copied to clipboard

add hl2 viewmodel sway

Open TotallyARussian opened this issue 7 years ago • 3 comments

i want hl2 weapon sway in gmod because it makes it alot natural and good looking

TotallyARussian avatar Dec 06 '17 08:12 TotallyARussian

This is purposefully replaced in multiplayer Valve games for interp reasons: https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/shared/predicted_viewmodel.cpp#L47-L71

I would also love this for GMod, but the baseviewmodel sway code may need some refining to work smoothly for spectators.

Kefta avatar Dec 09 '17 09:12 Kefta

This is possible to add because in hl2mp_player.cpp (For HL2MP Code) there is a function called CreateViewmodel. This creates the predicted_viewmodel ent that almost all Source MP Games use. Removing the function in the code removes the predicted_viewmodel ent. Therefore restoring the old HL2 viewmodel sway. The downside with this is when in Multiplayer the game speeds up the viewmodel sway a little bit but it shouldn't be a problem. Garry's Mod could've just added a convar so that way users have the ability to have the old viewmodel sway or the new one but I don't know if you can add a convar I tried but my attempts weren't successful.

lunar0724 avatar May 29 '18 15:05 lunar0724

You can always add this yourself with GM:CalcViewModelView or SWEP:GetViewModelPosition.

Kefta avatar May 29 '18 15:05 Kefta