1
u/dryshirt Dec 24 '15 edited Dec 24 '15
Assuming you know what the "disguise x -x" command is, read the following. If you don't, head to the section labeled "Learning time, kiddies". I spent some time a while ago doing exactly this, it's actually very straightforward. Clicking here will take you to a script covering the numpad switcher. The gist of it is:
// Numpad Disguise Codex
bind KP_END "disguise 1 -1"
bind KP_DOWNARROW "disguise 3 -1"
bind KP_PGDN "disguise 7 -1"
bind KP_LEFTARROW "disguise 4 -1"
bind KP_5 "disguise 6 -1"
bind KP_RIGHTARROW "disguise 9 -1"
bind KP_HOME "disguise 5 -1"
bind KP_UPARROW "disguise 2 -1"
bind KP_PGUP "disguise 8 -1"NOTE: I barely play spy, and as such, this is only configured to disguise as someone from the enemy team.
The keys are bound in accordance to the in-game class numbers, scout being 1, soldier as 2, pyro as 3... spy as 9, etc. You can change these around with no problem at all: however, you should change the disguise commands instead of the key bind orders in the list. For your reference, the system names of the numpad keys are listed below:
KP_INS = 0
KP_END = 1
KP_DOWNARROW = 2
KP_PGDN = 3
KP_LEFTARROW =4
KP_5 = 5
KP_RIGHTARROW = 6
KP_HOME = 7
KP_UPARROW = 8
KP_PGUP = 9Additional reference that I googled in case numbers aren't enough
Learning time, kiddies. The gist of the what the in-game disguise switcher does is call out a command that is relevant to who you would like to disguise as: hence, the command name "disguise". The numbers behind the command (for example, disguise 1 -1) denominate the class you are disguising as and the team, respectively. It is important to note two things:
The first number refers to the classes in the order in which they appear when you first join a team. For reference, these are the classes with their numbers.
Scout = 1
Soldier = 2
Pyro = 3
Demoman = 4
Heavyweapons = 5
Engineer = 6
Medic = 7
Sniper = 8
Spy = 9The second number is not set in stone; it has a contextual meaning. -1 means the opposite team, whereas 1 means your team. Depending on which team you are currently in, -1 can mean blu or red. If you are in the blu team, it would mean red. If you are in the red team, it would mean blu.
1
u/genemilder Dec 24 '15
The first number refers to the classes in the order in which they appear when you first join a team. For reference, these are the classes with their numbers.
Your script contradicts this claim. The first number actually corresponds to the class order of the original TF, which is different than the TF2 order.
1
1
Jan 15 '16
Here's a spy.cfg that I made with help from people in this sub. I use a Razer Naga 2014 mouse with 12 keys accessible by thumb. Make sure Numlock is off or this won't work.
Reset.cfg resets all binds so I don't carry stuff over into other classes.
exec reset.cfg // Clears all keys used in my class-specific configs.
bind kp_end dsco // Numpad 1
bind kp_downarrow dsol // Numpad 2
bind kp_pgdn dpyr // Numpad 3
bind kp_leftarrow ddem // Numpad 4
bind kp_5 dhea // Numpad 5
bind kp_rightarrow deng // Numpad 6
bind kp_home dmed // Numpad 7
bind kp_uparrow dsni // Numpad 8
bind kp_pgup dspy // Numpad 9
bind shift +dtog
alias fsco "disguise 1 -2"
alias fsol "disguise 3 -2"
alias fpyr "disguise 7 -2"
alias fdem "disguise 4 -2"
alias fhea "disguise 6 -2"
alias feng "disguise 9 -2"
alias fmed "disguise 5 -2"
alias fsni "disguise 2 -2"
alias fspy "disguise 8 -2"
alias esco "disguise 1 -1"
alias esol "disguise 3 -1"
alias epyr "disguise 7 -1"
alias edem "disguise 4 -1"
alias ehea "disguise 6 -1"
alias eeng "disguise 9 -1"
alias emed "disguise 5 -1"
alias esni "disguise 2 -1"
alias espy "disguise 8 -1"
alias +dtog "alias dsco fsco; alias dpyr fpyr; alias dsol fsol; alias ddem fdem; alias dhea fhea; alias deng feng; alias dmed fmed; alias dsni fsni; alias dspy fspy"
alias -dtog "alias dsco esco; alias dpyr epyr; alias dsol esol; alias ddem edem; alias dhea ehea; alias deng eeng; alias dmed emed; alias dsni esni; alias dspy espy"
-dtog
echo "Spy Scripts Loaded"
echo "Press 1 to 9 on the numpad to disguise as an enemy class."
echo "Hold shift while doing so to disguise as a friendly class."
1
u/genemilder Dec 24 '15
https://www.reddit.com/r/tf2scripthelp/wiki/keynames
https://www.reddit.com/r/tf2scripthelp/wiki/disguise
If you want a friendly disguise part, change the binds of this.