Blog/HL2/💡Tips & Tricks

Half-Life 2 Console Commands: God Mode, Noclip, NPCs

Valve shipped Half-Life 2 with its developer console intact, and it still turns the game inside out: god mode, noclip, every weapon in one command, and the Citadel supercharged gravity gun available from the first map.

Published August 16, 2026·8 min read·By Mythras
The Combine Citadel towering over the rooftops of City 17, the setting Half-Life 2 console commands let you take apart.

Half-Life 2 shipped with its developer console intact, and two decades of updates later it is still there — the same window Valve's own developers used, pointed at the same engine. Three commands in, you are flying through walls with every weapon in the game. A fourth hands you the Citadel's supercharged gravity gun on the first map.

This guide covers how to turn the console on in the current Steam build, which commands need cheats enabled, what the classic ones actually do, and the button codes that stand in for all of this on the old Xbox 360 and PS3 versions of The Orange Box.

One scope note: if you care about leaderboards, this is the wrong article — speedrun rules treat console use completely differently, and the speedrunning guide covers which commands are legal there. This is the sandbox toolkit.

Turning the console on

PCGamingWiki documents two ways in, and both work on the current build:

Through the menu. Go to Options, open the Keyboard tab, click Advanced, and check Enable the developer console. From then on the tilde key (~, top-left of a US keyboard) opens and closes it.

Through a launch option. Add -console to the game's launch options in Steam and the console opens with the game. From there, bind F2 "toggleconsole" gives you a key to open it in play — and any key can stand in for F2.

The console is a command line: type a command, press Enter. Commands can be chained with semicolons, which is how the multi-step tricks later in this guide fit on one line.

sv_cheats 1 comes first

The Half-Life Wiki's cheat list gives the master switch as:

sv_cheats 1

That turns cheats on; sv_cheats 0 turns them off. Run it before the commands in the next section — it is the toggle the cheat set hangs off, and it costs nothing to set it first rather than wonder why god did not take.

The core cheat commands

These are the commands the Half-Life Wiki lists for the PC version of Half-Life 2:

CommandWhat it does
godYou cannot take damage
buddhaYou take damage down to 1 health, but cannot die
noclipFly freely and pass through walls
notargetNPCs can no longer see or target you
impulse 101Gives every weapon
give item_healthkitAdds 25 health
give item_batteryAdds 15 suit energy
npc_createSpawns an NPC (see below)
ai_disableTurns NPC AI off entirely
killGordon dies on the spot

A few of these deserve a sentence more than the table gives them.

buddha is the more interesting invincibility. god deletes the combat system; buddha leaves it running but floors you at 1 health, so fights stay tense without ever ending your session. If you want to see a set piece through rather than skip it, buddha is the better tool.

noclip is the sightseeing command. Half-Life 2's maps extend well past where the game lets you walk, and flying out of bounds over City 17 is a free level-design tour. Type it again to turn it off — preferably over solid ground.

impulse 101 pairs naturally with the weapons guide: every gun in the arsenal, delivered at once, on any map. It is also the quickest way to test-drive weapons the game holds back for hours, like the crossbow and RPG.

A Combine Overwatch Soldier in full armor, one keystroke away from being on your side via a setrelationship command.

The super gravity gun, anywhere in the game

The single best cheat in Half-Life 2 is one convar:

physcannon_mega_enabled 1

The Half-Life Wiki's gravity gun page confirms what it does: your gravity gun becomes the supercharged blue version the game normally grants only inside the Citadel — the one that picks up living Combine soldiers and one-shots them into walls. With the convar on, it works in normal play, from the moment you have the gun.

There is one documented side effect worth knowing before you flip it: while the command is enabled, any NPC's weapon disintegrates when they die, everywhere in the game, regardless of what weapon it is. You are trading looted ammo for the super gravity gun. Take the trade at least once — running Ravenholm with the super gravity gun is a different game.

The gravity gun guide covers what both versions of the weapon can do in detail.

The supercharged gravity gun, glowing blue, normally restricted to the Citadel and unlocked anywhere by physcannon_mega_enabled 1.

Spawning NPCs with npc_create

The spawn command takes the form:

npc_create npc_<name>

It creates the NPC where you are looking. The Half-Life Wiki's list of valid names is long; these are the ones that make the best sandbox ingredients:

