Half-Life 2 NPC Spawning Guide By CakeBomb

Please wait...

This article was written on an older version of FileFront / GameFront

Formatting may be lacking as a result. If this article is un-readable please report it so that we may fix it.


Published by Azzkiker 14 years ago , last updated 1 year ago
CakeBomb has sent in this useful Half-Life 2 NPC spawning guide. The Basics To spawn an npc (with a few exceptions), look at the area of ground where you want it to spawn, then open up the console (~ key for most, below esc for all) and type "npc_create [npc name]". You can also spawn them aimed away from you using npc_create_aimed, but I haven't been able to make this command work without having an npc of the same type spawned normally first. To give your npcs weapons, you have to use the npc_create_equipment command. If you wanted to spawn alyx with a shotgun for instance, you'd type "npc_create_equipment weapon_shotgun; wait; npc_create npc_alyx". Once you've set npc_create_equipment to one weapon, every npc you create will be created with that weapon until you change it. To bind a spawning command to a key, type "bind "[key]" "[command]"". Now you can create some huge zombies vs antlions vs combine vs alyx clones battles. When positioning troops for battle, type "ai_disable" to stop them fighting until you're done positioning. Type it again to turn ai back on. Fun NPCs all have inputs which you can activate using the ent_fire command. Some inputs are common to all NPCs, some are unique to one or two NPCs. To list all the inputs (and outputs, although I don't know if they're much use) of an NPC, type "ent_info [npc name]". As far as I can see, all the inputs listed above setrelationships are specific to certain NPCs. If you want to actually input something to an NPC, you have to name it first. To do this, type "ent_setname [name]". Once you've named an npc, you can then type "ent_fire [name] [input]" and do cool stuff like set them on fire. To set things on fire, type "ent_setname [name]; wait; ent_fire [name] ignite". I found that code posted by somebody on a forum and it made me want to find out other similar things I could do, and find out I did. A couple of other useful global inputs are kill and sethealth. There's also a skin input which I'm guessing changes the model or textures but I have no idea how to use it, so if anybody can help with that it'd be much appreciated. There are more things to input to than NPCs. Type "ent_fire " and a list of non-NPC entities with inputs will appear under the console. I think these differ from level to level, and they let you do things like stopping the antlions spawning at the beginning of Highway 17. NPC List Where inputs are blank I've found nothing useful, but I might have missed something (or I might have omitted something you would have found useful). Combine Footsoldiers Combine Soldier: npc_combine_s Metrocop: npc_metropolice ____ Inputs: enablemanhacktoss - I haven't been able to get this to work. Maybe you'll have better luck. Sniper: npc_sniper Vehicles All of these remain stationary For these use give rather than npc_create. They will spawn above you, rather than underground/inside the ground. Strider: npc_strider ____ Inputs: setcannontarget - kills things - usage "ent_fire [name of strider] setcannontarget [name of target]" | setminiguntarget - useless, aims at feet of target ____ Notes: Targets must be named using ent_setname. On some levels you have to noclip upwards a little to spawn a strider because it will sink into the ground otherwise. If a strider impales an antlion guard it will fly away. Dropship: npc_combinedropship ____ Notes: Lots of inputs, the ones I tried didn't work. Test out more if you can be bothered. Gunship: npc_combinegunship ____ Inputs: dogroundattack - shoots a laser at the ground directly beneath it. Will continue to do so as long as enemies of the combine are beneath it. Helicopter: npc_helicopter ____ Inputs: dropbomb ____ Notes: Lots of inputs, lots crashed the game. Test out more if you can be bothered. Misc Scanners and manhacks are spawned on the near side of the wall pointed at Scanner: npc_cscanner ____ Inputs: equipmine | deploymine | disablespotlight | inspecttargetspotlight - usage "ent_fire [name of scanner] inspecttargetspotlight [name of target] | inspecttargetphoto | followtarget | setflightspeed ____ Notes: Targets must be named using ent_setname. Manhack: npc_manhack Rollermine: npc_rollermine ____ Inputs: respondtoexplodechirp - makes it explode Stalker: npc_stalker ____ Notes: Does nothing but waddle around a bit. Shot me with a laser once in the three times I spawned one. Crashes game when killed. Not recommended. Floor turret: npc_turret_floor ____ Inputs: toggle | enable | disable Ceiling turret: npc_turret_ceiling ____ Inputs: toggle | enable | disable Wildlife Antlions Antlion: npc_antlion ____ Inputs: bugbait - buggy. will alternately attack you and love you. | burrow | unburrow Antlion Guard: npc_antlionguard ____ Inputs: setchargetarget - usage "ent_fire [antlion guard name] setchargetarget [target name]" | clearchargetarget | setshovetarget | ragdoll - makes it die ____ Notes: Targets must be named using ent_setname. Zombies and Headcrabs Zombie: npc_zombie Fast Zombie: npc_fastzombie Poison Zombie: npc_poisonzombie Zombie Torso: npc_zombie_torso Headcrab: npc_headcrab ____ Inputs: burrowimmediate | unburrow Fast Headcrab: npc_headcrab_fast Poison Headcrab: npc_headcrab_poison Birds Crow: npc_crow Pigeon: npc_pigeon Seagull: npc_seagull Allies Vortigaunt: npc_vortigaunt Citizen: npc_citizen ____ Inputs: giveweapon - usage "ent_fire [name of citizen] [weapon {eg weapon_shotgun}]" | setmedic | setammoresupplier | setreadiness Characters setexpressionoverride is an input which allows you to make a character enact any scene. The usage is "ent_fire [character name] setexpressionoverride [file path of scene]". For example, to make alyx perform the gman's closing speech, you would name alyx alyx and type "ent_fire alyx setexpressionoverride scenes\citadel\gman_out". To find scenes, look through the half-life 2 content gcf. Alyx: npc_alyx ____ Inputs: setreadiness | outsidetransition - places her in front of you | setexpressionoverride Barney: npc_barney ____ Inputs: setreadiness | outsidetransition - places him in front of you | setexpressionoverride Breen: npc_breen ____ Inputs: ____ setexpressionoverride Dog: npc_dog ____ Inputs: setexpressionoverride ____ Notes: There are lots of inputs to do with playing catch that I couldn't get to work properly. Dog's AI without scripting is "run away". Eli: npc_eli ____ Inputs: setexpressionoverride ____ Gman: npc_gman ____ Inputs: setexpressionoverride Kleiner: npc_kleiner ____ Inputs: setexpressionoverride Father Grigori: npc_monk ____ Inputs: setexpressionoverride | perfectaccuracy Mossman: npc_mossman ____ Inputs: setexpressionoverride I was saddened to find that Colonel Cubbage was just an npc_citizen, so he can't be sent into battle. Those are all the npcs I currently know of (other than useless ones). To find the name of an npc while playing you can type "ent_show_response_criteria" and it'll come up with their name (along with some other stuff if developer is set to verbose). You can also find npcs in hammer, in the entity dropdown list. I have no idea how to spawn explosive barrels etc or whether it's even possible, but hopefully someone will find a way. Weapon List This is probably incomplete, but the main focus of this guide is spawning npcs and there are already loads of weapon lists out there anyway, so here are the ones I can recall offhand. Crowbar: weapon_crowbar Gravity Gun: weapon_physcannon Pistol: weapon_pistol Revolver: weapon_357 (citizens won't use) Machine Gun: weapon_smg1 Overwatch Rifle: weapon_ar2 Shotgun: weapon_shotgun Crossbow: weapon_crossbow (combine and citizens can't use) Rocket Launcher: weapon_rpg Alyx's Gun: weapon_alyxgun Grigori's Shotgun: weapon_annabelle Stun Baton: weapon_stunstick
Comments on this Article

There are no comments yet. Be the first!