Super happy NPC spawning guide

Status
Not open for further replies.

MagicalMonkey

Newbie
Joined
Nov 23, 2004
Messages
69
Reaction score
0
Here's some info on how to spawn different NPCs and how to have fun with them. I'm pretty much certain it's incomplete so contribute anything I've missed and I'll edit it into this post with credit.

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".

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 another 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.

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 | <set/clear>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.


Wildlife

Antlions

Antlion: npc_antlion ____ Inputs: <hear/ignore>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

Headcrab: npc_headcrab ____ Inputs: burrowimmediate | unburrow

Fast Headcrab: npc_headcrab_fast

Poison Headcrab: npc_headcrab_poison


Allies

Vortigaunt: npc_vortigaunt

Citizen: npc_citizen ____ Inputs: giveweapon - usage "ent_fire [name of citizen] [weapon {eg weapon_shotgun}]" | setmedic<on/off> | setammoresupplier<on/off> | setreadiness<low/medium/high>


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".

Alyx: npc_alyx ____ Inputs: setreadiness<low/medium/high> | outsidetransition - places her in front of you | setexpressionoverride

Barney: npc_barney ____ Inputs: setreadiness<low/medium/high> | 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<on/off>

Mossman: npc_mossman ____ Inputs: setexpressionoverride


Those are all the npcs I currently know of. 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).

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.

I have no idea how to spawn explosive barrels etc or whether it's even possible, but hopefully someone will find a way.

I think that's about it. Hope it's of some use.
 
thanks monkey!

EDIT: do you know how to get rid of dead bodies? besides throwing them a million miles away...

edit: do you need to put thew sniper with a certin weapon for them to shoot?
 
ktimekiller said:
thanks monkey!

EDIT: do you know how to get rid of dead bodies? besides throwing them a million miles away...

edit: do you need to put thew sniper with a certin weapon for them to shoot?

I think you can remove them with impulse 203 if you're holding them with the blue grav gun. Other than that, I have no idea. That's the problem with big battles, but you can always reload maps when things start to lag (type "map [map name]" in the console, the map names all come up underneath the console).

Whenever I spawn a sniper they stand there motionless with a blue line moving around in front of them. Whenever I stand in front of them they shoot me.
 
Are the npcs scalable? If so, what's the command? I saw a screenshot once of a vortigaunt as tall as a strider.
 
I'm yet to find a way to rotate the snipers... they're rather cheap, they're just like the "cardboard cutouts" that Valve used in the first game. Totally invulnerable to everything except explosives- it'd have been far better to have had snipers as differently-equipped Combine soldiers, in my book.

There's apparently a way to force friendlies to drop their current weapon, as well as making them switch to a different one- anyone shed a little light on that?

We're all still to find the options that make a Combine Elite a Combine Elite, and what makes a turret friendly (although turret_buddy and setrelationship obviously have something to do with it)...
 
i found out that the citizen doesnt work work crossbow and shotgun, crossbow, they dont shoot, but still have regular ai. if they have shotgun, they shoot, they run away, but they just wont follow you. and when i tried rocket as weapon, the citizen spawned without a weapon. what are the command for the submachine gun? does the combines work with the rocket?

and whenever i try the ent_info, it says name it, so i type in citizen, nothing happens, so i point at the citizen, and type ent_name citizen, then i tried it, nothing. how do i do it? and can you give me an example? like a citizen thats a medic, or gives ammo, or a combine that can toss the man hack, plz i wanna know how~
 
Well, "weapon_rpg" gives a citizen a rocket launcher, and they seem to use it fairly well in my experience. For the SMG, "weapon_smg2"- for either citizens or the Combine soldiers.

The soldiers don't work properly with an RPG- thus far, I've seen them fire it once or twice but spend most of their time milling around. They're also missing a lot of the relevant animations, and so they end up going stiff limbed for those actions they're not meant to perform.
 
(Fragger) said:
Are the npcs scalable? If so, what's the command? I saw a screenshot once of a vortigaunt as tall as a strider.
That is impossible. What you saw was a vortigaunt standing in the skybox. (Located in some remote aread of the map)
 
