custom npc is being retarted

  • Thread starter Thread starter Kobnar
  • Start date Start date
K

Kobnar

Guest
I recently created a copy of the "citizen17" cpp and h files to create my own npc. I finally got that version of the npc, npc_underground, to work perfectly but when I went and made another version of that npc, npc_militia, the npc_militia just sits there like a retard. I've defined my classes in baseentity.h and hl2_gamerules.cpp. If anyone knows what else might be wrong that'd be great. thx
 
Well the first thing that is wrong is the fact that you posted this thread in the wrong forum.
 
It's a code problem, so it's in the right place.

Are you sure you're inheriting from the right class? Make sure they're both inheritances of the Citizen17 class.

Oh, and if it's made as an enemy, make sure that when you add it into a map, you give him a weapon and some info_nodes to walk around. Otherwise, he won't do much.

-Angry Lawyer
 
Angry Lawyer said:
It's a code problem, so it's in the right place.

Are you sure you're inheriting from the right class? Make sure they're both inheritances of the Citizen17 class.

Oh, and if it's made as an enemy, make sure that when you add it into a map, you give him a weapon and some info_nodes to walk around. Otherwise, he won't do much.

-Angry Lawyer
It was in off-topic first. ;)

So now it's in the right place.
 
Yeah well I successfully made a copy of the citizen17 files to make the "underground". I sifted through the citizen code and made sure that I changed all the classes and action names but saved all of the references to the citizen actions and animations so that they acted like citizens n'junk. They work GREAT (as in shoot stuff... run... hide... hide again... jump... they even scream when they see a combine :))

Now I copied THAT file and changed (almost) EVERYTHING with "UNDERGROUND" "Underground" "underground" "UN_" "_UND" and any other reference to the underground with their mirrors with the "Militia" type. I then went and recognized the entity class in "BaseEntity.h" as "CLASS_MILITIA" and created another table for them in "hl2_gamerules.cpp".

I know the class is working as well as their alignments because I can successfully change them to be rebels and all of their enemies attack them like they should (eg: combine, underground, headcrabs, etc..) I've gone through the code a bunch of times looking for differences between the underground code and the militia code with no results. I was just wondering if anyone knew *specifically* where the code is that makes them FREAKING IDEOTS.... god.

Anyways if anyone has any ideas (I know it's hard to know what is wrong wihtout the code but posting 6 different ".cpp" and ".h" files is just a bad idea) it'd be great. I'm going to lock up that part of the code tonight so me and my friend can get onto beginning our level editing so it's not THAT bad... just confusing.
 
Woah, why did you copy the entire file, instead of inheriting from the original one???
Try changing your goodguy one's relationship to badguy for a moment, check if it's something deeper than transcription error.

-Angry Lawyer
 
Well first I did that for multiple reasons.
- 1. I wanted to be able to take stuff out as well as add it (healing, AI.. etc) incase I felt I needed too.
- 2. As of a week ago I didn't know ANY C++ so I decided to do it the long tediouse way of copying everything over so I could get a grasp of how this language works in action.
- 3. derrr... ok there where more but these are the two big ones.

Also, I know it is a transcription error. I already tried changing the classes and relationships. For example: If I change the "CLASS_MILITIA" of the militita to "CLASS_UNDERGROUND" it still acts retarted where as it works perfectly for the underground.

No matter, however, I've decided to move on because I've been spending almost a week creating the underground alone and it won't be that much of an impact to the story of my mod if the Militia and the Citizens are one and the same.

Now onto importing the Bullsquid and Houndeye! BWUHUHAhAHAHA!
 
Now onto importing the Bullsquid and Houndeye! BWUHUHAhAHAHA!

speak'n of which.... I just imported all of the bullsquid's code and am "borrowing" the model form the bullsquid mod for HL2.

What does it mean when Hammer tells me
Error VTX File models/bullsquid.dx80.vtx checksum 2134457962 should be -2144006038

Grr this just may take a while longer than I had hoped...
 
Bwuh, that's a modelling problem. But I'd guess you need to recompile the VTX, because there's an error in it.
A checksum is a number on the end of a file or string of data that a computer checks against a number it generates by looking at the rest of the file. If they match, the computer knows that the file is okay. If it returns as different, then the computer knows in advance that the data is incorrect.

-Angry Lawyer
 
Back
Top