Defining the NPC

From Valve Developer Community
Revision as of 12:30, 24 November 2007 by TrocoRerri (talk | contribs)
Jump to navigation Jump to search

fetishes premiership football result brothers gay sex free black ghetto sex movies pay what you can celebrity hardcore megan good nude teen fingering herself brooke berry lesbian sister flash intros orange extract recipe effects of stress on the nervous system unix web hosting online pharmacy canada tennis girl mistress domina strap on opera bastille paris france caveman kaspersky antivirus forsake the troops amazing pictures midway limousine service boat loans totally free stuff tree climber penthouse videos big chested girls slutty teachers ninel conde black and white bigbooty international journal of sociology of language chopard watch teen snatch apartments in california for rent video stock footage older woman personal apartment rentals woman naked stonybrook university long island ny granny sex extreme bizarre 04 robbie williams mp3 wetivette moscow police station rehab little girl nude is in search of hardcore mature old phone ringing atlantic electric and gas website layered hair cuts kstp nights into dreams music downloads eds emily deans geckos famke janssen sexy espn sports guy internet auctions abs workout car models six of one interracial creampie suck tit milk pasadena home and garden show moving boxes ginger pubes teen cuties in tight thongs cuckold sissy human brain labeling machinery texas federal courts google stock sex advice young lesbian girls stripping women naked how to have better sex preteenz image search pain med wham hooligans mp3 patron saints spiderman 3 top converting downloader new balance walking shoes gay mature new york weight loss spa fingering lesbians lauren graham eva nude beach babe big rack public nip slips free tarot reading jet blue airway girl boy drives

To start your NPC, you must create a definition for it first.

  1. Copy npc_New.cpp to a new file related to the classname.
    Example: src\dlls\hl2_dll\npc_Barney.cpp
  2. Make appropriate changes to the Precache, Spawn, and Classify functions. Precache should include calls to UTIL_PrecacheOther for all entities this NPC creates as well as PrecacheScriptSound for all script sounds this NPC emits. Follow the subprocedure below if you want a custom class for the NPC.
    1. Add the new class to the first enum Class_T in src\dlls\BaseEntity.h before NUM_AI_CLASSES.
      Note.pngNote:This modification will require a rebuild of the server solution because BaseEntity.h is included in cbase.h
      Example class: CLASS_COMBINE
    2. Navigate to your gamerules file (hl2_gamerules.cpp) and go to InitDefaultAIRelationships.
    3. Copy one of the blocks of SetDefaultRelationship with a uniform first parameter (i.e. the first block: CLASS_ANTLION) and paste it at the end of the function.
    4. Replace the first parameter of the pasted code with your new class from Class_T.
    5. Change the disposition (i.e. D_NU) to the desired one from enum Disposition_t in src\dlls\BaseCombatCharacter.h.
    6. Change the priority (i.e. 0) of the relationship to the desired one.
      Note.pngNote:A higher priority means this NPC will pay the most attention to the target class.
    7. Go through every block of SetDefaultRelationship and add the new class to it as the second parameter.
  3. Note the AI_BEGIN_CUSTOM_NPC section. This will be an important section for later steps.
Return to Creating an NPC Giving an NPC Memory