Quake
Not enough ratings
[2021 Re-release] Binds & Aliases
By JPiolho
A guide that explains binds and aliases in the quake rerelease 2021
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide will explain binds & aliases to you. If you already know about them from old quake, you should read this guide to understand the differences and new things in the re-release.
Binds
In Quake you can assign commands to keys. This is how the game knows what to do when you press W to move forward, or left mouse button to shoot. Usually you do these simple binds via the Options menu.

However the binding system is way more advanced and you can actually assign multiple commands to the same key, changing console variables or even create advanced command logic with aliases.

Creating a bind
The console commands you use to do this is:
bind <key> "<command>"

As an example, if you wanted to bind the key M to flash the screen every time you pressed it you'd do the following:
bind m "bf"

The command above means that it's binding the key M to the command bf.
(Extra: Try typing bf into the console and you'll see the screen flash!)

View binds assigned to a key
It's very important to know what a certain key is doing. You can use the following console command to do this:
bind <key>

If you're following the examples, then let's see what's assigned to the key M
bind m

Remove bind(s) from a key
Unlike old quake, the quake rerelease supports multiple binds to the same key. So it's very important to unbind the old command if you want to replace it with a new one.

You can do this with the following console command:
unbind <key> "<command>"

If you want to remove ALL binds from a key then use the following command:
unbindkey <key>

As an example, let's remove the command bf from the key M:
unbind m "bf"

Bind console variables
Just like you can assign a command, you can also change console variables.

Say you wanted to bind key M to remove the HUD:
bind m "cl_hud 0"

Multiple commands in a single bind
One way of doing is just assign multiple binds to the same key, however you can also just assign 1 bind with multiple commands. All you have to do is separate the commands with a semi-colon ;

Example:
bind m "bf;echo hello"

Quotes inside quotes
If for some reason you need to put a quote inside quotes, you can do that by typing \"

Example (Although keep in mind that this command would also work without inner quotes):
bind m "bf;echo \"hello world\""
Helper commands
The re-release includes a bunch of helper commands which can help you doing binds:

echo
echo is a simple command which just prints something back to your console. You can use it as feedback or to troubleshoot things

Example that will print something to your console:
echo "Hello world!"

toggle
toggle helps you toggle console variables between 0 and 1 or a specific range.

The following example shows or hides the crosshair:
toggle cl_skipCrosshair

The following example cycles all the values for cl_hud:
toggle cl_hud 0 1 2 3

It can also work for text! The following example cycles the crosshair style:
toggle crosshairStyle "+" "-" "x" "*"

seta
The purpose of this command is unknown, but the official config uses it. Currently we think that it just sets console variables faster

seta <cvar> <value>

wait
If you played quake before, you might know about the wait command.

This command does nothing in the re-release, so don't use it
Aliases
Aliases is a way of creating a named command that executes other commands. This alias can then be bound to a key or just typed directly in the console.

Creating an alias
You can use the following console command:
alias <name> "<commands>"

Perhaps the easier way is to show an example. Say you wanted to create a command that flashes the screen and switches to the axe at the same time:
alias axeflash "bf;impulse 1"

And now you can just type axeflash in the console and it'll execute the commands you specified. You can also just bind it to a key.

Listing existing aliases
The following command will show you a list of all the aliases that have been defined:
alias

Remove an alias
If you want to remove/delete an alias, you can use the following command:
unalias <name>

Example:
unalias axeflash

Remove ALL aliases
If you need a clean slate, you can type:
clearalias
Advanced binds/aliases
Quake includes some advanced features for binds and aliases like executing when different commands when a key is pressed and released.

If you already know about + and - from old Quake, they don't work so well with re-release, so please read on

Executing command when you press the key and when you release the key
By adding the character * before the name of an alias while doing a bind, you can make it execute that alias when you press the key down and again when you release the key.

Example, flash screen when you press and release the key M:
bind m "*bf"

Same example but with an alias:
alias flashscreen "bf" bind m "*flashscreen"

Execute a different command on key down and on key release
With some trickery you can achieve this. The way you do it is by having 3 different aliases.

You have your main alias, lets say myalias. Then you have 2 other aliases with a different name, but for simplicity sakes lets call them myalias_down and myalias_up.

Then at the end of myalias_down and myalias_up you re-define myalias so that the next execution is the opposite of down/up.

Perhaps it's easier with an example. Let's create an alias that when you press the key down switches to the axe and when you release, it flashes the screen. Then bind it to the key M
alias myalias myalias_down alias myalias_down "impulse 1;alias myalias myalias_up" alias myalias_up "bf;alias myalias myalias_down" bind m "*myalias"

What about this + and -?
In the original quake it was easier to do a different command on down and up by using + for key down and - for key up.

HOWEVER in the re-release this is slightly broken and need a work-around

Using the same example as before but with + and -:
alias +myalias "impulse 1" alias -myalias "bf" bind m "+myalias"

If you execute this example and press the key M you'll see that everything works fine.
Originally posted by you:
BUT YOU SAID THAT IT DOESN'T WORK
Correct. If you try to press again, you'll see that it doesn't work anymore. The reason for it, is that now the bind for the key M is -myalias. You'd need to reset the bind to +myalias to get it to work again.

One way you get it to work in the re-release is by changing the way you bind it to the key:
bind m "bind m +myalias;unbind m -myalias"

There's pros and cons for using this method versus the * star one.
I personally would not recommend this as it's less readable and it can get complex to change the binds, especially if you have multiple commands in the same bind.
Input commands
There's some special commands that only appear to work properly when placed in a bind.

These commands are usually prefixed by in_ and menu_. You can use them outside binds and also inside aliases, but you need to take special care of them.

By sending a number after you can control weather they're pressed or released: 0 = pressed, 1 = not pressed.

For example say you want the gun to fire only once:
in_attack 0;in_attack 1

If you were to type in_attack without any number then you'll be firing forever as if you're pressing the key.

Using them inside aliases
If you want to, for example attack, inside an alias. You need to make sure you set the input to 0 when you press down and 1 when you release.

Example of having an attack alias that also flashes the screen:
alias myattack myattack_down alias myattack_down "in_attack 0;bf;alias myattack myattack_up" alias myattack_up "in_attack 1;bf;alias myattack myattack_down" bind m "*myattack"
List of keys
There's a lot of keys you can use for binds. Here's a list of all the keys available in the game: https://quakeqe.com/wiki/index.php/List_of_keys
2 Comments
SG 7 Feb, 2023 @ 11:45am 
Need more examples. How to make this in Kex:
alias +axe "impulse 1;+attack"
alias -axe "-attack;impulse 2"
bind F +axe
zzlightningzz 10 Sep, 2022 @ 7:58pm 
Very nice ! thanks for the good helpful info learned new settings to use in my configs with the new re-release Quake. the "bf" screen flash would be nice for when executing a config change in game nice