Welcome to Halflife2.net!  
    News     Games      Mods      Steam      Articles      Wiki      Steam Group      Forums
SPOTLIGHT - NEW SITE!
Welcome to our newly designed website created by our very own Yorick. There's been a big reshuffle and lots of new content added so check it all out!
Half-Life 2 Developer Console
The developer console is an essential tool for game developers for debugging their code and also for players to customize their settings. The console is a text-based input/output interface to execute commands or change global settings during runtime.

Enabling the console

To enable the console for use:
  1. Run the game/mod.
  2. In the main menu click on Options.
  3. Click the Keyboard tab.
  4. Click the Advanced... button.
  5. Check the box next to Enable developer console (~).
  6. Click Apply.
Henceforth, the console can be opened or closed with the key located top left below , typically labeled ~ ("tilde") on a US keyboard.
Note: The ~ key may not work on some keyboards, in which case you should right click on the game, and add -console in launch options. When the game has launched, the console should be open, enter bind toggleconsole

Replace with the key you want to use. Eg: bind t toggleconsole

You can also manually set another key by opening the cfg/config.cfg file of the game/mod and changing this line: bind "" "toggleconsole"
The console is also enabled when the game executable is started with the -dev or -console parameters. (Developers should always start the game with -dev.)

If the Source Engine is started with an attached debugger, the console output is shown in your debug output window. Starting HL with -condebug will also log all console output in the text file console.log located in your game directory.

Entering commands

Commands are entered into the console by typing them in at the box at the bottom. After entering a new command, it is executed by hitting the <Return> key or pressing the Submit button.

A command has a unique name and an optional list of parameters where each parameter is separated by a <Space> character. Note: The ] is a prompt, and is not typed.

The syntax is: command <parameter1> [<parameter2>]. For example:
]bind mouse1 +attack
]map dm_lockdown
If a command parameter contains <Space> characters, it must be encapsulated in quotes:
]bind h "say hello world"
]name "Gordon Freeman"
The console stores the last executed commands in a command history that is accessible with <UpArrow> (goes to the command you just/last entered) and <DownArrow> (goes to the very first command that you entered into the console) keys. You can auto complete a command by pressing <Tab> and choose from a list of available commands if the console found multiple matches. Some commands (e.g. map, load etc) support auto completion for the first parameter too.

Commands and variables

The console differs between console commands and console variables.

Console commands usually pass the parameters to some code function and execute it, but they don't remember these parameters.

Console variables store the last parameters like a global setting. Console variables can only have one parameter, which can be a number or string; it depends on the game code how these values are interpreted. A lot of console variables act like triggers, 0 usually means off and 1 means on (e.g. cl_showfps). To see the current value of a console variable just type the name without any parameters.

Most console commands and variables have prefixes in their name to show the subsystem they belong to, but this isn't always the case, especially for commands coming from Half-Life 1, where the old name was kept unchanged.

Commonly used console command prefixes are:

ai_ single player AI
bot_ bot system
cc_ close caption system
cl_ multiplayer client
demo_ demo playback
disp_ terrain displacement maps
dsp_ audio DSP settings
ent_ entity control/debug
fire_ firing entity events
fog_ fog renderer
g_ single player game
hltv_ Half-Life TV
host_ host system
hud_ client HUD
joy_ joystick input
log_ logging system
m_ mouse input
mat_ material system
mp_ multiplayer game (server)
nav_ navigation graphs
net_ engine networking
npc_ single player game NPCs
phys_ physics system
r_ video renderer
rcon_ remote control access
sk_ player skill / difficulty
snd_ sound system
sv_ server settings (engine)
v_ client view
vgui_ VGUI
voice_ ingame player voice
vprof_ code profiler
wc_ WorldCraft/Hammer helpers

If you forgot the exact name of a command or variable, find shows all commands containing a given substring.

The command help shows help text for a given command (if available).

Entering Cheats Into The Console

If you wish to enter a cheat such as impulse 101 then you would need to have already typed in sv_cheats 1. This enables the cheats to be typed in. To turn cheats off simply type in sv_cheats 0.

Full Console Command Listing

You can find a full listing of console commands at Valve's developer site here.
HALF-LIFE 2


Developer: Valve
Publisher: EA Games
Genre: FPS
Release Date: 16th Nov 2004
Engine: Source
Mode: Singleplayer
Platforms: Windows, Xbox360, Playstation3

Official Website
HALF-LIFE 2 PAGES

SYSTEM REQUIREMENTS

Minimum: 1.2 GHz Processor, 256MB RAM, DirectX 7 graphics card, Windows XP/2000, Mouse, Keyboard, Internet Connection, CD-ROM or DVD-ROM drive

Recommended: 2.4 GHz Processor, 512MB RAM, DirectX 9 graphics card, Windows XP/2000, Mouse, Keyboard, Internet Connection, CD-ROM or DVD-ROM drive
About Halflife2.net
The definitive source for all things Valve

About Us | Staff | Links | Contact | Competitions | RSS Feed | Submit News
Info
View our Privacy Policy and Terms of Use.
Powered by vBulletin
Copyright © 2009 vBulletin Solutions, Inc.
Copyright © 2009 Halflife2.net.