Heres my list:

Well now that most of us have finished the game I thought we
could have a little fun with the

characters,enemies, and such.

Below is a list of all the spawning commands that I know of, feel free to add more in a post.
All commands are listed so that you can just copy and paste them into your config located in

steam/steamapps/youremail/half-life2/hl2/cfg

You can also use them in game from the console but take note that if you bind them while in the game they

will not save and must be re-entered.

To enable the console go to your options menu, click keyboard,click advanced, and check off the Enable

developer console option.

Note: for best spawning abilities set sv_cheats 1,god,notarget,noclip and impulse 101 for all weapons.
If you wish to "pause" the action set ai_disable and you will be free to set things up without the ai

attacking each other.

Quick explanation of commands:
npc_create_equipment weapon_smg1 (gives the npc your spawning a weapon to use. Replace smg1 with the

weapon of your choice.Working weapons:smg1,ar2,shotgun,crowbar,rpg,annabelle,alyxgun)
Note: The annabelle and alyxgun can be picked up or spawned using the give command.
The annabelle is Grigori's shotgun and is 100% accurate. The Alyxgun is glitchy and "floats" in front of

you when used.
Give (gives you any item you specify or spawns an npc inside you sv_cheats must be set to 1)
npc_create (spawns the npc of your choice inside your reticule)

IMPORTANT: When using the npc_create command, the npc will always spawn wherever your reticule is

pointing at as long as it is a solid object.
The give command will always spawn things inside of you.(striders for example only work with the give

command)

Here are the commands that I know of: (change key to your key of choice)
Combine Soldiers:
bind "q" "npc_create_equipment weapon_ar2; wait; npc_create npc_combine_s"
bind "s" "npc_create_equipment weapon_smg1; wait; npc_create npc_combine_s"
bind "u" "npc_create_equipment weapon_shotgun;wait;npc_create npc_combine_s"
bind "x" "npc_create_equipment weapon_rpg;wait;npc_create npc_combine_s"
bind "c" "npc_create_equipment weapon_annabelle;wait;npc_create npc_combine_s"
bind "v" "npc_create_equipment weapon_alyxgun;wait;npc_create npc_combine_s"

Resistance Fighters: (They look different depending on the level)
bind "w" "npc_create_equipment weapon_shotgun; wait; npc_create npc_citizen"
bind "b" "npc_create_equipment weapon_ar2;wait; npc_create npc_citizen"
bind "n" "npc_create_equipment weapon_rpg;wait; npc_create npc_citizen"
bind "m" "npc_create_equipment weapon_smg1;wait; npc_create npc_citizen"
bind "o" "npc_create_equipment weapon_crowbar;wait; npc_create npc_citizen"
bind "p" "npc_create_equipment weapon_annabelle; wait; npc_create npc_citizen"
bind "r" "npc_create_equipment weapon_alyxgun; wait; npc_create npc_citizen"

Zombies/headcrabs:
bind "[" "npc_create npc_headcrab"
bind "]" "npc_create npc_heacrab_fast"
bind "\" "npc_create npc_headcrab_poison"
bind "y" "npc_create npc_poisonzombie"
bind "a" "npc_create npc_zombie"
bind "t" "npc_create npc_fastzombie"

Antlions:
bind "e" "npc_create npc_antlion"
bind "k" "npc_create npc_anlionguard"

Important Characters:
bind "j" "npc_create npc_eli"
bind "h" "npc_create npc_kleiner"
bind "g" "npc_create npc_dog"
bind "1" "npc_create npc_barney"(Can be armed using the equipment command)
bind "2" "npc_create npc_alyx"(Can be armed using the equipment command)
bind "3" "npc_create npc_breen"
bind "4" "npc_create npc_gman"
bind "5" "npc_create npc_monk"(Father Grigori)(Can be armed using the equipment command)
bind "6" "npc_create npc_mossman"
bind "7" "npc_create npc_vortigaunt"(Attacks enemies)