NameSpawns
npc_combine_sCombine soldier (with a shotgun, if its weapon is set to one)
npc_metropoliceCivil Protection officer
npc_striderStrider
npc_combinegunshipGunship
npc_combinedropshipDropship
npc_antlionAntlion soldier
npc_antlionguardAntlion guard
npc_zombieZombie
npc_fastzombieFast zombie
npc_poisonzombiePoison zombie
npc_headcrabHeadcrab
npc_manhackManhack
npc_rollermineRollermine
npc_turret_floorCombine sentry gun
npc_alyxAlyx Vance
npc_barneyBarney Calhoun
npc_dogDog
npc_monkFather Grigori
npc_vortigauntVortigaunt
npc_citizenCitizen

The same list runs through birds (pigeon, crow, seagull), the barnacle, the ichthyosaur, scanners, ceiling and ground turrets, and hopper mines. The Episodes add their own names on top — zombine needs Episode One or Two, hunter and magnusson need Episode Two, and ministrider is the Episode One name for a Hunter, which the wiki flags as running worse AI than Episode Two's hunter.

If you want a field guide to what you just spawned — and what it will do to everything else in the room — the enemies guide covers the full roster.

A Strider on patrol in City 17 — npc_create npc_strider puts one wherever you are looking.

Two entity commands worth learning

Two deeper cuts from the same wiki list, both built on ent_fire:

Ignite anything. ent_fire npc_<name> ignite sets the named NPC type on fire. Zombies already burn in the game's fiction; now everything else can too.

Rewrite loyalties. ent_fire npc_<name> setrelationship "<target> D_LI 99" makes that NPC type friendly toward the target — D_LI is the friendly disposition, D_HT is hostile, and the target can be PLAYER or another NPC class like npc_alyx. This is the command that turns a spawned Combine squad into your personal escort, or sets two factions on each other while you watch from a rooftop with notarget on.

There is also a spawn the normal command cannot produce. The Overwatch Elite — the white-masked soldier — is listed as unspawnable through npc_create, but the wiki gives the entity-level workaround:

ent_create npc_combine_s model models/combine_super_soldier.mdl

Appending additionalequipment weapon_<weaponname> to that line spawns him armed.

Useful commands that are not cheats

Not everything worth typing needs sv_cheats. These are pulled from PCGamingWiki's Half-Life 2 page:

  • fps_max — the game caps at 300 FPS by default; the console can raise the cap to 1000, and fps_max 0 uncaps it entirely. The engine tick rate stays fixed at 66.666 Hz either way, so this is smoothness, not game speed.
  • -novid — a launch option, not a console command: skips the Valve intro video.
  • map <mapname> — loads any map directly, e.g. map d1_trainstation_01 for the start of the game.
  • snd_legacy_surround 1 — re-enables legacy surround mixing, the first step in PCGamingWiki's recipe for proper positional audio on headphones.
  • joystick 1 followed by exec 360controller — restores legacy controller support on the 20th Anniversary build, which removed the menu option for it; PCGamingWiki notes you need Steam Input disabled first.

The console even hides a co-op mode. PCGamingWiki documents LAN play as "hackable": type maxplayers 4; sv_lan 1, then map d1_trainstation_01, and the campaign loads as a LAN server. The caveats are real — the game will not load autosaves in this state, and dead players respawn rather than reloading — which is why the wiki points anyone serious about co-op at the Synergy mod instead. But as a fifteen-second party trick built entirely from stock console commands, it is hard to beat.

Cheating on Xbox and PlayStation

The Orange Box versions of Half-Life 2 do not expose a console in-game, so cheats live on button combinations, entered during play. The Half-Life Wiki lists these for Xbox 360:

EffectCode
God modeLB, Up, RB, Up, LB, LB, Up, RB, RB, Up
Free healthUp, Up, Down, Down, Left, Right, Left, Right, B, A
Full ammoRB, Y, B, A, X, RB, Y, X, A, B, RB
Unlock all levelsLeft, Left, Left, Left, LB, Right, Right, Right, Right, RB

And for PlayStation 3:

EffectCode
Restore healthUp, Up, Down, Down, Left, Right, Left, Right, O, X
Restore ammoR1, Triangle, O, X, Square, R1, Triangle, Square, X, O, R1
All levelsLeft, Left, Left, Left, L1, Right, Right, Right, Right, R1

The free-health code is the Konami Code, unchanged. The wiki also notes the console builds are close enough to the PC version that editing the configuration file can bind a button to open the developer console even there.

