r/tf2scripthelp • u/antishint • Oct 09 '14
Question Voice Commands
Making a medic script and I want to bind certain keys for voice commands, but I also want them to say stuff in team chat
This is what I have, but it wont work
bind "mouse2" "+attack2; say_team ">>> UBER OR KRITZ USED<<<""
Also have stuff like ...
bind "f" "voicemenu 0 0; say_team ">>> I HAVE UBER<<<"" bind "shift" "voicemenu 1 7; say_team ">>> FAKE CALL<<<""
Can anyone help me and tell me why they do not work if you could that would be great!
1
Upvotes
View all comments
Show parent comment
1
u/genemilder Scripter Oct 09 '14
It's tied into the way TF2 recognizes commands that are directly bound. Consider directly binding to a single + command/alias like this:
Pressing mouse2 activates
+attack2and releasing activates-attack2. When you have the bind only to+attack2like above, TF2 also recognizes the spectator command (when in spectator mode).Consider an alias bound like this:
You might think that this is the same as the above but it isn't; pressing mouse2 will activate
+attack2but releasing will do nothing because the + command is no longer directly bound. No spectator functionality is present for this version.Note that the automatic +/- press/release for directly bound + commands is only for the first in the list, so consider this example:
In this, pressing mouse2 activates
+attack2and+jump, but releasing only activates-attack2(and also+jumpagain for whatever reason).-jumpis never called. IIRC the spectator functionality works here. Because of this odd behavior you want to avoid adding anything extra to a direct bind that starts with a + command and instead make a new +/- alias as I did earlier.