Difference between revisions of "Console"

From Team Fortress Wiki
Jump to: navigation, search
m (correct key and use the template)
(new section about how to use the console.)
Line 6: Line 6:
  
 
Access to the console is by default disabled. To open the console, a key must be bound to the command of opening the console. On US keyboards this defaults to the tilde key {{key|~}} . Additionally the console must be enabled in the advanced keyboard options sub dialog.
 
Access to the console is by default disabled. To open the console, a key must be bound to the command of opening the console. On US keyboards this defaults to the tilde key {{key|~}} . Additionally the console must be enabled in the advanced keyboard options sub dialog.
 +
 +
== Using the console ==
 +
The console is split into two parts, the large output panel and the command prompt.
 +
 +
=== The output panel ===
 +
In addition to showing the output from entered commands, the output panel also logs various game events, such as player deaths and chat text.
 +
 +
The last few lines of the console output can be overlaid on top of the gameplay in the upper left corner.
 +
 +
=== The command prompt ===
 +
The command prompt accepts written commands. Commands are executed by hitting the return {{key|Return}} or enter key {{Key|Enter}}.
 +
 +
Like other text fields in the GUI, it supports the clipboard, allowing the user to cut, copy and paste text.
 +
 +
The command prompt supports code hinting. As the user types the command, the game will offer suggestions for what the user is typing. Hitting the tab key {{key|Tab}} will accept the suggestion, letting the user continue to type the command.
  
 
== Command types ==
 
== Command types ==

Revision as of 20:52, 6 July 2015

A screen of the Developer Console found in Team Fortress 2

The console is a part of the user interface aimed at the game developers, content authors and power users. It is a text based interface that allows the user to enter text commands that the game interprets.

Accessing the console

The advanced keyboard options dialog that hides the option to enabled the console

Access to the console is by default disabled. To open the console, a key must be bound to the command of opening the console. On US keyboards this defaults to the tilde key ~ . Additionally the console must be enabled in the advanced keyboard options sub dialog.

Using the console

The console is split into two parts, the large output panel and the command prompt.

The output panel

In addition to showing the output from entered commands, the output panel also logs various game events, such as player deaths and chat text.

The last few lines of the console output can be overlaid on top of the gameplay in the upper left corner.

The command prompt

The command prompt accepts written commands. Commands are executed by hitting the return Return or enter key ↵ Enter.

Like other text fields in the GUI, it supports the clipboard, allowing the user to cut, copy and paste text.

The command prompt supports code hinting. As the user types the command, the game will offer suggestions for what the user is typing. Hitting the tab key Tab ⇆ will accept the suggestion, letting the user continue to type the command.

Command types

There are two kinds of commands, pure commands and so called console variables. The difference is that a console variable retains a value, while pure commands execute once.

Additionally commands are flagged as being one or more of special types of commands.

Cheats

Many commands are considered too powerful for normal players and are marked as cheats. Unless explicitly allowed by the server owner using the sv_cheats variable, pure commands marked as cheats will not execute and console variables will be reverted to their default values.

Offline commands

Most commands only make sense when connected to a server. As such the game will prevent them being used unless connected to a server. A few do make sense even without a connected server and are marked as such.

Replicated variables

Some variables must have the same value on both the server and the client. The game will temporarily override those variables on the client when connected to a server.

Archived variables

Some variables contain user settings that should persist across playsessions. They are marked for automatic archival in the FILENAMEHERE file by the game.

Demo required/forbidden

Some variables influence the recording of gameplay demos and as such need to be included/excluded from the demo recording.

Special script files

The game settings, keyboard binds and so on are all internally implemented as console commands stored in a set of dedicated files.