Creating a Custom NPC

blackiris

Newbie
Joined
Oct 15, 2007
Messages
81
Reaction score
0
Hello everyone.
Now I know that questions surrounding the subject of creating an entirely new NPC have been raised countless times before. I've searched along with many others, through threads on any HL2 editing site to be found. And yet there seems to be no walk through guide to help any of us out who are new to programming and modding.

So what I'm asking is, does anyone know of any guide out there that walks you through the process of creating a new NPC for a HL2 Mod? I've checked out the NPC tutorials on the Valve Developer Community (http://developer.valvesoftware.com/wiki/Creating_an_NPC) but the directions there seem vague and difficult to understand for someone who has only just started out with programming.

If a guide detailing the steps to create an NPC from the ground up does not yet exist, would it be possible for someone who has experience with such a topic to kindly take the time to write up such an article. It doesn't have to be complicated, maybe something as simple as getting a character to walk around in game.

I know this is a big ask, but I can safely say that not only would a tutorial covering the creation of an NPC benefit myself, but it would greatly benefit the rest of the modding community. Surely someone out there would be kind enough to share their knowledge on the subject.
 
It's easy - simply copy+paste a NPC created by Valve, and rename it's entity name. There you got a new NPC class.
 
It's easy - simply copy+paste a NPC created by Valve, and rename it's entity name. There you got a new NPC class.

Serious? That's all there is to it? I was just experimenting with cloning father Gregori, although I accidentally went out of the file without saving and lost the .cpp file altogether. Do I have to add any entries for the new NPC anywhere else in the SDK such as in base_entity?

Thanks for the reply by the way Barnz, really appreciate the helping hand.
 
you should only copy+paste cpp, that should do it - there's an example npc template, but it's useless since it's easy to create new one by copying it.
 
Thanks Barnz, you have no idea how much I appreciate your help! I actually got it working. I've successfully cloned a Zombine, (and a few others NPC's) and after getting rid of a few minor errors, they work perfectly. :D. I've set about doing some further editing, I'm actually hoping to mold the zombine into my own creation later on down the track.
So thanks again.
 
Sorry to ask a question on a resolved problem but, I'm trying to do the same thing, where exactly do I put my modified .cpp file?
 
You need to compile the modified .cpp file along with the rest of the mod code.
 
Back
Top