Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

add hl2 viewmodel sway #1060

Open TotallyARussian opened 6 years ago

TotallyARussian commented 6 years ago

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

Kefta commented 6 years ago

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.

lunar0724 commented 6 years ago

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.

Kefta commented 6 years ago

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