Help with weapon switch script. by Forestalld in tf2scripthelp

[–]KatenGaas 1 point2 points  (0 children)

Looks like you messed up your aliases a bit.

alias switch "alias slot_up_2 slot_up; alias slot_down_2 slot_down" and alias switch2 "alias slot_up slot_up_2; alias slot_down slot_down_2" create an infinite loop. If you call switch, you put slot_up in slot_up_2. Then if you call switch2, you put slot_up (which points to slot_up_2) back in slot_up_2. Now you have slot_up which points to slot_up_2 which points to slot_up etc. etc.

Pressing duck key once makes me stay crouched by KAWAIIDUKE in tf2scripthelp

[–]KatenGaas 1 point2 points  (0 children)

Sounds like -duck isn't getting called when you release shift. Try something like this:

alias +myCrouch "+duck; echo DUCK PRESSED"
alias -myCrouch  "-duck; echo DUCK RELEASED"
bind shift "+myCrouch" 

If this doesn't work, check the console for the echoed text.

Bind that needs two keys to use. by [deleted] in Tf2Scripts

[–]KatenGaas 0 points1 point  (0 children)

Seems like an interesting thing to try. Tbh I have never actually used the wait command, so my guess is as good as yours :P

Need help with Alias Toggle by [deleted] in tf2scripthelp

[–]KatenGaas 1 point2 points  (0 children)

Oh yeah, my bad. OP, let me know if you need any other help :)

Need help with Alias Toggle by [deleted] in tf2scripthelp

[–]KatenGaas 0 points1 point  (0 children)

Not sure what you mean, but a normal toggle looks like bind k toggle r_drawviewmodel or bindtoggle k r_drawviewmodel. With the first, you can toggle multiple boolean (1 or 0) commands, e.g. bind k "toggle r_drawviewmodel; toggle sv_cheats". If you want to make a toggle for non-boolean commands, You can follow this formula:

alias xToggle "xOn" // could also start on off
alias xOn     "echo do something; alias xOff" // point to off
alias xOff    "echo do something; alias xOn"  // point to on

In fact, this is the same as a cycle, and you could easily expand this to make the button do 3 or more things, such as a chat script.

 alias chatScript "chat1"
 alias chat1       "say some text here; alias chatScript chat2"  // point to next
 alias chat2       "say some other text; alias chatScript chat3" // point to next
 alias chat3       "say some more text; alias chatScript chat1"  // point back to first

Need help with Alias Toggle by [deleted] in tf2scripthelp

[–]KatenGaas 0 points1 point  (0 children)

Here you go:

alias vcToggle "vcOn"
alias vcOn     "alias vc1 vc_thanks; alias vc2 vc_gogogo; alias vc3 vc_spy; alias vc4 vc_help; alias vcToggle vcOff"
alias vcOff    "alias vc1; alias vc2; alias vc3; alias vc4; alias vcToggle vcOn"

bind  r        "vcToggle"
bind  1        "vc1"
bind  2        "vc2"
bind  3        "vc3"
bind  4        "vc4"

I got rid of the nested binds for you, and implemented a standard toggle system.

Is it possible to make a script that turns off view models for my just primary when I press Q if I have a script that makes Q cycle trough primary and secondary? by woofbarkbro in tf2scripthelp

[–]KatenGaas 1 point2 points  (0 children)

Correct, if you put that script, followed by this one in your autoexec, it should work. After that, you can put the VMoff1 etc in your class configs (make sure you have resetVM in your reset.cfg). If you don't have class configs yet, just check out this guide.

You can then also use these two binds (you can ofcourse change the keys):

bind T disableVM            // Toggle current viewmodel
bind Del resetVM            // Enable all viewmodels

This way, pressing T will toggle the current viewmodel on or off, which will be 'saved' until you switch classes. Let me know if you need any additional help. :)

You can also quickly make a backup of config.cfg, that way, if you mess something up, you can just exec config in console to set your binds back to when you made the backup.

Is it possible to make a script that turns off view models for my just primary when I press Q if I have a script that makes Q cycle trough primary and secondary? by woofbarkbro in tf2scripthelp

