forked from p2sr/srconfigs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewsnap.cfg
125 lines (106 loc) · 12.7 KB
/
viewsnap.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// For the sake of portability, this section is left in
// Anyone can use this config, not just the (superior) srconfigs users!
cond !?__srconfigs=1 sar_function __set_if_empty cond "?$1=?__empty" svar_set $1 "$2"
cond !?__srconfigs=1 sar_function __set_if_empty_persist "__set_if_empty $1 $'$2$'; svar_persist $1"
cond !?__srconfigs=1 sar_function +customsens "cond !?__customsens_on=1 svar_from_cvar __old_sens sensitivity; sensitivity $1; svar_set __customsens_on 1"
cond !?__srconfigs=1 sar_function -customsens "cond ?__customsens_on=1 $'sensitivity $__old_sens$'; svar_set __customsens_on 0"
cond !?__srconfigs=1 svar_from_cvar __old_sens sensitivity
cond !?__srconfigs=1 sar_function __tmp_cvar_save "cond ?__tmp_cvar_$1=?__empty svar_from_cvar __tmp_cvar_$1 $1"
cond !?__srconfigs=1 sar_function __tmp_cvar_restore "cond !?__tmp_cvar_$1=?__empty sar_expand $1 $$__tmp_cvar_$1; svar_set __tmp_cvar_$1 $'$'"
cond !?__srconfigs=1 sar_function svar_capture_quiet "__tmp_cvar_save sar_con_filter; __tmp_cvar_save sar_con_filter_default; sar_con_filter 1; sar_con_filter_default 0; svar_capture $'$1$' $'$2$'; __tmp_cvar_restore sar_con_filter; __tmp_cvar_restore sar_con_filter_default"
cond !?__srconfigs=1 sar_on_load conds "cm & !coop" "svar_set category sp_cm" "!cm & !coop" "svar_set category fullgame" "svar_set category unknown" // Take care when playing Any%
cond !?__srconfigs=1 sar_function cat_only cond "?category=$1" $+2
cond !?__srconfigs=1 sar_function non_cat_only cond "!?category=$1" $+2
cond !?__srconfigs=1 __set_if_empty_persist viewsnap_dpi_scale 500
cond !?__srconfigs=1 __set_if_empty_persist viewsnap_enable_on_load 0
cond !?__srconfigs=1 __set_if_empty_persist viewsnap_crazy_box easy
sar_function set_sens "+customsens $1; __tmp_cvar_save m_yaw; m_yaw $2; __tmp_cvar_save sar_dpi_scale; sar_dpi_scale $viewsnap_dpi_scale; __tmp_cvar_save m_rawinput; m_rawinput 1; cond %$#=3 sar_dpi_scale $3"
sar_function set_mini_sens "set_sens $+1; svar_from_cvar __tmp sensitivity; svar_fdiv __tmp __old_sens; svar_round __tmp; sar_expand sar_dpi_scale $$__tmp"
sar_function reset_sens "-customsens; __tmp_cvar_restore m_yaw; __tmp_cvar_restore sar_dpi_scale; __tmp_cvar_restore m_rawinput; __tmp_cvar_restore fps_max"
sar_on_exit reset_sens
sar_function sens_horiz_only "svar_set __tmp $__old_sens; svar_fmul __tmp 220; sar_expand set_sens 0.0001 $$__tmp 1"
sar_function sens_vert_only "set_sens $__old_sens 0 1"
// viewsnap <fromPitch> <fromYaw> <toPitch> <toYaw> [minisnap=0] [minisnap_size=2]
// This is the ultimate viewsnap command. The only thing it doesn't do is account for angle decay and Linux mouse bugs.
// For a visual explanation, go to https://www.desmos.com/calculator/wfmbenwboi.
sar_function viewsnap "svar_set __snapsv 1; svar_set __snapsh 1; svar_set __snap_dP $3; svar_fsub __snap_dP $1; svar_set __snap_dY $4; svar_fsub __snap_dY $2; svar_fadd __snap_dY 180; svar_fmod __snap_dY 360; svar_fsub __snap_dY 180; svar_set __snap_mini 0; less_than $# 5; cond ?less_than_ret=0 svar_set __snap_mini $5; cond ?__snap_mini=1 __viewsnap_h $6; __viewsnap_h2"
sar_function __viewsnap_h "cond ?__snap_dP=0 svar_set __snap_dP $__snap_dY; svar_set __tmp 2; cond %$#=1 svar_set __tmp $1; sar_expand svar_set __snapsv $$__snap_dP; svar_abs __snapsv; svar_fdiv __snapsv __tmp; svar_ceil __snapsv; svar_set __snapsh $__snap_dY; svar_fmul __snapsh __snapsv; svar_fdiv __snapsh __snap_dP; svar_abs __snapsh; svar_round __snapsh; sar_expand less_than $$__snapsh 1; cond ?less_than_ret=1 svar_set __snapsh 1"
sar_function __viewsnap_h2 "svar_set __tmp $__snap_dP; svar_abs __tmp; svar_fdiv __tmp __snapsv; svar_fdiv __tmp 0.022; sar_expand +customsens $$__tmp; svar_from_cvar __tmp sensitivity; svar_set __tmp2 $__snap_dY; svar_fdiv __tmp2 __snapsh; svar_fdiv __tmp2 __tmp; svar_abs __tmp2; __tmp_cvar_save m_yaw; sar_expand m_yaw $$__tmp2; __tmp_cvar_save sar_dpi_scale; __viewsnap_h3; __tmp_cvar_save m_rawinput; m_rawinput 1"
sar_function __viewsnap_h3 conds ?__snap_mini=1 "svar_fdiv __tmp __old_sens; svar_round __tmp; sar_expand sar_dpi_scale $$__tmp" "sar_dpi_scale $viewsnap_dpi_scale"
sar_function less_than "svar_set __tmp_less_than $'$1$'; svar_fsub __tmp_less_than $'$2$'; svar_fmul __tmp_less_than 0; conds ?__tmp_less_than=0 $'svar_set less_than_ret 0$' $'svar_set less_than_ret 1$'"
sar_on_load "sar_alias viewsnap_next __viewsnap_1; sar_function __viewsnap_1 nop; svar_set __viewsnap_on_load 1"
sar_alias __viewsnap_last "reset_sens; sar_alias viewsnap_next nop"
// TODO: viewsnap_prev, viewsnap_reset, toast viewsnap-info
// viewsnap-info should show steps i.e. "1 left 1 up, then [viewsnap_next]"
// Smooth Jazz
// https://discord.com/channels/146404426746167296/438528310394486787/1040899870216691732
sar_on_load cond "map=sp_a1_intro4" cat_only sp_cm svar_set __viewsnap_on_load 0
sar_on_load cond "map=sp_a1_intro4" cat_only sp_cm sar_function __viewsnap_1 "sens_horiz_only; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a1_intro4" cat_only sp_cm sar_function __viewsnap_2 "viewsnap 0 0 5.809 -66; sar_alias viewsnap_next __viewsnap_last"
// Secret Panel
// Linux users must simulate angle decay with 1 snap down first
// https://discord.com/channels/146404426746167296/438528310394486787/1023914463021248552
sar_on_load cond "linux & map=sp_a1_intro7" cat_only fullgame sar_function __viewsnap_1 "viewsnap 0 -180 0.003 -180 0; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "linux & map=sp_a1_intro7" cat_only fullgame sar_function __viewsnap_2 "viewsnap 0.003 -180 0.003 -169.22 1; sar_alias viewsnap_next __viewsnap_last"
sar_on_load cond "!linux & map=sp_a1_intro7" cat_only fullgame sar_function __viewsnap_1 "viewsnap 0.003 -180 0.003 -169.22 1; __tmp_cvar_save fps_max; fps_max 999; sar_alias viewsnap_next __viewsnap_last"
// https://discord.com/channels/146404426746167296/438528310394486787/1020436810721149020
sar_on_load cond "map=sp_a1_intro7" cat_only sp_cm sar_function __viewsnap_1 "viewsnap 0 -180 0 90 1; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a1_intro7" cat_only sp_cm sar_function __viewsnap_2 "viewsnap 89 90 0 90 0; sar_alias viewsnap_next __viewsnap_3"
sar_on_load cond "map=sp_a1_intro7" cat_only sp_cm sar_function __viewsnap_3 "viewsnap -75.568 27.976 4.5 64.2 0; sar_alias viewsnap_next __viewsnap_4"
sar_on_load cond "map=sp_a1_intro7" cat_only sp_cm sar_function __viewsnap_4 "viewsnap 4.5 64.2 -3.188 122.620 0; sar_alias viewsnap_next __viewsnap_last"
// Incinerator
// Modified from https://discord.com/channels/146404426746167296/438528310394486787/1052790978521604138
sar_on_load cond "map=sp_a2_intro" cat_only sp_cm sar_function __viewsnap_1 "svar_set __tmp 19.9751333333; svar_fdiv __tmp $__old_sens; svar_round __tmp; sar_expand set_sens 0.0001 4394.52933333 $$__tmp; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a2_intro" cat_only sp_cm sar_function __viewsnap_2 "viewsnap 7.152 0 -26.684160 36.996891; sar_alias viewsnap_next __viewsnap_last"
// Column Blocker
// TODO: Convert last two to `viewsnap` syntax
// https://discord.com/channels/146404426746167296/309475209839247370/1040802622585708595
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm svar_set __viewsnap_on_load 0
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_1 "viewsnap 0 90 32.472 90 ; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_2 "sens_horiz_only ; sar_alias viewsnap_next __viewsnap_3"
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_3 "viewsnap 32.472 90 72 -180 ; sar_alias viewsnap_next __viewsnap_4"
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_4 "viewsnap -89 -90 -21.2 -179.765 ; sar_alias viewsnap_next __viewsnap_5"
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_5 "set_sens 2581.8181818182 0.0347683108; sar_alias viewsnap_next __viewsnap_6"
sar_on_load cond "map=sp_a2_column_blocker" cat_only sp_cm sar_function __viewsnap_6 "set_sens 2068.1818181818 0.0515912088; sar_alias viewsnap_next __viewsnap_last"
// Turret Factory
// https://www.youtube.com/watch?v=5gZAIfzkwxQ
sar_on_load cond "map=sp_a2_bts3" cat_only sp_cm sar_function __viewsnap_1 "set_sens 1844 0.022; sar_alias viewsnap_next __viewsnap_last"
// Turret Sabotage
sar_on_load cond "map=sp_a2_bts4" svar_set __viewsnap_on_load 0
sar_on_load cond "map=sp_a2_bts4" sar_function __viewsnap_1 "viewsnap -89 0 -29.2 0; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a2_bts4" sar_function __viewsnap_2 "viewsnap -89 167.407 -0.011 167.407; sar_alias viewsnap_next __viewsnap_last"
// Repulsion Intro
sar_on_load cond "linux & map=sp_a3_jump_intro" cat_only fullgame sar_function __viewsnap_1 "viewsnap 0 -90 -19.9065 174.831 1; sar_alias viewsnap_next __viewsnap_last"
sar_on_load cond "!linux & map=sp_a3_jump_intro" cat_only fullgame sar_function __viewsnap_1 "viewsnap 0 -90 -19.9065 174.831 1; __tmp_cvar_save fps_max; fps_max 60; sar_alias viewsnap_next __viewsnap_last"
// Crazy Box
// TODO: Convert CM to `viewsnap` syntax
// https://www.youtube.com/watch?v=5gZAIfzkwxQ
sar_on_load cond "map=sp_a3_crazy_box" cond "?viewsnap_crazy_box=easy" cat_only fullgame sar_function __viewsnap_1 "viewsnap -89 -90 -58.448 -180; sar_alias viewsnap_next __viewsnap_last" // Easy version
sar_on_load cond "map=sp_a3_crazy_box" cond "?viewsnap_crazy_box=hard" cat_only fullgame sar_function __viewsnap_1 "viewsnap -89 -90 -58.380 -98.584 ; sar_alias viewsnap_next __viewsnap_2" // Harder version
sar_on_load cond "map=sp_a3_crazy_box" cond "?viewsnap_crazy_box=hard" cat_only fullgame sar_function __viewsnap_2 "viewsnap -58.380 -98.584 -58.380 -175.838; sar_alias viewsnap_next __viewsnap_last"
// https://discord.com/channels/146404426746167296/438528310394486787/1040713339959005245
sar_on_load cond "map=sp_a3_crazy_box" cat_only sp_cm sar_function __viewsnap_1 "set_sens 1100 0.022; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a3_crazy_box" cat_only sp_cm sar_function __viewsnap_2 "sens_horiz_only ; sar_alias viewsnap_next __viewsnap_3"
sar_on_load cond "map=sp_a3_crazy_box" cat_only sp_cm sar_function __viewsnap_3 "set_sens 3756.7318181818 0.0239569936; sar_alias viewsnap_next __viewsnap_last"
// Prop Intro
// https://www.youtube.com/watch?v=5gZAIfzkwxQ
sar_on_load cond "map=sp_a3_speed_ramp" sar_function __viewsnap_1 "viewsnap 0 -90 0 -86.721954 ; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a3_speed_ramp" sar_function __viewsnap_2 "viewsnap 0 -86.721954 -21.890005 -116.498955; sar_alias viewsnap_next __viewsnap_last"
// Prop Flings
// https://discord.com/channels/146404426746167296/438528310394486787/1030900985826115594
sar_on_load cond "map=sp_a3_speed_flings" cat_only sp_cm sar_function __viewsnap_1 "viewsnap 0 90 -2.882 47.342; sar_alias viewsnap_next __viewsnap_last"
// Conversion Intro
// TODO: Convert to `viewsnap` syntax
// https://discord.com/channels/146404426746167296/438528310394486787/1034207162957844551
sar_on_load cond "map=sp_a3_portal_intro" svar_set __viewsnap_on_load 0
sar_on_load cond "map=sp_a3_portal_intro" sar_function __viewsnap_1 "set_sens 5143.090909 0.01022750734 ; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=sp_a3_portal_intro" sar_function __viewsnap_2 "set_sens 5128.272727 0.00217500133 ; sar_alias viewsnap_next __viewsnap_3"
sar_on_load cond "map=sp_a3_portal_intro" sar_function __viewsnap_3 "set_sens 1754.590909 0.000589311577; sar_alias viewsnap_next __viewsnap_last"
// Industrial Fan
// Angles from https://discord.com/channels/146404426746167296/438528310394486787/1005822384282013706
sar_on_load cond "map=mp_coop_fan & !orange" non_cat_only solocoop sar_function __viewsnap_1 "viewsnap 0 -90 -8.068 48.002 ; __tmp_cvar_save fps_max; cond !linux fps_max 60; sar_alias viewsnap_next __viewsnap_last"
sar_on_load cond "map=mp_coop_fan & orange" non_cat_only solocoop sar_function __viewsnap_1 "viewsnap 0 -90 26.371 -97.471; __tmp_cvar_save fps_max; cond !linux fps_max 60; sar_alias viewsnap_next __viewsnap_last"
sar_on_load cond "map=mp_coop_fan" cat_only solocoop sar_function __viewsnap_1 "viewsnap 0 -90 -8.068 48.002 ; __tmp_cvar_save fps_max; cond !linux fps_max 60; sar_alias viewsnap_next __viewsnap_2"
sar_on_load cond "map=mp_coop_fan" cat_only solocoop sar_function __viewsnap_2 "viewsnap 0 -90 26.371 -97.471; __tmp_cvar_save fps_max; cond !linux fps_max 60; sar_alias viewsnap_next __viewsnap_last"
// Changing sensitivity on load is banned outside of CM!
sar_on_load cond "?viewsnap_enable_on_load=1 & ?__viewsnap_on_load=1 & (?category=sp_cm | ?category=coop_cm)" "viewsnap_next"