- It is essential to enable the console and use sv_cheats 1 to enable most of them. commands y Tricks in Half-Life 2: Complete Edition.
- The codes give, weapon_*, item_* and npc_create allow you to obtain weapons, ammunition, items and NPCs from the entire Half-Life 2 universe and its episodes.
- Commands such as host_timescale, sv_gravity, physcannon_* and sk_plr_dmg_* are used to adjust physics, damage, time and difficulty with great precision.
- Direct map loading with map and the use of demos, camera modes, and visual effects make the console a powerful tool for creating and experimenting.

If you took advantage of the Steam promotion and already have Half-Life 2: Complete Edition in your library, you have the most complete version of Valve's legendary shooter , including the main campaign, Episode One, Episode Two, and Portal. A perfect package for revisiting City 17… or for destroying it with cheats and console commands.
In this guide, you'll find all the important commands and codes for Half-Life 2: Complete Edition : how to activate the console, unlock weapons, alter gravity, modify weapon damage, load specific maps, spawn NPCs, manipulate the camera, manipulate time , and much more. Everything is explained in Spanish (Spain), with practical examples and warnings to prevent you from accidentally breaking your game.
How to activate the console and cheats in Half-Life 2: Complete Edition
Before writing any code, you need to enable the Source engine's developer console . If you're playing from a classic shortcut on Windows , right-click the Half-Life 2 icon, go to Properties, and at the end of the "Target" field, add the parameter -console . It should look something like this:
"C:\Program Files\Half-Life 2\hl2.exe" -console (the path may change depending on where you have Steam or the game installed).
When you launch the game from that shortcut, you can open the console with the tilde key (the one to the left of the 1 on a Spanish keyboard). From there, you'll enter all the commands you'll see in this guide.
For cheats to work, you almost always need to activate them first with the command `sv_cheats 1` . If you switch back to `sv_cheats 0` , they will be deactivated. Keep in mind that once activated, achievements are locked for the current session (you won't lose existing achievements, but you won't earn new ones until you close the game and reopen it without cheats).
Among the basic codes that are worth memorizing are god (God mode, invulnerable), buddha (you can receive damage but your life does not go below 1), noclip (walk through walls and fly) and notarget (enemies stop focusing on you, although it can break some story events).
Essential commands and camera modes
Once the console is active, you can use hotkeys to change how you see and experience the game . To switch between first and third person, you have:
firstperson : returns to the classic first-person view.
thirdperson : activates a third-person camera behind the character.
If you want to play with the weapon's framing, the command viewmodel_fov# lets you adjust the size/aperture of the weapon model on screen (54 is the default value; higher values move it further away from the camera).
To monitor performance and position, you have several very practical utilities: net_graph 1 shows a detailed reading of FPS and network at the bottom; cl_showfps 1 shows only the FPS; cl_showpos 1 activates your position and speed in the upper right, ideal if you are testing routes or jumps.
If you're looking for a more cinematic or test-like experience, hidehud controls the interface: with hidehud 1 you can hide almost the entire HUD except for the crosshair, and with hidehud 4 you remove it completely, including the crosshair. You can also use cl_drawhud 0 or cl_enablehud 0 to disable it and re-enable it with a value of 1.
Life, armor, and energy tips
To avoid worrying about your health, in addition to God and Buddha, you can generate medical items directly at your feet . Some key commands:
give item_healthkit : creates a large first aid kit with 25 health points.
give item_healthvial : generates a 10-point health vial.
give item_battery : adds a battery that increases the HEV suit's armor by 15 points.
If you don't already have the suit, with give item_suit you get the full HEV suit , essential for using the flashlight, running or breathing underwater.
To stop worrying about your suit's energy bar (running, flashlight, oxygen, etc.), use `sv_infinite_aux_power 1` or its variant `infinite_aux_power` in some modes. This will give you infinite auxiliary energy . To return to normal, use the value 0.
Weapons and ammunition: how to get the entire arsenal
The main command to equip yourself is `give` : simply type `give` followed by the internal name of the weapon or item to make it appear in your inventory. For example, `give weapon_ar2` adds the Overwatch pulse rifle.
Some important weapon names from Half-Life 2 and its episodes are:
- weapon_crowbar: Gordon Freeman's classic lever.
- weapon_pistol9mm pistol.
- weapon_357: Magnum .357, powerful and accurate.
- weapon_smg1: standard submachine gun with grenade secondary mode.
- weapon_ar2: Overwatch pulse rifle with energy orb fire.
- weapon_shotgun: 12-cartridge shotgun.
- weapon_crossbow: crossbow, lethal at long range.
- weapon_frag: fragmentation grenades.
- weapon_rpg: guided rocket launcher.
- weapon_bugbait: “bait” to control antlions.
- weapon_physcannon: standard antigravity gun.
- weapon_annabelleFather Grigori's modified shotgun.
- weapon_alyxgunAlyx Vance's weapon.
In addition to these, the Source engine includes references to other weapons used in beta versions or mods , such as weapon_hmg1, weapon_irifle, weapon_slam, weapon_sniperrifle, weapon_manhack, weapon_immolator, weapon_stunstick, weapon_flaregun, weapon_gauss, weapon_rollerwand, weapon_thumper, weapon_molotov, and weapon_extinguisher, among many others. Some may not work in the standard campaign, but they are there for experimentation.
For ammunition, you have two options: reload your current weapon or generate specific crates and magazines . The `givecurrentammo` command refills the ammunition of your currently equipped weapon (including, if applicable, secondary ammunition, provided it has been recently used).
If you want specific types, these are the most commonly used:
- give item_ammo_pistol: pistol ammunition.
- give item_ammo_357: bullets for the .357 Magnum.
- give item_ammo_smg1: ammunition for the submachine gun.
- give item_ammo_smg1_grenade: submachine gun grenades.
- give item_ammo_ar2: main ammunition for the pulse rifle.
- give item_ammo_ar2_altfire: AR2 energy orbs.
- give item_ml_grenade o give item_rpg_round: grenades/rockets for the RPG.
- give item_box_buckshot: shotgun ammunition boxes.
- give item_ammo_crossbow: crossbow bolts.
- give item_box_sniper_rounds: sniper ammunition.
- give item_box_mrounds: machine gun/submachine gun ammunition.
- give item_box_rounds: 9mm ammunition.
If you want to go all out and have absolutely everything instantly, the Impulse 101 command grants you all weapons and a good supply of ammo . Ideal for testing, crazy speedruns, or simply letting off steam against the Combine.
Adjust weapon damage and maximum ammo
One of the most powerful (and dangerous) aspects of the console is that it allows you to modify the damage inflicted by each weapon and the maximum amount of ammunition you can carry . This is done with the commands sk_plr_dmg_* for player damage, sk_max_* for maximum ammunition, and sk_npc_dmg_* for enemy damage.
Some examples for the player's weapons (replace # with a number):
- sk_plr_dmg_pistol #: gun damage.
- sk_plr_dmg_357 #: damage from the .357 Magnum.
- sk_plr_dmg_ar2 #: pulse rifle damage.
- sk_plr_dmg_buckshot #: damage from shotgun pellets.
- sk_plr_dmg_crossbow #: crossbow damage.
- sk_plr_dmg_crowbar #: damage to the lever.
- sk_plr_dmg_grenade #: damage from hand grenades.
- sk_plr_dmg_rpg_round #: RPG rocket damage.
- sk_plr_dmg_smg1 #: submachine gun damage.
- sk_plr_dmg_smg1_grenade #: submachine gun grenade damage.
- sk_plr_dmg_alyxgun #: damage from Alyx's weapon.
For maximum ammunition, the most important commands are:
- sk_max_357 #: maximum number of bullets for the Magnum.
- sk_max_crossbow #: maximum number of crossbow bolts.
- sk_max_grenade #: maximum number of hand grenades.
- sk_max_pistol #: maximum pistol ammunition.
- sk_max_ar2 #: maximum pulse rifle ammunition.
- sk_max_ar2_altfire #AR2's maximum energy orbs.
- sk_max_rpg_round #: maximum number of RPG rockets.
- sk_max_buckshot #: maximum number of shotgun cartridges.
- sk_max_smg1 #: maximum submachine gun ammunition.
- sk_max_smg1_grenade #: maximum number of submachine gun grenades.
- sk_max_alyxgun #: Alyx's weapon's maximum ammo capacity.
You can also increase the number of pellets the shotgun fires with `sk_plr_num_shotgun_pellets #` . Values like 100 already give very powerful results, but if you go too far (above 1000, for example) the game may start to stutter or even crash.
To balance the overall difficulty of the game, the skill # command lets you change the skill level (1, 2, or 3). And if you want enemies to do more or less damage with certain weapons, you can press:
- sk_npc_dmg_shotgun #: damage from NPCs with shotguns.
- sk_npc_dmg_ar2 #: Combine damage with pulse rifle.
- sk_npc_dmg_smg1 #: damage from enemies with submachine guns.
Keep in mind that absurdly high values can freeze the game or cause the AI to behave erratically. It's best to increase them gradually and test.
Physics, gravity, and manipulation of the world
One of Half-Life 2's defining features is its Havok-based physics , and the console lets you tinker with it to your heart's content. The key command is `sv_gravity #` , where 600 is standard gravity. Lower values allow you to make huge leaps or float , while very high values crush everything to the ground… or can even crash the game if you go too far, so be careful.
Other adjustments for movement and interaction with the environment include:
- sv_friction #: friction of the world, which affects how the actors stop.
- sv_stopspeed #: minimum speed at which the player is considered to be in motion on the ground.
- sv_bounce #: bounce factor of objects in physical collisions.
- sv_maxvelocity #: maximum speed allowed for any moving object.
- air_density #: air density, which influences how certain elements move.
- sv_waterdist #: controls when the special view is applied when the camera is zoomed in on the water's surface.
The gravity gun can also be customized. `physcannon_maxforce` increases the force with which you push objects , `physcannon_maxmass` defines the maximum weight you can lift (1000 is a typical value), `physcannon_pullforce` modifies the speed at which you pull objects, `physcannon_cone` changes the radius of the cone used to select objects, and `physcannon_tracelength` sets the maximum capture distance.
If you want to go further, the command physcannon_mega_enabled 1 (or physcannon_megacannon 1 in some versions) turns your weapon into a Super Gravity Gun , like the one used at the end of the game to smash Combine like rag dolls.
Time control, visual effects and HUD
To play with the overall game speed, the command you're looking for is `host_timescale#` . Values less than 1 make everything slow down, and values greater than 1 speed up the world. Some classic examples:
- host_timescale 3.0: triple speed.
- host_timescale 2.0: double speed.
- host_timescale 1.0: normal speed.
- host_timescale 0.5: half speed.
- host_timescale 0.25: a quarter of speed.
- host_timescale 0.1: super slow motion.
Keep in mind that exaggerated values (very high or very low) can crash the game instantly , so it's best not to go overboard if you don't want to restart.
In terms of visuals, you can activate an old-film style black and white mode with `mat_yuv 1` and return to normal color with `mat_yuv 0` . Other useful effects for debugging or out of curiosity:
- mat_wireframe 1: draws the world and models in "wireframe" mode.
- vcollide_wireframe 1: shows only the models affected by physics in wireframe.
- mat_normalmaps 1: shows the normal maps of the scenario.
- mat_normals 1: highlights the normal characteristics of the materials.
- mat_fastnobump 0: disables bump mapping.
- mat_fullbright 1: removes shadows and lighting, leaving everything with flat light (0 restores).
- mat_depthbias_normal 1: allows you to see through walls in certain cases.
- mat_numtextureunits #: limits the number of texture units (0 is the default value).
If you want cool overlays, r_screenoverlay effects/combine_binocoverlay.vmt gives you Combine vision , and r_screenoverlay effects/tp_eyefx/tp_eyefx.vmt applies a strange vision effect, very useful for eye-catching videos or captures.
For sound effects, `dsp_explosion_effect_duration` adjusts the duration of the buzzing effect after explosions. And the `sv_soundemitter_filecheck` command checks for missing .wav files on the system.
Map management: loading chapters and backgrounds
The console also lets you jump directly to any chapter or loading point in the game and its episodes using the command `map map_name` . This includes everything from the intro to the final levels, as well as menu backgrounds and test maps.
Some examples of main maps from Half-Life 2 and episodes are:
- intro: game introduction.
- credits: credits screen.
- d1_trainstation_01 al d1_trainstation_06: different phases of the train station chapter.
- d1_canals_01 al d1_canals_13 y d1_canals_end: all sections of the canals.
- d1_town_01 al d1_town_05: chapter of Ravenholm and its burdens.
- d1_eli_01 y d1_eli_02: Eli's lab.
- d1_under_01 al d1_under_04: underground and laboratory sections.
- d2_coast_01 al d2_coast_12: buggy tour along the coast.
- d2_prison_01 al d2_prison_08Nova Prospekt levels.
- d3_citadel_01 al d3_citadel_05: chapters of the Citadel.
- d1_breen_01: beginning of the final chapter against Breen.
- d3_c17_01 al d3_c17_13: sections of City 17 during the rebellion.
The episodes also include many specific points:
- ep1_citadel_00 al ep1_citadel_04: Citadel chapters in Episode One.
- ep1_c17_00, ep1_c17_00a, ep1_c17_01, ep1_c17_02, ep1_c17_02a, ep1_c17_02b, ep1_c17_05 y ep1_c17_06: different phases of City 17 in Episode One.
- ep1_background01, ep1_background01a y ep1_background02: background maps for menus (in some you cannot move).
There are also specific background maps that are loaded with the command map + name, such as:
- background01: outdoor plaza of the train station.
- background02: water channels.
- background03: Ravenholm environment.
- background04Route 17 and the bridge.
- background05: Nova Prospekt.
- background06City 17 destroyed.
- background07: interior of the Citadel.
- d3_c17_02_cameraCity 17 without weapons, used for cameras.
- sdk_shader_samples: shader test map.
If you want to unlock chapters quickly without having completed them, `sv_unlockedchapters` unlocks all chapters from 1 up to the number you specify (15 usually corresponds to the credits). A minor detail: in some texts it is incorrectly written as "sv_unlockedcapítulos", but the actual command uses the word "chapters".
Creation and control of NPCs and vehicles
The Source engine allows you to spawn virtually any NPC in the game using the console. The general syntax is `npc_create npc_name` . To spawn them facing the player, use `npc_create_aimed` , and with `npc_create_equipment weapon` you can give them a specific starting weapon (for example, `npc_create_equipment weapon_shotgun`).
The list of available NPCs is enormous. Some of the most well-known are:
- npc_alyx: Alyx Vance.
- npc_barney: Barney Calhoun.
- npc_dog: Dog.
- npc_kleiner: Dr. Kleiner.
- npc_eli: Eli Vance.
- npc_mossman: Judith Mossman.
- npc_monk: Father Grigori.
- npc_citizen: citizen of City 17.
- npc_metropolice: Metro Combine police.
- npc_combine_s: Combine soldier (in Episode Two includes variants with shotgun, etc.).
- npc_headcrab, npc_headcrab_fast, npc_headcrab_black, npc_headcrab_poison: different types of headcrab.
- npc_zombie, npc_fastzombie, npc_poisonzombie, npc_zombie_torso, npc_zombine: zombie variants.
- npc_antlion, npc_antlionguard, npc_antlion_grub (There is also an antlion worker in Episode Two).
- npc_vortigaunt: Vortigaunt (including "doctor" variants).
- npc_cscanner, npc_clawscannerCombine scanners.
- npc_manhack: Flying Manhack.
- npc_rollermine: rolling mines.
- npc_combine_mineHopper mines.
- npc_combine_camera: Combine camera.
- npc_turret_floor, npc_turret_ceiling, npc_turret_ground: floor, ceiling and surface turrets.
- npc_striderGiant strider.
- npc_stalker: Stalker.
- npc_crow, npc_pigeon, npc_seagull: birds of the surrounding area.
- npc_barnacle: Hanging barnacle.
- npc_ichthyosaur: aquatic ichthyosaur.
- npc_gmanG-Man with a briefcase, practically indestructible.
- npc_breen: Dr. Breen himself.
- npc_combinedropship, npc_combinegunship, npc_launcher, npc_crabsynth, npc_mortarsynthCombine ships and synthesizers.
Episodes One and Two add some extras, such as ministrider (enemy hunter), hunter (another type of hunter), and specific variants of antlion guard. They are all generated in the same way, using npc_create npc_name.
If you want to fill the map with allies instantly, you can also use the command give npc_alyx or give npc_barney in some configurations to make the corresponding NPC appear directly near you.
For vehicles, you have several options. `ch_createjeep` or `impulse 82` spawns a drivable jeep, while `ch_createairboat` or `impulse 83` spawns the boat from the canal levels. Additionally, `ch_createjeep` and `ch_createairboat` function very similarly, differing only in the type of vehicle spawned.
Developer tricks, debugging, and moving
Besides the "fun" tricks, there's a mountain of commands designed for developers, modders, and the curious . One of the most important is `developer#` , which lets you activate developer mode (0 disables it, 1 activates it, and 2 activates verbose mode with extra console messages).
For special moves and teleportation, `setpos` sends you directly to specific coordinates , while `setang` sets the player's field of view (pitch and yaw). The `getpos` command returns your current position, which you can then copy for use with `setpos`.
If you want to freeze all NPCs and prevent them from moving or running scripts, use `ai_disable` . Re-entering it will reactivate their AI. Keep in mind that this can break scheduled events if used in the middle of an important sequence.
Collision detection can be temporarily disabled with `noclip` , allowing you to fly around the map without restrictions. `notarget` causes enemies to ignore your presence, although, as mentioned earlier, it can prevent them from firing scripts that rely on seeing you.
For debugging triggers and entities, `showtriggers_toggle` draws the level's triggers on the screen, and `prop_debug` activates a toggleable collision box mode . `picker` lets you select entities by aiming with the crosshair, and `ent_fire !picker ignite` ignites almost anything you're looking at. The `ent_rotate` command rotates the selected entity.
Other useful commands: status displays game information (including the current map), maps lists all available maps, help $ shows you a brief description of the command you replace with $, and exec script_name executes a console script file .
Recording demos and camera control
If you want to record gameplay or cutscenes , the Half-Life 2 console includes demo commands. Using `record demo_name` starts recording everything that happens on the server, and ` stop` stops the current recording. You can then play it back using `play demo_name`.
To add drama to certain scenes, the shake command creates an earthquake effect on the camera, very useful for intros, videos, or moments of chaos. Additionally, the dsp_explosion_effect_duration parameter lengthens or shortens the buzzing effect after intense explosions.
If you want to hide your weapon from the screen without touching the camera, you can use Impulse 200 , which stows/picks up your current weapon. Combined with HideHUD and the camera modes, it's perfect for capturing clean shots of the environment.
To debug collisions between entities and boxes, prop_debug displays the bounding boxes, and hud_quickhelp/text? 1 can be used to toggle certain HUD help texts.
Tricks involving blood, violence, and various effects
If you want to reduce or eliminate blood and dismemberment , there are several violence-related commands:
- violence_hblood 0: deactivates human blood.
- violence_hgibs 0: turns off the human remains.
- violence_ablood 0: cuts the alien blood.
- violence_agibs 0: eliminates alien remains.
You can also suppress the crosshair with crosshair 0 and reactivate it with crosshair 1. To end your character instantly, the kill command causes immediate suicide, while explode forces an explosion death.
If you want an invincible mode but still maintain visual damage, god makes you totally immortal (not even low health), and buddha allows you to receive damage without your health points falling below 1.
Cheat compatibility with Episode One, Episode Two, and Portal
Most of the basic commands you've seen work in the original Half-Life 2 as well as Episode One, Episode Two, and Portal , since they all share the same Source engine with minor variations.
In Portal, for example, you can also use sv_cheats 1 , god , noclip , sv_gravity # , impulse 101 , thirdperson and firstperson , as well as create NPCs like npc_headcrab , npc_gman , npc_barnacle or npc_combine_s (even though they don't make sense in the standard campaign).
Portal adds its own commands, such as give weapon_portalgun to get the portal gun, upgrade_portalgun to improve it, change_portalgun_linkage_id # to change the portal linkage, ent_create_portal_weight_box to generate the classic storage cube , and ent_create_portal_metal_sphere to create the bouncy metal sphere.
Episodes One and Two feature exclusive NPCs (such as Ministrider or certain worker Antlions), as well as variations in weapons and behaviors, but the core commands remain the same . You simply have some extra entity names to summon.
As you can see, the Half-Life 2: Complete Edition console is practically an endless toolbox for experimenting with gameplay, loading specific maps, recording demos, creating impossible battles, adjusting the challenge, or simply strolling through City 17 safely. By using commands like sv_cheats 1, give, npc_create, host_timescale, sv_gravity, or sk_plr_dmg_* wisely, you can customize the experience to your liking, whether it's to overcome a traffic jam, prepare spectacular videos, or discover every corner of one of the most influential FPS games in history.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.