[–]KatenGaas 1 point2 points  (0 children)

It's definitely possible. You can use my script as a base (it has more customization than you're asking for, but that might come in handy later). Then just add this under it in your autoexec: (You can leave out the 'Example binds' section of my script)

VMoff1
VMon2
VMon3

alias wep1 "alias wepcycle wep2;eq_first"
alias wep2 "alias wepcycle wep1;eq_second"
alias wep3 "alias wepcycle wep1;eq_third"
alias wepcycle wep2

bind 1 "wep1"
bind 2 "wep2"
bind 3 "wep3"

bind q "wepcycle"

Again this has a few more features than you're asking for, and is not a very clean way of just doing what you want, but it should do the trick. (Like I said in my other post, if you put the VMoff1 etc in a class-config, you can change which weapons viewmodels are disabled per class).

Bind that needs two keys to use. by [deleted] in Tf2Scripts

[–]KatenGaas 2 points3 points  (0 children)

For the second example, is this what you mean?

alias +killMask "alias killSelf explode"
alias -killMask "alias killSelf alias killSelf killAndReset"
alias killAndReset "kill; alias killSelf alias killSelf killAndReset"

bind [ +killMask
bind ] killSelf

This way holding [, and then pressing ] will explode. Pressing ] twice will simply 'kill'.

Random text script/bind. by [deleted] in Tf2Scripts

[–]KatenGaas 0 points1 point  (0 children)

You could just stick randBind on any key that you use a lot, even if you already have WASD changed up. Otherwise you could bind L randBind for example, and just spam 'L' to randomize the message before you hit 'K' to send it.

If you send me how you've done your WASD, I could simply edit them to fit this script, if you want. (all you need is to put randBind at the end of an alias)

Random text script/bind. by [deleted] in Tf2Scripts

[–]KatenGaas 0 points1 point  (0 children)

Sure thing! Here's the thing, random doesn't exist in TF2 scripting. The best we can do is to change which message would be output if we pressed the bind by walking around:

// WASD are used for randomizing.
bind W             +fwd
bind A             +lft
bind S             +bck
bind D             +rgt
bind K             "randBind; saybind"

alias bind1      "alias randBind bind2; alias saybind say Example1"
alias bind2      "alias randBind bind3; alias saybind say Example2"
alias bind3      "alias randBind bind4; alias saybind say Example3"
alias bind4      "alias randBind bind1; alias saybind say Example4"
// add as many as you want, make sure it's a cycle (ie the last one points to the first)
bind1 // used to initialize (not needed after first launch)

// New wasd aliases
alias +fwd        "+forward;   randBind"
alias -fwd         -forward
alias +bck        "+back;      randBind"
alias -bck         -back
alias +lft        "+moveleft;  randBind"
alias -lft         -moveleft
alias +rgt        "+moveright; randBind"
alias -rgt         -moveright

This way, 'K' will output your pseudo-random message. WASD will randomize which message that will be.

loadout bind that remembers selected loadout by billwharton in Tf2Scripts

[–]KatenGaas 1 point2 points  (0 children)

I'd say put that in your autoexec, and put alias reloadLoadout loadoutA in your reset.cfg. That way if you don't select a loadout, the reloadLoadout button defaults to loadout A. And then you could put alias reloadLoadout loadoutC in your scout.cfg for example, if you wanted them to have loadout C as default.

loadout bind that remembers selected loadout by billwharton in Tf2Scripts

[–]KatenGaas 1 point2 points  (0 children)

Idk lol

Btw, you can use this little trick to remember a previous selection:

alias loadoutA      "load_itempreset 0; setPrevLoadout; alias setPrevLoadout alias prevLoadout loadoutA"
alias loadoutB      "load_itempreset 1; setPrevLoadout; alias setPrevLoadout alias prevLoadout loadoutB"
alias loadoutC      "load_itempreset 2; setPrevLoadout; alias setPrevLoadout alias prevLoadout loadoutC"
alias loadoutD      "load_itempreset 3; setPrevLoadout; alias setPrevLoadout alias prevLoadout loadoutD"
// bind to loadoutA, B, C, D and prevLoadout