Half-Life 2 Console Commands: How to Spawn Epic NPC Fights
Have you ever wondered if Father Grigori could kill 50 zombies? I don't wonder anymore. I know he can. If you want to do a few really cool things with the console, then look at this.
The console is normally meant to be a development tool for programmers and interested players. Half-Life 2 offers an incredibly powerful console that can do just about anything to change the game world. If you are like me, then you probably want to create some epic battles without paying for Gmod. There's a few extra little things you can due too.
If you want to turn on the console, then open up the options and go to controls. Look under advanced and turn on the console. All you have to do is hit the “~" key to open the console. Then enter the code and hit “Enter".
Cool Things to do with the Console
The first cool thing is to use the command “cl_ragdoll_collide 1". This makes all the dead bodies properly collide with each other. It is normally set to 0 which causes them to fall through each other. It makes the game look better and it hardly affects performance.
You can also cause the bodies to fall in slow motion. Just type “cl_phys_timescale 0.1". This should make all the bodies fall at 10% of their normal rate for a some cool pictures. The general physics can also be slowed down by using “phys_timescale 0.1". If you want to reverse either of these, just set the value to 1.
It's also possible to set up your own bullet time in your game. You just have to use one command. Type “host_timescale 0.1" and you will see that everything moves at 10% of it's speed. This will get really old in the talking levels though, so you should remember to set it back to 1 when you're done. If you really want to use it throughout your game, then you should bind them to keys. You'd do that by typing “bind “x" “host_timescale 0.1" " and “bind “c" “host_timescale 1" ". Note that you have to put the quotations marks around the key you are marking and the actual command. Once you've put this into the console, you can press the “x" key to start bullet time and then hit “c" to end bullet time. If you want to stop using it, then just use “unbind “x" and unbind “c" ".
Preparation for War
You'll need to put a few codes in if you want to get ready for a battle, but you'll also need a good spot. Just remember to pick somewhere that's open, but make sure that it has some indoor areas for cover. I've found a few good spots for fights. You can stage a good battle in the first chapter after you leave the food distribution center and enter the town square. The first town in chapter eight is also good for fighting.
Once you are in position, you need to use a few codes. Start with “sv_cheats 1" to turn on the cheat codes. Then type “notarget" and “god". This will make you invisible and invincible. You are now able to watch in peace. If you want to get some good aerial shots you can use “noclip" to float above. You might also want to use “ai_disable" before the fight begins if you want to set everything up before you start.
I'm not going to list every console code here because that would just be a little excessive. Gamefaqs has a good list here. Consult it as necessary. I'll try and give you the good ones you'll be using a lot. The best way to handle most fights is to use the bind option to spawn soldiers rapidly. You just need to know two commands and then write down the codes.
“npc_create_equipment weapon_(weaponname)" sets up the equipment that an NPC will hold when you spawn it. “npc_create npc_(npcname)" creates the actual NPC. To bind this to a key, type “ bind “(key)" “npc_create_equipment weapon_(weaponname); wait; npc_create npc_(npcname)". This big line of code tells it to spawn an npc with the weapon selected when you press the key that you put in for the (key) spot. You can spawn any NPC with any weapon, but they might use the weapon awkwardly if they lack the animation to use it.
Let's try my example with Father Grigori from the start. If you look up Father Grigori's code, then you should know that he is npc_monk. You will probably want him to start with his trademark weapon weapon_annabelle. The code for that would be “bind “v" “npc_create_equipment weapon_annabelle; wait; npc_create npc_monk" ". Just press “v" to make Father Grigori with his special shotgun at the end of your crosshair. He needs some zombies to fight though. They are a bit easier since they can't hold weapons. Just type “bind “b" “npc_create npc_zombie" ". A zombie will spawn anytime you press “b". Type “ai_disable" to place Grigori and then line up the zombies. Once you think you have enough, type “ai_disable" again to restart the NPCs. Enjoy the fight. Don't try to do too many at first though if you disable the AI. Your computer may not be able to handle all those AI programs turning on at once.
You can do this exact same thing with anything. You can have Alyx fight the combine using “npc_Alyx" and “weapon_alyxgun" and “npc_combine_s" and “weapon_ar2". There are really cool options for some of the other NPCs. You can have vortigaunts go through their combat routine and even spawn striders.
There are two important things to know though. First, Dog has no combat AI. All of his combat in the game is scripted because of programming difficulties, so he won't do anything but run away if spawned. Also, do not spawn a strider if you don't have Episode 1 too. They don't have a death animation in Half-Life 2 before Episode 1, so it will usually crash the game.
Spawing Special Items
You can spawn a number of special items to create a big battlefield. You can rig up your own turrets and spawn combine vehicles to create a few cool shots. You can just use an easier command for this though. Just type “give_combinegunship", “give_combinedropship", “give npc_helicopter", or “give_strider". If you want to create a gunship or dropship, then you need to use noclip to get off the ground and spawn them in the open sky. If you want to create a strider, then just aim a bit off the ground until you get it right.
Turrets are easy to create. If you just spawn one, it won't fall correctly. You need to specify that it is “npc_create npc_turret_floor".
You can also get the different vehicles to fire specific attacks. It's pretty cool to assign a vehicle's attack to a key. It's like you command your own strider.
There are a few that you will probably want to do. You can do “bind “k" “ent_setname target ;wait; ent_fire npc_strider setcannontarget target" ". This should cause your spawned strider to fire the secondary cannon at whatever you have in your sights. If you use “DoGroundAttack" instead of “setcannontarget" then it will cause the strider to use it's leg to spear the NPC you have in your crosshairs. These can create a few really cool pictures.
The gunship doesn't have too much extra. You can tell it to fire it's heavy cannon to the ground by doing “bind “k" “ent_fire npc_combinegunship DoGroundAttack" ".
The helicopter is a little more interesting. You can use the code “bind “k" “ent_setname target;wait; ent_fire npc_helicopter DropBombAtTarget target"" to make it drop a mine on the target.
If you play around with the console for long enough, then you will soon need to do a quick cleanup. Here's the easy way. Use the code “developer 1" to turn on the developer console for a moment. You'll need it for this code. Then type “npc_destroy" while looking at an NPC to destroy that NPC. You can also type “npc_destroy_unselected" to destroy any NPC that isn't in your sights. This is good for the times when you accidentally place an NPC in a place where they're stuck. It is also good for the times when you put too many NPCs on the playing field and you're about to crash.
Once you are done, you need to fix all the newly bound keys. Just type “unbind (key)" to unbind the key. If you accidentally overwrite any keys, then you can just reset the keys to default in the control section of the options. All the other console changes should just change back the next time you load up again.