Half-Life

Half-Life

Not enough ratings
Alias's, Scripts, and Binds.
By Stu Pidaso
This is a brief guide explaining the differences between Alias's, Scripts, and Binds.
   
Award
Favorite
Favorited
Unfavorite
Alias's, Scripts, and Binds.
I am writing this tutorial to educate people on the creation and use of alias's scripts and binds. Many people think these things are cheats when in fact if they did not exsist, the game itself would not function properly. Please also note this tutorial is for information purposes only. What you do with this information is up to you. This is in no way condoning or condemning the use of scripts to have advantages over other players.

Alias's
An alias is simply a way to rename a command or multiple commands that can then be bound to a single key. A simple example would be as follows,

alias "fire1" "attack"

+attack is the default alias for your primary fire button which is usually bound to mouse1. Now after creating this alias you could do...

bind "mouse1" "+fire1"

...and would still act as the primary fire button on mouse1. You may also wonder about the + sign in front of these commands. What this does is tell the engine that when you release the button it needs to "release" or stop doing the command. Example of this would be if you were to...

bind "mouse1" "attack"

...without the + sign, pressing mouse1 would result in your weapon firing non stop even if you let go of mouse1.

This next example I'm going to show you how an alias can have multiple commands in it. Before I show the alias in its entirety though I will explain what each command does.

hud_viewdrawmodel 1

With the value for this set to "1" your weapon is diplayed, with it set to 0 your weapon is hidden.

r_drawhud 1

With the value for this set to 1 you can see your ammo, health, and armor information, with the value set to 0 it hides these things.

crosshairs 1

With the value set to 1 you can see your crosshairs, with it set to 0 it hides your crosshairs.

Now with this information we can write a script that allows us to take a screenshot with no weapons, crosshairs, or hud information.

// Clean screen shot
alias cleansnap "crosshair 0; r_drawviewmodel 0;hud_draw 0; wait4; snapshot; wait; r_drawviewmodel 1; crosshair 1;hud_draw 1"

Now we just bind it to a key like so...

bind "F5" "cleansnap"

Now when you press the F5 key it will take a screen shot with no weapon/crosshairs/hud showing.

You would take the above information and place into your userconfig.cfg file that should be located in your valve folder. If you do not have one, I have provided a link at the end of this tutorial that you can download one.

Another script I created was for reducing speaker volume while speaking. The reason I came up with this script is that when you use the mic in game, any action going on nearby such as explosions can come back through the mic making it very difficult to hear you speak.

// Background Sound Reducer
alias "+talk" "volume 0.1;+voicerecord"
alias "-talk" "volume 0.8;-voicerecord"

now bind the key you want to use to speak, in this case the default is "k"

bind "k" "+talk"

You will notice this time we used a + in front of the alias. This signifies that the "volume 0.1;+voicerecord" will be active as long as the bound key is held down. Once released, then it knows to do the - command which in this case is "volume 0.8;-voicerecord"

With this information you should be able to look at a list of console commands[stu-pidaso.net] and be able to write some of your own scripts/aliases. Here is a blank userconfig file if you do not have one. http://stu-pidaso.net/e107_files/downloads/userconfig.cfg

More of my tutorials can be found at http://stu-pidaso.net
4 Comments
GasL Apr 26, 2014 @ 4:22pm 
:)
Stu Pidaso  [author] Mar 8, 2013 @ 10:11pm 
Rainbow Dog, I understand. Phonetically in English it sounds like Stupid Asshole. It is a joke.
FULLFRANIUM puntero Mar 4, 2013 @ 2:45pm 
Stu Pidaso = Stupidaso. Stupidaso = Very Stupid in spanish :S.
BTW It deserver more rating!
Peace-Lights-2 Jan 25, 2013 @ 4:54pm 
wow ! feel so GOOD ! (^_^)