cloning an NPC

Joined
Feb 21, 2005
Messages
304
Reaction score
0
Hi. I am trying to clone (copy and paste) the coding and AI of specific HL2 NPCs to use as separate enemy NPCs for my mod. I'm creating many many enemies in my SP mod and they each need their own individual models, and sounds. FOr example, I'm probably going to use the NPC_Zombie AI for at least 4 other Monsters.

My problem is I dont really know where to start. I can't find any information online about how to copy an NPC and set different models animations and sounds/directories for it. Can anyone here put me on the right path? Thanx a ton.
 
Just look for the relevant .cpp and .h file, copy and rename them, find&replace, simple.

If you know C++, you should'nt have a problem, if you don't, go learn it, get a c++ book, learn to love the language before learning how to mod.

C++ is a beautiful (although sometimes obscure compared to others) OOP language that deserves a lot of respect :)
 
In the case of the Zombie.cpp, there are three different zombie creatures under the file. Just create a new class, inheriting from the CBaseZombie, or something similar. After that, override the functions you want changed. Pretty simple stuff, it's the first thing I learnt to do when I started my coding voyage with HL1.

-Angry Lawyer
 
Back
Top