r/tf2scripthelp • • Oct 21 '20

Resolved Shift+# for loadout binds

EDIT 2: thanks pdatumoj for his rework of my stuff

// Loadout Slots binds
alias "lip7"    "load_itempreset 0"
alias "lip8"    "load_itempreset 1"
alias "lip9"    "load_itempreset 2"
alias "lip0"    "load_itempreset 3"

alias "+flip70" "alias key7 lip7; alias key8 lip8; alias key9 lip9; alias key0 lip0"
alias "-flip70" "alias key7 slot7; alias key8 slot8; alias key9 slot9; alias key0 slot0"

bind 7          "key7"
bind 8          "key8"
bind 9          "key9"
bind 0          "key0"

bind shift      "+flip70"

EDIT: I GOT IT WORKING just needed aliases, if there is some better optimization i can do please tell

// Loadout Slots binds
alias set1 "load_itempreset 0";
alias set2 "load_itempreset 1";
alias set3 "load_itempreset 2";
alias set4 "load_itempreset 3";

alias +Loadout1 "bind 7 set1";
alias -Loadout1 "bind 7 slot7";
alias +Loadout2 "bind 8 set2";
alias -Loadout2 "bind 8 slot8";
alias +Loadout3 "bind 9 set3";
alias -Loadout3 "bind 9 slot9";
alias +Loadout4 "bind 0 set4";
alias -Loadout4 "bind 0 slot10";

bind shift "+Loadout1; +Loadout2; +Loadout3; +Loadout4";
alias +Loadout1 "bind 7 'load_itempreset 0'";
alias -Loadout1 "bind 7 slot7";
alias +Loadout2 "bind 8 'load_itempreset 1'";
alias -Loadout2 "bind 8 slot8";
alias +Loadout3 "bind 9 'load_itempreset 2'";
alias -Loadout3 "bind 9 slot9";
alias +Loadout4 "bind 0 'load_itempreset 3'";
alias -Loadout4 "bind 0 slot10";
bind shift "+Loadout1;+Loadout2;+Loadout3;+Loadout4";

This is what i have, its just in my autoexec, not really super into scripting so idk whats wrong. I have mastercomfig if it matters.

3 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/pdatumoj Oct 21 '20

I'm glad it works for you. :)

As for the binding topic, the biggest benefit is that it's easier to adjust one central set of binds than edit the binds that may be scattered through a script, so it makes maintenance simpler.

Also, personally, I prefer avoiding the rebinds as they cause the game to update its config store frequently, which is a bit on the heavy side.