Zombies in DM?

nicatronTg

Newbie
Joined
Oct 18, 2009
Messages
2
Reaction score
0
After trying 3 different fourms, I'm finally here asking the question that I can never get a good answer to. Is it possible to get zombies in half life 2 deathmatch without crashing the server? I know some servers have zombies, but most of course don't.

All help appreciated.
 
I don't think this is possible without making a mod. I believe there's some code on Valve Developer wiki to properly enable npcs in Half-Life 2 Deathmatch.
 
I don't think this is possible without making a mod. I believe there's some code on Valve Developer wiki to properly enable npcs in Half-Life 2 Deathmatch.

By any chance do you know what section it would be under? I hate digging through the valve developer wiki.
 
I don't believe that spawning an NPC will crash a Half-Life 2 Deathmatch server. They are definitely bugged but we used to spawn (read: spam hundreds of) NPCs and get them to "work" without major issues, on our server.

Basically, you have to set it all up yourself but after a while, it isn't too difficult and you can even create your own scripts to spawn them and set them up easily.

First, you must enable server cheats with: sv_cheats "1". After this, you can start to go to work. You'll need to set the health and damage values for the NPCs you intend to spawn. I'll use the zombie as an example. (I am using Episode 2 as a reference, so these variables may be differently named than what they are in Half-Life 2/Deathmatch, but you should be able to find them in the console easily enough. The "find" command does work wonders.)

sk_zombie_health xx
sk-zombie_dmg_both_slash xx
sk_zombie_dmg_one_slash xx
sk_headcrab_health xx
sk_headcrab_melee_dmg xx

Where xx is the value you desire, which you can play around with for something you like, or just look up their original singleplayer values to use here. You could likely use the actual skill.cfg file to automatically set everything by copying it over from Half-Life 2's /cfg/ folder to Half-Life 2 Deathmatch's and typing "exec skill.cfg" once you're in the game, although this may conflict with Half-Life 2 Deathmatch specific settings, so it's best to make your own script or do it manually ingame.

Then we can spawn. You can use the npc_create command to spawn an NPC where you are looking; if it's an enemy that can carry a weapon you can use npc_create_equipment weapon_xxx (xxx being smg1, ar2, shotgun, pistol, etc), and you can additionally use npc_create_aimed so that they spawn with angles that match the direction you're facing.

Here are the simple steps to follow:

1) npc_create npc_zombie

2) ent_fire npc_zombie setrelationship "player d_ht 99" -- this may be able to be done to apply it to every npc_zombie on the map at once, it's been so long and I can't really recall.

3) If step two doesn't work: aim at the zombie and type ent_fire !picker setrelationship "player d_ht 99"

4) If step three fails (I don't believe !picker works in Deathmatch): aim at the zombie and give it a name by typing ent_setname xxx (xxx being what you desire). Then you can type, ent_fire xxx (name) setrelationship "player d_ht 99"

5) If you want them to attack other NPCs you'll do essentially the same thing as step 2-4 as they work, except with player replaced with a specific NPC's name that you've given it, or a specific npc_ entity name such as npc_combine_s. If you wish to make them stop attacking another NPC or the player simply put d_li in place of d_ht.

Now they should attack you, but they probably won't make noises and will appear to be skipping or somewhat laggy, and will be bugged, but they do work.
 
Back
Top