r/tf2scripthelp • u/SergioSource • Jan 24 '15
Answered Medic script - text messages for individual mediguns
SOLVED
My medic.cfg is slightly large, but these are the areas I'm having a slight trouble with:
alias +uber "dropitem; medigun; +attack2;voicemenu 2 5; activated"
alias -uber "-attack2"
alias usinguber "load_itempreset 0; say_team USING UBER; bind "MOUSE2" "+uber""
alias ubertext "bind "MOUSE2" "+uber; say_team UBER POPPED;""
alias usingkritz "load_itempreset 1; say_team USING KRITZ; bind "MOUSE2" "+uber""
alias kritztext "bind "MOUSE2" "+uber; say_team KRITZ POPPED;""
alias usingquick "load_itempreset 2; say_team USING QUICKFIX; bind "MOUSE2" "+uber""
alias quicktext "bind "MOUSE2" "+uber; say_team QUICKFIX POPPED;""
alias usingvac "load_itempreset 3; say_team USING VACCINATOR; bind "MOUSE2" "+uber""
alias vactext "bind "MOUSE2" "+uber; say_team Resist Used;""
bind "KP_END" "usinguber; ubertext;"
bind "KP_DOWNARROW" "usingkritz; kritztext;"
bind "KP_PGDN" "usingquick; quicktext;"
bind "KP_LEFTARROW" "usingvac; vactext;"
I want to make it so that when I right click, I output a team message corresponding to the medigun I'm using. I usually only have it say "CHARGE POPPED" as I never found a workaround it, until now. So I came here for help.
--- EDIT -- SOLVED
alias +uber "dropitem; medigun; +attack2;voicemenu 2 5; ubertext"
alias -uber "-attack2"
bind MOUSE2 +uber
alias usinguber "load_itempreset 0; say_team USING UBER; alias ubertext say_team UBER POPPED"
alias usingkritz "load_itempreset 1; say_team USING KRITZ; alias ubertext say_team KRITZ POPPED"
alias usingquick "load_itempreset 2; say_team USING QUICKFIX; alias ubertext say_team QUICKFIX POPPED"
alias usingvac "load_itempreset 3; say_team USING VACCINATOR; alias ubertext say_team Resist Used!"
cl_autoreload 1;
r_drawviewmodel 1;
bind "1" "slot1;r_drawviewmodel 1"
bind "2" "slot2;r_drawviewmodel 0"
bind "3" "slot3;r_drawviewmodel 1"
bind "4" "slot4;r_drawviewmodel 1"
bind "5" "slot5;r_drawviewmodel 1"
bind "KP_END" "usinguber"
bind "KP_DOWNARROW" "usingkritz"
bind "KP_PGDN" "usingquick"
bind "KP_LEFTARROW" "usingvac"
bind "MOUSE1" "+attack"
1
Upvotes
3
u/DeltaTroopa Jan 24 '15
In addition to the nested quotes /u/clovervidia mentioned I notice you're unnecessarily rebinding mouse2 a lot. I would change that so that you have it just bound to 1 thing, for example
then add in ubertext to
+uber(not sure what activated is as its not defined like covervidia said but I left it in)
and then just redefine what ubertext says when you change loadouts e.g.
2
u/clovervidia Batman Jan 24 '15 edited Jan 24 '15
You're using nested quotes. I'm 110% sure that's the reason this is breaking.
Compare that with this:
You see, you really never need to use multiple quotes, not even with a
sayorsay_team. And especially not with a bind/alias within another bind/alias.If you see what I'm saying, try removing the quotes as I demonstrated and try it ingame. I'm sure it'll work.
Also, what is
activateddefined as? I don't see it here.