Overview
Call upon any weapon you want and switch back to the previous one with a single keybind.
What is a “gravswap?”
In Half-Life 2, the “gravswap” command (default binding: G) allows you to instantly swap to the Gravity Gun, then back to the previous weapon with the same key. This lets you pull off some interesting maneuvers without having to fumble through the weapon select menu (i.e. tossing a grenade, then punting it with the Gravity Gun before it detonates.) With the help of a couple aliases, however, we can replicate this functionality for every weapon in the game. Let’s begin!
Setting up the .cfg files
Go to your Steam library, find Half-Life 2, then right-click > Manage > Browse Local Files. From there, go to the folder hl2 > cfg. Here, we will be making two files – autoexec.cfg and aliases.cfg.
Make a .txt file by right-clicking > New > Text Document, open it up, and type:
then go to File > Save As… > “autoexec.cfg”. The next time you launch Half-Life 2, the game will check for any commands in the autoexec and automatically execute them. Since we put “exec aliases.cfg” in the autoexec, it will look for and automatically execute any commands in that file as well.
Next, clear the contents of the text document and save it as “aliases.cfg”. Close Notepad, delete the blank .txt file, then open aliases.cfg in Notepad to edit it. From here, we have some choices to make – in particular, which weapons we want to be able to quickly swap to.
The WeaponSwap Format
For our WeaponSwap binds, we’ll be using the following format:
The way this works is as follows: when the key is pressed, weaponswap_on will swap to the chosen weapon, then rebind the key to weaponswap_off. When the key is pressed again, weaponswap_off brings up the previous weapon and rebinds the key to weaponswap_on, creating a working cycle between both binds.
Here’s a working example of the “MagnumSwap” config, bound to the “T” key:
With that explanation out of the way, here are the WeaponSwap configs for every weapon you get in the HL2 campaign (with the exception of the Gravity Gun and Bugbait, which use the gravswap and bug_swap commands respectively.) Just copy-paste whatever WeaponSwap you want to use into aliases.cfg, replace every <key> with whatever key you want it to be bound to, then save.
CrowbarSwap
PistolSwap
MagnumSwap
AR2Swap
ShotgunSwap
CrossbowSwap
FragSwap
RPGSwap
Conclusion
Thanks for reading this guide! If you tried the WeaponSwaps out and found the results to your liking, tell me in the comments which ones you got the most use/enjoyment out of.