source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[TF2] Re-enable viewmodel sway convars

Open NachosChipeados opened this issue 10 months ago • 3 comments

  • Re-enables the convars cl_wpn_sway_interp and cl_wpn_sway_scale by:
    • Removing the FCVAR_DEVELOPMENTONLY and FCVAR_CHEAT flags from them.
    • Giving them the FCVAR_ARCHIVE flag.
    • Clamping their values.
    • Changing the default cl_wpn_sway_scale value.
  • Also fixes odd movement when using flipped viewmodels

Closes https://github.com/ValveSoftware/Source-1-Games/issues/2120

Showcase using a cl_wpn_sway_scale value of 2.5 (new default):

https://github.com/user-attachments/assets/ed20eef5-643d-4264-8026-d9f015ca66db

Old flipped viewmodels behavior (before fixes):

https://github.com/user-attachments/assets/12b7da19-1404-4b89-9c05-233201402fa5

New behavior

https://github.com/user-attachments/assets/cd253f65-395d-4963-bac8-569185629c52

Needed user_default.scr changes (as suggested by @TorutheRedFox):

"cl_wpn_sway_interp"
{
	"#TF_wpn_sway_interp_option"
	"#Tooltip_wpn_sway_interp_option"
	{ SLIDER 0 0.1 }
	{ "0" }
}

"cl_wpn_sway_scale"
{
	"#TF_wpn_sway_scale_option"
	"#Tooltip_wpn_sway_scale_option"
	{ SLIDER 0 5 }
	{ "2.5" }
}

NachosChipeados avatar Feb 23 '25 00:02 NachosChipeados

you should also add FCVAR_ARCHIVE so it persists, and something similar to the following should also be added to user_default.scr:

"cl_wpn_sway_interp"
{
	"#TF_wpn_sway_option"
	"#Tooltip_wpn_sway_option"
	{ SLIDER 0 0.1 }
	{ "0" }
}

TorutheRedFox avatar Feb 23 '25 02:02 TorutheRedFox

~~Note that theres currently some odd behavior when using flipped viewmodels with the sway convars. I'll see how i can fix that~~ Fixed.

NachosChipeados avatar Feb 24 '25 03:02 NachosChipeados

The flipped viewmodels bug has been fixed, so i'd say this is safe to merge now 👍

NachosChipeados avatar Feb 27 '25 00:02 NachosChipeados