The console provides a command-line interface for the advanced configuration of Source games. Just about any configuration task can be completed from the console, and in fact many have to be.
Enabling the console
The console starts disabled by default. To enable it, load the game and visit Options > Keyboard > Advanced. There will be a pop-up that will include two options, one of them labeled "Enable Developer Console". Once enabled, it can be opened and closed by pressing the button above, known as the "tilde."
-consoleto the game's launch options and type
bind your_key toggleconsole(replace your_key with the key to open the console).
The grey box across the bottom of the console window is where commands are entered. They come in two forms: commands and variables. Commands are simply keywords, but variables ("cvars") require a value of some sort before they are accepted. When setting a cvar you might type something like this :
When you've finished typing, hit
A few notes:
- Multiple values are separated with spaces. If a value contains a space, surround it with quote marks. (e.g.
say "Hello everyone on the server".)
- The console will suggest commands and sometimes values in a pop-out box beneath the input field. Press / to navigate the list and to accept the highlighted suggestion.
- Only "archived" cvars are stored after the game closes. Use autoexec if you want to set any others when a game loads.
- Some commands are serverside, others clientside. In multiplayer you can only set clientside ones.
- There are many command prefixes. The most common are
- The ever-useful
findcommand searches console command names and descriptions for the term you provide.
- Similar to the find command above, but searches for entities within the map by name.
help <command name>
- Displays any help text for a command, without affecting its value.
- Most cvars that affect gameplay, especially in multiplayer games, are flagged as "cheats". Submit
sv_cheats 1to unlock them.Note:You will never be VAC banned for using built-in cheat commands.
- Developer mode enables more verbose console output, enables cheats and the console automatically, and makes various other useful changes. If set to
2, the last few lines of console output will be printed at the top of the screen as well.
- Use one of these commands if you want to record what goes on in the console for later use.
con_logwrites output constantly, while
condumprecords only when invoked.Tip:The console only displays 241 lines at a time. Use
con_logif you run up against this.