Alias scripting
READ ALL OTHERWISE NONE OF IT WILL WORK!!
Intro
Firstly I will cover the basis behind alias scripts. Alias Scripting is a method of programming basic commands for the use in Half-Life, Half-Life Deathmatch etc. All the newest generation Steam products. (I am not sure if the old Half Life has the alias scripting capability but after reading this little beginners guide I am sure you could try yourself.
Syntax (Layout)
Aliasing is the running of commands in a set string. Half-Life Deathmatch allows you to set alias's and run them when assigned to a key or another alias etc. 1 alias may run many alias's if it is needed to, 1 alias may have many functions. I believe that layout of the alias's are rather a significant part of creating the alias. You need 2 know how 2 store them and how 2 store them so that the running of the script is speedy.
The 1st and most easy to implement in my personal opinion is the bunny jump script. With this script implemented and used correctly, you can jump efficiently and with the speed of a sprint while using very little AUX POWER. Because it is all computer controlled it is very hard 2 use this script wrong. I have found that by the time you land on the floor your AUX POWER had recharged to full again. so all you need 2 do is keep pressing space to run fast while jumping.
The Code
File: alias.cfg
Declared In: config.cfg
Alias Name: +bunnyjump
Bind: bind "SPACE" "+bunnyjump"
Use: Fast Efficent Running, Bunny Jumping
alias.cfg contains:
alias "+bunnyjump" "+speed;wait;wait;wait;wait;wait;-speed;+jump;wait;wait;+duck"
alias "-bunnyjump" "-jump;-duck"
(The +bunnyjump means when the key is pressed and the -bunnyjump is when it is released)
Ok let me run through the procedure of how it works first to give you the best understanding of the alias.
This code will lie in a file that is on your computer in the steam folder of your computer.
The location of which is as follows.
C:\Program Files\Steam\steamapps\{Steam id Name}\half-life 2 deathmatch\hl2mp\cfg
If it isn't here then you know enough to be able to find the folder.
As you can see in this folder there is a file called config.cfg, this file contains all the configuration data for your personal account on Half-Life Deathmatch. If this information is changed then the game is changed. Normally this file contains information on Key Binds and Mouse sensitivity etc.
Implementation
To implement this code. The above code can either be copied straight into the config.cfg file (If your conputer cant open the file, double click on it and open it with Wordpad, try not to use notepad as it can mess up the layout of the file its self), or it can be copied into a new file (which is my personal liking) in my case it is called alias.cfg. To create this file just copy the config.cfg then rename it to alias.cfg then fill it with the code that you need to fill it with.
If you choose the second method then you will need to state that this file exists in the config.cfg. To do this, all that you need to do is type in exec alias.cfg at the top of the config.cfg file. I shall provide examples with this article.
After the declaration has been done we then need to assign it to a key. This is done with a simple key bind in the config.cfg file. For use with the bunnyjump alias, personally I assigned it to the space bar so everytime i jump it runs the alias. This is done as follows.
bind "SPACE" "+bunnyjump"
That code will simply assign the space key to the bunnyjump alias.
Other Code Designs
ZoomFire Alias.
This is a great alias that I created based on the idea on a none delay sniper weapon. normally used with the Magnum pistol, although can be used with the pistol with great success if aimed correctly.
File: alias.cfg
Declared In: config.cfg
Alias Name: +zoomfire
Bind: bind "z" "+zoomfire"
Use: Effective Sniper Scope for Standard Weapons
alias.cfg contains:
alias.cfg
alias "+zoomfire" "+zoom"
alias "-zoomfire" "-zoom;+attack;wait2;-attack"
config.cfg
bind "z" "+zoomfire"
Added Functionality
The ability to change weapon to the magnum for example just add the following code. I shall leave it to you to guess where the code lies
use weapon_357
That bit of code will change your current weapon to a magnum.
wait.cfg
Personally I added a file called wait.cfg and this contains a very simple binary based wait system. The command wait in hl2dm pauses all input for 1 frame of operation. This can be a very useful tool for designing scripts. My wait file contains the following and is declared in the alias file as exec wait.cfg
File: wait.cfg
Declared In: alias.cfg
Alias Name: N/A
Bind: N/A
Use: To declare wait periods
wait.cfg contains:
alias wait2 "wait;wait"
alias wait4 "wait2;wait2"
alias wait8 "wait4;wait4"
alias wait16 "wait8;wait8"
alias wait32 "wait16;wait16"
alias wait64 "wait32;wait32"
alias wait128 "wait64;wait64"
alias wait256 "wait128;wait128"
alias wait512 "wait256;wait256"
Easy enough to understand I think. If you wish to use this method (which i highly recommend, and after implementatiopn is a very powerful tool for creating alias's) then it makes coding a lot easier because for example on the bunnyjump instead of having loads of waits you can compress them into wait8 for example which will run the sprint operation for 8 frames, just enough time to actually get sprinting (i actually think it is around 4-6 frames), which also improves on the operational speed of the whole procedure.
Other Ideas
Automatic Greande Cooking
It has been attempted by my self and actually works but not to the effect that it can be done effiecently. I have approached this in several ways. E.g. fully automated (timing included) and semi auto which does all the operations up to the timing so self timing is needed. As this alias is a closely guarded secret of my own I shall share what I know :P
File: alias.cfg
Declared In: config.cfg
Alias Name: +fragtotal
Bind: bind "chosenKey" "+fragtotal"
Use: Grenade Cooking
alias.cfg contains:
alias "fragthrow" "use weapon_frag;+attack2;wait128;wait32;-attack2;wait32;wait16"
alias "+catchnade" "use weapon_physcannon;+attack2"
alias "-catchnade" "-attack2;wait2;+attack;wait2;-attack;wait2;slot3;"
alias "+fragtotal" "fragthrow;+catchnade"
alias "-fragtotal" "-catchnade"
The reason why I do not like this procedure (as a whole) is that it involves far to much waiting and in that waiting period your FPS can change effecting the whole operation. And during that wait period no operations can be carried out, even the mouse cant be moved. Although this is being tested so that less waits are needed.
Stupid alias's
File: flashlight.cfg
Declared In: alias.cfg
Alias Name: Flashlight Mega Party
Use: To lag your computer while flashing your flashlight 2056 times
Bind: bind "/" "fldmegaparty"
flashlight.cfg contains:
alias fld2 "impulse 100;wait4;impulse 100;wait4"
alias fld4 "fld2;fld2"
alias fld8 "fld4;fld4"
alias fld16 "fld8;fld8"
alias fld32 "fld16;fld16"
alias fld64 "fld32;fld32"
alias fld128 "fld64;fld64"
alias fld256 "fld128;fld128"
alias fld512 "fld256;fld256"
alias fld1028 "fld512;fld512"
alias fldmegaparty "fld1028;fld1028"
(impulse 100 is a flashlight operation).
IMPORTANT!!
Finally one more thing. If you wish any of this to work. you must set your config.cfg to a read only file. If this isn't done then when half life starts up it removes the exec alias.cfg therefore rendering all your work useless
This tutorial was send in by Simon, aka WolVriNe, thx!
|