1. IntroductionI've dived into the console commands for HL2 & Source in general multiple times over the years, and I felt like documenting some of the more useful commands that ship with the game, but are otherwise little-known or unused.
Odds are, you'll know most of these. If I manage to teach you about one more command you didn't know about, I'd consider that a win.
Let's get started, then.
There's actually a lot of useful commands you can find. These are some of the basics you would probably get the most use out of.
clear- Clears the console text. You'll probably use this one the most.
help [string]- get the help string tied to a command
find [string]- find any commands that have the search string in them or their descriptions
key_listboundkeys- return a list of all your bound keys
key_findbinding [string]- find keys bound to a specific string in the command name
key_updatelayout- updates the keyboard layout in-game to the current Windows setting; i.e. DVORAK or QWERTZ
1.1.2. Developer Settings
developer [int]- Enable developer mode.
developer 1will mostly print the console feed to the top corner of the screen.
developer 2will print extremely verbose feedback including map I/O systems being run and time stamps. Recommend to only use
developer 1unless you're trying to find issues with your map's functions or bug hunting. Can be used at startup by using the
con_notifytime [int]- How many seconds to show the console feed on-screen. Set to
0to disable the screen popups.
phys_penetration_error_time [int]- How long to show the
VPHYSICS PENETRATION ERRORtext on objects that are stuck in the world. This happens a lot on maps with physics props just slightly too low into the ground (
d2_coast_11is a really big example of this). Setting this to
0is recommended unless you're doing some serious head-scratching bug testing, as it's mostly an error you can ignore.
1.2. AI System
notarget- NPCs will ignore the player, but otherwise operate normally.
ai_disable- Completely disables the AI system. May break maps & level progression. Use at own risk.
ai_norebuildgraph [bool]- Hides the
NODEGRAPH OUT OF DATE, REBUILDINGtext. HDtF wishes they knew about this one.
npc_citizen_explosive_resist [bool]- When set to
0, Citizens will essentially die to one grenade or explosion as a one-hit-kill.
npc_citizen_auto_player_squad [bool]- Citizens will immediately join the player's squad, and can't be removed until they die.
npc_citizen_auto_player_squad_allow_use [bool]- Allows the player to manually add/remove Citizens from their squad by pressing
+useon them. Requires
npc_citizen_auto_player_squad 0to properly work.
npc_citizen_insignia [bool]- places a visible model on the Citizens in your squad. In the case of HL2, it's a chef hat.
npc_citizen_squad_marker [bool]- similar to the previous command, but puts a crosshair gizmo beneath your squad members' feet.
sk_citizen_heal_ally [int]- how much medics will heal you, per medshot.
sk_citizen_heal_ally_delay [int]- how many seconds between heals.
sk_citizen_heal_ally_min_pct [float]- how low your health must be before they will heal you in a decimal. i.e.
0.9would be 90/100 health.
sk_citizen_giveammo_player_delay [int]- how long in seconds the NPCs must wait before they give you more ammo.
1.3. Spawning & Creation
impulse 82- create a Jeep
impulse 83- create an Airboat
npc_create [NPC class name]- spawn an NPC of the specified class. i.e.
npc_create_equipment [weapon script name]- spawns NPCs with the specified weapon name. i.e.
prop_physics_create [model path]- Spawn a physics prop of the specified type. i.e.
prop_dynamic_create [model path]- Spawns a dynamic prop of the specified type. Might present errors if the model has no prop_data or $staticprop flags in the compiled model.
1.4. Performance Tweaks
npc_citizen_dont_precache_all [bool]- toggle the precaching of all citizens to prevent hiccups & stuttering
cl_detaildist [int]- How many units to render detail props. Set to
0to disable them.
g_ragdoll_maxcount [int]- how many corpses can be rendered at once.
0will make them disappear immediately, while
100would let 100 different corpses appear at once.
snd_restart- restart the sound system of the game. It is greatly advised to use this command over
stopsoundas this command won't break soundscapes, soundscripts, or entity sounds.
r_flushlod- flushes the model cache. Can be used to prevent overfilling it (hitting the max of 2048 will crash the game), or to empty the cache to see the changes to a recompiled model on the spot.
mat_reloadalltextures- empty & reload the texture cache.
reload- reloads the most recent save, or reloads the entire map depending on the circumstances.
impulse 203- Remove the object you're aiming at. Dangerous command: use at own risk.
hud_reloadscheme- Reload the HUD files.
vehicle_flushscript- Reload the vehicle script files.
1.4.2. Inputs & Controls
toggle_duck- toggle the player's crouch status. The same as using
+duck, but a toggle instead of a hold.
toggle_zoom- toggle the player's Suit Zoom. The same as using
+zoom, but a toggle instead of a hold.
toggle [command] [intervals]- toggle a console variable on/off or cycle values. i.e. toggle
npc_citizen_auto_player_squadwould toggle the boolean on & off each time the command was used, while using
toggle sk_max_357 1 3 6would set the max .357 ammo to
6each time the command was used.
impulse 200- Holster your weapon view model. Will just disappear if the weapon lacks an
sv_stickysprint [bool]- Change the sprint from hold to toggle. Will continue sprinting until the player stops moving.
sv_autoladderdismount [bool]- Toggle auto-mounting of ladders when near an exit point. If turned off, you'll need to press
+useto dismount manually.
sv_ladderautomountdot [float]- The deadzone of how close you have to look at a dismount point to trigger getting off on it.
1would make it have almost no automount, while
0would mount it even if you're not facing it. Default of
0.4is fine in most situtations.
impulse 101- The classic. Give all weapons.
lastinv- switch the last weapon used. Useful when making quick-switch commands in chain bindings.
use [weapon script name]- instantly select a weapon from your inventory. i.e.
phys_swap- instantly swap to the Gravity Gun. Essentially the same as using
bug_swap- instantly swap to the Bugbait. Essentially the same as using
give [weapon script name]- Give the specified weapon. i.e.
givecurrentammo- Give the maximum amount of ammo for the currently equipped weapon.
hud_fastswitch [int 0-2]- Set the fast switch setting.
1= PC fast switch,
2= console-style selection.
1.5. Game Settings
hl2_episodic [bool]- enable some minor effects used in EP1 & EP2. May not be immediately visible or very obvious. Recommended to leave off in HL2 as it will make Zombies burst into flames & break in half on damage.
sv_unlockedchapters [int]- Unlock or lock chapters in the game. Set to
0to essentially reset progression, or to
99to unlock all features. SiN Episodes uses the
99setting to enable the HARDCORPS new game plus mode, for example.
sv_infinite_aux_power [bool]- Toggle infinite suit power (i.e. sprinting, torch battery, oxygen, etc.)
sk_auto_reload_time [int]- How many seconds after it was holstered to auto-reload the weapon. If set to
3, it will reload the weapon three seconds after being holstered. Setting it to
0will cause the weapon to be reloaded immediately on holster. To essentially disable this setting, you'd need to set the time to something like
999to make it just take so long you'd never notice.
sv_autosave [bool]- Toggle autosaving; saving on level transitions will still occur.
save_screenshot [int 0-2]- Save a screenshot on the save.
0= no screenshot,
1= manual saves only,
save_history_count [int]- How many save iterations to keep. Default is
1, while 3 would keep 3 copies of the saves.
save_console [bool]- Toggle console-style saving.
autosave- Force an autosave.
autosavedangerous- Force a "dangerous" autosave. These are used when an autosave occurs while enemies are nearby.
hud_deathnotice_time [int]- how long to show death notices on the top right before making them fade. Set to
0to disable the feed visibility.
closecaption [bool]- Toggle full closed captioning support. Not compatible with
cc_subtitles [bool]- Toggle subtitles. Not compatible with
mat_yuv [bool]- toggle the entire game to be in grayscale. As compared to a custom color correction scheme, this will affect everything, including VGUI & menu elements.
mat_colorcorrection [bool]- Toggle colour correction capabilities. If you're on a map that has some god-awful colour corrections like some obnoxious GMod RP maps do, you'll enjoy turning this off.
hud_showemptyweaponslots [bool]- Toggle showing weapon slots if there is no weapon currently in them. i.e. show the Shotgun/Crossbow slot if neither have been picked up.
hud_saytext_time [int]- how long to show chat messages before making them fade. Set to
0to make the chat messages not show until the chat window is opened.
voice_enable [bool]- toggle voice chat
voice_loopback [bool]- Toggle hearing your own voice broadcast in game back to yourself as other people hear it.
hud_quickinfo [bool]- toggle the Xbox-style reticle that shows health on the left & magazine left on the right.
hud_draw_fixed_reticle [bool]- toggle the fixed reticle for the quick info command around the normal crosshair.
hud_draw_active_reticle [bool]- make the fixed reticle change colours when over friendly or enemy NPCs.
cl_showhelp [bool]- disable the HUD hints.
hud_jeephint_numentries [int]- max number of hints to show for the Jeep. Set to
0to disable the hints.
hud_airboathint_numentries [int]- same as abouve, but for the Airboat. Set to
0to disable hints.
commentary [bool]- Toggle developer commentary mode. This is the command used by the game when toggling commentary mode.
r_flashlightfov [int]- the field of view that flashlight will have. Default is
45, while setting it to
90will drastically improve the effectiveness of the torch, especially on ultrawide resolutions like 21:9 or 32:9
r_newflashlight [bool]- Toggle between HL1-style flashlight or HL2 style. HL1 style emits from the crosshair, while HL2 style emits from the player.
r_flashlightlockposition [bool]- Lock the flashlight to whatever position it was created at, making it independant of the player. Will delete itself when turned off.
2. ConclusionI might find more over time, and I might have some stuff wrong. Feel free to suggest changes, or to ask for clarifications.
I've also attached a blank bind config file that you can view for an idea of all the keys you can assign. I'm using a US English Standard QWERTY keyboard, so please take note of that if you use something else like DVORAK or QWERTZ.