Quick Action Checklist

  • Enable the console: Options, Keyboard tab, Advanced, check Enable the developer console, then open it with the tilde key.
  • Type sv_cheats 1 before any cheat command.
  • god for invincibility, buddha to keep fights tense but unloseable, noclip to fly, impulse 101 for every weapon.
  • physcannon_mega_enabled 1 unlocks the Citadel supercharged gravity gun anywhere — at the cost of NPC weapons disintegrating on death while it is on.
  • npc_create npc_<name> spawns NPCs where you look; ent_fire npc_<name> setrelationship "PLAYER D_LI 99" makes them friendly.
  • fps_max 0 uncaps the 300 FPS default limit without touching cheats.
  • On Xbox 360 and PS3 Orange Box, use the button codes — health, ammo, god mode and level select are all reachable without a console.

Frequently Asked Questions

Go to Options, open the Keyboard tab, click Advanced, and check Enable the developer console; the tilde key (~) then opens it. Alternatively, add -console to the launch options in Steam so the console opens with the game, then use bind F2 "toggleconsole" to give yourself an in-game key. Both methods are documented by PCGamingWiki and work on the current 20th Anniversary build.

Keep Reading

Sources & Further Reading
Last updated August 16, 2026.

Related Guides

The shower room in dm_lockdown, the Half-Life 2: Deathmatch map rebuilt from the Nova Prospekt map d2_prison_03, littered with barrels and toilets for gravity gun use.
🎮Game GuidesAug 14, 2026·10 min read

Half-Life 2: Deathmatch Guide: The Mode Valve Never Stopped Patching

Valve pulled Half-Life 2: Deathmatch off the store in November 2024 and then, three months later, shipped it a 64-bit build, a client prediction rewrite, and a 100-player ceiling. Eight maps, a cut campaign weapon, and a gravity gun other people are aiming back at you.

Read article
The view from the train arriving in City 17, the opening moment of d1_trainstation_01 where every Half-Life 2 speedrun timer starts.
🧠Advanced StrategyAug 13, 2026·11 min read

Half-Life 2 Speedrunning Guide: The Bug That Beats the Game in 36 Minutes

The Half-Life 2 world record is 36 minutes and 30 seconds across 69 maps. The reason is that Valve wrote a speed limiter that checks which way you are looking instead of which way you are moving.

Read article
The Overwatch Nexus in City 17: a domed former bank clad in Combine walls, seen across a wrecked plaza during the uprising.
🎮Game GuidesAug 8, 2026·11 min read

Half-Life 2 Uprising Guide: Squad Command and the Nexus

Half-Life 2 hands you a four-man rebel squad in Anticitizen One and never explains the button that commands it. Here is the squad system in full, all eleven lambda caches across the uprising, the Nexus room that can trap your save, and the exact rocket counts for every Strider and gunship.

Read article
Nova Prospekt seen from the coast road below: a lit guard tower and long concrete blocks on a rock escarpment under a heavy dusk sky, with a power pylon and a concrete stairway in the foreground.
🎮Game GuidesAug 1, 2026·10 min read

Half-Life 2 Nova Prospekt Guide: Bugbait, Turrets, and the Standoff That Ends Runs

Nova Prospekt is where Half-Life 2 stops being a chase. Here is how bugbait actually works, why your antlions go deaf the second a Guard shows up, how to win both turret standoffs in Entanglement, and the reprogrammed-turret habit that can quietly kill your save without ever showing a game over screen.

Read article
The Half-Life 2 cover art, showing Gordon Freeman in the Mark V HEV suit against City 17.
🌱Beginner GuidesJul 19, 2026·12 min read

Half-Life 2 Beginner's Guide: Start Strong in City 17

Half-Life 2 never stops to explain itself, which is why new players stall in Ravenholm with no shotgun ammo and no idea the gravity gun was the answer. Here is the chapter map, the systems the game hides, and the mistakes that waste your first playthrough.

Read article
The first lambda cache marker in Half-Life 2: an orange lambda symbol spray-painted beside the two Dr. Breen vending machines that hide the entrance to Kleiner's lab.
🎮Game GuidesJul 31, 2026·11 min read

Half-Life 2 Achievements Guide: The Runs Worth Planning

Half-Life 2 pays 2 Gamerscore for a basketball shot and 25 for surviving Ravenholm with one weapon. Here is the full 33-achievement list sorted by what actually needs planning: the Zombie Chopper rules, the exact Keep Off the Sand window, all 45 lambda caches, and the missables.

Read article