News |  Maps |  Demos |  Servers |  Articles |  Manual |  Links

Custom Aliases

An alias allows you to reference a command or list of commands that execute complex actions with one keypress. Aliases are not required for playing EW, but they save time in the long run if you use the same command combinations frequently. To use an alias, it must either be bound to a key or mouse button, or you must type it directly in the console. Below is the syntax for creating an alias and binding keys.

Alias syntax: alias <name> <command>
Bind syntax: bind <key> <command>

First off let's look at the files we will be using. Open windows explorer and browse to your Eternal War folder. Open the ew subfolder which contains the config files. The ones we will be working with are:

autoexec.cfgEW automatically executes all commands, variables, and aliases in this config file, but does not modify or overwrite it.
config.cfgThis config file contains all the general settings for you like your name, mouse sensitivity, crosshair, plus many more options. This file is overwritten by EW each time you play.
default.cfgThis file contains the default settings that EW uses the first time you launch the application. Config.cfg is created from the data in this file.


Launch notepad and open autoexec.cfg. Displayed by default is:
Line 1: The double forward slash is a comment line that is not executed but placed in the file by the author for recalling why the following command(s) are typed. Comments are not required, but trying to remember the purpose of a complex piece of code can be a headache.
Line 2: A command is executed
Line 5: A command is executed
Line 8: An alias is created for the command impulse 9 (cheat that gives you all the weapons). This alias is one of the most basic. The command impulse 9 is given an alias wep. Type wep in the console, and the command impulse 9 is executed.
Lines 9-12: More simple aliases.


Now open up default.cfg which contains two more complex complicated aliases. Scroll through the file until you come to these lines:
Line 2: The alias zoom_in is created. Notice each command is separated by a semicolon. First, sensitivity is set to 2, then field of view (fov) is set to 90 (default), wait a moment, fov decreases (which simluates zooming in), wait, fov decreases, etc. Finally, the alias zoom_out is bound to F11.
Line 3: The alias zoom_out is created. It zooms back out.
Line 4: The alias zoom_in is bound to the F11 key.

To test it, launch EW, load a map and press F11. The zoom_in alias will execute and zoom in. If we look back at the last part of the zoom_in alias, we notice that as it finishes, it binds F11 to the zoom_out alias, so the next time we press F11, the zoom_out alias is executed.


Practially, this alias does not do us much good if it is bound to F11, especially if we are in the midst of a bunch of tenebs. Let's bind the aliases to a new key, and let's take it one step further. There are commands in EW that execute when a button is pressed, and do something else when you release the button. Attacking, for example. When you press your attack button to fire an arrow, it does so only until you release the button. The two commands associated with attack are +attack and -attack. These are built-in commands, not aliases, but they work similarly. Pressing the attack button executes +attack and releasing the button executes -attack. We can create an alias that zooms in when we press a button and zooms back out when we release it.
The aliases +myzoom and -myzoom are created, and +myzoom is bound to the c key. Now, the script needs to be saved somewhere. Copy it either into autoexec.cfg or create a new config file which can be linked from the autoexec.cfg file. If you simply want to paste it into autoexec.cfg, put it anywhere you want, save the file, launch EW, and try it out. I personally like putting all my custom aliases into a separate file. To do this, open notepad and paste the code in. Save the file into your ew subfoler with whatever name you would like. I'll call it anvil.cfg Now, open autoexec.cfg and paste the following code into the file. When EW launches, the autoexec file will launch everything in your custom config file.

Personally, I use mouse button 2 for toggling secondary attack mode, but a useful alias for this button is switching to a favorite weapon. This first bit of code simply switches to the weapon of choice (I like smite) and fires a single shot. Nothing too fancy. Of course, if you do not posess the weapon or are out of mana, then the current weapon will fire.
This second script is more complicated. It switches to smite, fires once, and returns to the previous weapon.

Finally, open config.cfg. Take a look through it and notice how commands are bound to keys and how this file is set up. As mentioned earlier, this file is overwritten by EW each time you play, so there is no use in editing anything here. If you want something to change, put it in the autoexec.cfg file, which in turn will cause the setting to change within the config.cfg. This file also shows a lot of other variables and commands that are not menu-accessible from within EW. This file does not really deal with aliases, but if you bound them to a key then they will show up here.

Overall, aliases can do quite a lot. It is up to you what to do with them.

The ANVIL


© 2010 The ANVIL  -  site hosted by XRUCIFIX
Contact - Purpose