Glitchy/Nonworking spawns:
bind "key" "npc_create npc_stalker"(Experimented people you see in Nova Prospekt,walk slowly and fire

lasers at you or enemies)WARNING: If killed the game will crash.
bind "key" "npc_create npc_combine"(Most likely the big blob you see Breen talking to)WARNING: Game

crashes when attempting to spawn.
bind "key" "npc_create npc_ichthyosaur"(Spawns the old HL monster inside the ground unless you use the

give command which cause the monster to "fly" in circles towards the ground)
bind "key" "npc_create npc_barnacle"(Creates a barnacle that hovers about one inch from the ground, the

give command works best but causes the game to crash)
bind "key" "npc_create npc_strider"(spawns a strider in the ground unless used with the "give"

command,strider is immobile but will shoot at its enemies and impale any hapless citizen if they get too

close)

Miscellaneous:
bind "key" "npc_create npc_manhack"
bind "key" "npc_create npc_crow"(Doesn't do anything except maybe look good next to the Gman)
bind "key" "npc_create npc_pigeon"(Flies away when spawned)

Vehicles:
ch_createjeep
ch_createairboat

Like I said these are all the spawns that I currently know of, if you know how to spawn furniture and such please post.
 
Level listing: Open console and type changelevel (levelname)
d1_trainstation_01
d1_trainstation_02
d1_trainstation_03
d1_trainstation_04
d1_trainstation_05
d1_trainstation_06
d1_canals_01
d1_canals_01a
d1_canals_02
d1_canals_03
d1_canals_04
d1_canals_05
d1_canals_06
d1_canals_07
d1_canals_08
d1_canals_09
d1_canals_10
d1_canals_11
d1_canals_12
d1_canals_13
d1_eli_01
d1_eli_02
d1_town_01
d1_town_01a
d1_town_02
d1_town_02a
d1_town_03
d1_town_04
d1_town_05
d2_coast_01
d2_coast_03
d2_coast_04
d2_coast_05
d2_coast_07
d2_coast_08
d2_coast_09
d2_coast_10
d2_coast_11
d2_coast_12
d2_prison_01
d2_prison_02
d2_prison_03
d2_prison_04
d2_prison_05
d2_prison_06
d2_prison_07
d2_prison_08
d3_c17_01
d3_c17_02
d3_c17_03
d3_c17_04
d3_c17_05
d3_c17_06a
d3_c17_06b
d3_c17_07
d3_c17_08
d3_c17_09
d3_c17_10a
d3_c17_10b
d3_c17_11
d3_c17_12
d3_c17_12b
d3_c17_13
d3_citadel_01
d3_citadel_02
d3_citadel_03
d3_citadel_04
d3_citadel_05
d3_breen_01

Instead of going through more than half of a chapter just to get to that special spot you wish to spawn

in, you can use the changelevel command to go straight there.
 
Is there a way to set the health of a npc when they spawn so that they can't be killed or die instantly?
 
fd9 said:
Is there a way to set the health of a npc when they spawn so that they can't be killed or die instantly?

npc_create [npc name]; wait; ent_setname heal; wait; ent_fire heal sethealth [number]
 
I have been looking for something like this. THANKS!
 
Another zombie

Zombie Torso: npc_zombie_torso

Miscellaneous Useless Things

Crow: npc_crow
Pigeon: npc_pigeon
 
Hmm, at one point I accidentally named a weapon_shotgun and when I triggered an "ignite" the two citizens escorting me suddenly had flaming shotguns... it was really damn weird, and I haven't been able to recreate the effect...
 
ktimekiller said:
monkey, plz explain the ent thing, i dont get it

To make npcs do something you have to name them with ent_setname and tell them to do it using ent_fire. So you would look at someone and name them person by typing "ent_setname person" into the console, and then set them on fire by typing "ent_fire person ignite".

ent_setname [name]; ent_fire [name] [input]
 
hmm now all we need is for someone to work out what physical objects names are and i can finally build the barrel pyramid

hmmm ch_createboat.... maybe something like that, ill dig around and see if i can work it out
 
im gonna use gcfscape to open up the files and see if i can find some more interesting things to play with...will update shortly

edit: i've busted open source shared files gcf file.... :D :D :D it looks good so far, im not sure on how exactly to spawn these tho... do urselves a favor and hav a look too, see what you's can come up with.

edit2: :frown: cant find generic props anywhere

edit3: i'll start a new thread, dont want to derail this one
 
Has anyone figured out how to spawn Lamarr yet? Just to point out it does not have the same model as a normal headcrab so it's not just npc_headcrab or whatever.
 
ktimekiller said:
thanks monkey!

EDIT: do you know how to get rid of dead bodies? besides throwing them a million miles away...

edit: do you need to put thew sniper with a certin weapon for them to shoot?
There's a couple of commands for removing entities, one seems to work, one doesn't, use the find command and you should get them both (I don't remember them off hand now, sorry)
 
MagicalMonkey said:
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".

Can you post all the different scenes we can use from the game? Or tell me where I can find them. Thanks.
 
Has anyone managed to get a major character's corpse and the blue grav gun together in the same map? The character just disappears when I try it .
 
Dark Auro said:
Can you post all the different scenes we can use from the game? Or tell me where I can find them. Thanks.

There are a hell of a lot of scenes. They're all located in the half-life 2 content gcf. You have to use the path from scenes, so scenes\[chapter]\[scene]. I probably should have mentioned that in the first post.

Villevalo said:
edit3: i'll start a new thread, dont want to derail this one

I think it'd be quite useful to have info on spawning NPCs and spawning items in one thread. Most people reading this would be interested in spawning barrels etc. Although I suppose it could make info harder to find, so maybe post a link to your thread here?
 
The Dark Elf said:
There's a couple of commands for removing entities, one seems to work, one doesn't, use the find command and you should get them both (I don't remember them off hand now, sorry)

Look at someone you want to remove: ent_remove

Then there is ent_remove_all <npc class> so it could be ent_remove_all npc_combine_s

That removes all Combine soldiers.
 
If anyone could look into finding out how to spawn ITEMS, barrels, explosive barrels, ect ect! ahh... imgine the possabilitys ! tanks
 
Could someone be a nice person and make a video of one of these massive battles? (20 combines vs. 20 resistance fighters vs. 20 ant lions vs. 20 speedzombies vs. 5 ant lion guards...) Should be fun and a good way to get some fame by editing it to a video with some heroic music :)
 
PvtRyan said:
Look at someone you want to remove: ent_remove

Then there is ent_remove_all <npc class> so it could be ent_remove_all npc_combine_s

That removes all Combine soldiers.
that only works with alive bodies
 
What is cool, is the AI of the combine soldiers :)

If you spawn a squad of four, one with the assualt rifle, two with the mp7 and another with a shotty, you'll see on maps like coast how the one with the assault rifle will hang back and pick of targets, the two sub machine gunners will have the middle ground, most of the time flanking who ever it is (e.g. when i had these 4 against some resistance members, one of the SMG'ers ran round up onto of a cliff, and shot them from there killing them all heh), and the shotgunner just charges in, and reloads running back as the others carrying on firing.

At least I thought it was impressive :p
 
When you assign a name that has already been used, what happens? Will it still work? So could you have a command that does

name entity xxx
ignite xxx

and go round igniting people you're pointing at?

or will the naming fail :( ?
 
So technically if I'd want to spawn G-man and make him go on about with the ending speech, what excactly would you type in the console??
 
Has anyone found out any other commands like the ignite? I love setting everything on fire but I was wondering if there are any commands that can make people/things explode like a grenade was right under them or something.
 
Hey, what are the weapon entities for making Combines spawn with stuff? I only know shotgun and smg1. please help. Also, can you spawn tuurets?
 
Peabody McFee said:
npc_stalker

I included that in the first post, it crashes the game when it dies and doesn't do much while it's alive.

Weapon entities:

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

There are others.
 
Sorry for the double post, I was checking the inputs to these and the time limit expired.

More miscellaneous combine

Floor turret: npc_turret_floor ____ Inputs: toggle | enable | disable

Ceiling turret: npc_turret_ceiling ____ Inputs: toggle | enable | disable
 
Status
Not open for further replies.
Back
Top