Jump to content

WoW:Console: Difference between revisions

From Thunderbrew
No edit summary
No edit summary
Line 29: Line 29:
Configurations are persisted across game sessions using .WTF (Warcraft Text File?) files.
Configurations are persisted across game sessions using .WTF (Warcraft Text File?) files.


Each WTF file is a text file, containing only [[#Commands|Commands]] separated by a <code>\r\n</code>, or CRLF sequence.
Each WTF is a text file, containing only [[#Commands|Commands]] separated by a <code>\r\n</code>, or CRLF sequence.


Differently named WTF files may interpret specific commands only (such as Config.WTF, which rejects every line that does not begin with the [[WoW:set (Console command)|set command]]).
Differently named WTFs may interpret specific commands only (such as Config.WTF, which rejects every line that does not begin with the [[WoW:set (Console command)|set command]]).


The Config.WTF file is loaded by the client at startup, and saved during graceful shutdown. It contains every non-default [[WoW:CVar|CVar]]
Config.WTF is loaded by the client immediately at startup, and saved during graceful shutdown. It contains every non-default [[WoW:CVar|CVar]] set by the client.


== Usage ==
== Usage ==

Revision as of 21:14, 12 June 2025

The console is fundamental to the entire engine. It determines how the Graphics API is initialized, controls how configurations are set, and allows many features to be toggled or adjusted using Commands without having to quit the game.

Commands

A Command is a whitespace-less string that can be associated with a function. The Command may or may not have a help message, and it may have a Category number that controls its placement when displayed by the help command.

A Command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:

RUN commandname "with argument"

will dispatch a handler function:

int32 handler(const char* command, const char* argument) {
  print(command);  // "commandname"
  print(argument); // "with argument"
  return 1; // boolean, 1 means the command succeeded
}

Categories

Every Command or CVar belongs to a category number.

WTF Files

Configurations are persisted across game sessions using .WTF (Warcraft Text File?) files.

Each WTF is a text file, containing only Commands separated by a \r\n, or CRLF sequence.

Differently named WTFs may interpret specific commands only (such as Config.WTF, which rejects every line that does not begin with the set command).

Config.WTF is loaded by the client immediately at startup, and saved during graceful shutdown. It contains every non-default CVar set by the client.

Usage

To enable the console, the client must be specially launched using the -console command-line argument.

To use the console, simply press the tilde (~) key at the top-left of your keyboard to show the draggable console screen.

Screen

The screen is customizable using several CVars.