Team Fortress Classic | Configs | Basics of Aliases

Team Fortress Classic Configs: Basics of Aliases

Welcome to 'alias', using this command you can create complex binds. The basic syntax for aliases is:

alias name "command"
bind x "name"

Just looking at this, it is pretty similar to the bind command. You can do advance binding with the alias. For example you can bind keys, you can create binds that will do one command when you press a button and do another when you release the key. You can also hit one button and keep doing that command until you hit it again. Here is an example:

alias swim "+moveup;wait;bind x swim2"
alias swim2 "-movedup;wait;bind x swim"

bind x "swim"

The above bind maybe something you would use in a water level; this will keep you floating on the surface. I used the 'wait' command to insert a pause before the next command. Some may argue that you do not need it, but I like to insert it in-between commands for safety reasons.

Aliases can be used like an action, meaning you can use the + and - in a bind. Here is an example:

alias +smalljump "+jump;wait;+duck"
alias -smalljump "-jump;wait;+duck"

bind x +smalljump

Now when you hit 'x' you will jump and duck at the same time, when you release it you will stop.

Aliases can be used to organize your configs; they also can make life much better. If you take a look at the following script, I made the mouse wheel cycle through the weapons for the spy.

//Weapon Select
alias part1 "tf_weapon_supershotgun;wait;bind mwheelup part2"
alias part2 "tf_weapon_ng;wait;bind mwheelup part3"
alias part3 "tf_weapon_knife;wait;bind mwheelup part7"
alias part7 "tf_weapon_tranq;wait;bind mwheelup part1"

bind mwheelup "part1"
So, how else are aliases functional? In a plethora of different ways. I won't even try to give you an idea, just check out a few of the examples we have here:

Say you wanted to have ALT and Function keys preform a specific task, you would go for something like this.

First, remember that many of the alt+F# keys are windows hot keys that may do weird things when you use them in combination. In other words, be careful, and DON'T bind anything to ALT+F4 unless you have some way of overriding those default hotkeys (I don't know how to do it, but I think there are some programs that do). Now that that's done, here's how it works:
alias +switch "bind F1 command;bind F2 command;bind F3 command;bind F5 command"

alias -switch "bind F1 othercommand;bind F2 othercommand;bind F3 othercommand;bind F5 othercommand"

bind ALT +switch
Basically, when you press down on the ALT key, it will rebind the F1, F2, F3, and F5 keys to whatever you put in command, when you release the ALT key it will bind the F keys to othercommand. You can do this with any keys you like (which may help avoid problems like ALT+TAB and ALT+F4 by using Z or some other key as your switch).

Next up, we look at the 'standard' set of Aliases most players will have some interest in.




IGN.com | GameSpy | Comrade | Arena | FilePlanet | GameSpy Technology
TeamXbox | Planets | Vaults | VE3D | CheatsCodesGuides | GameStats | GamerMetrics
AskMen.com | Rotten Tomatoes | Direct2Drive | Green Pixels
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2009, IGN Entertainment, Inc.   About Us | Support | Advertise | Privacy Policy | User Agreement Subscribe to RSS Feeds RSS Feeds
IGN's enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.