Creating an NPC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
Conditions show what is going on to the NPC. Are they drowning? Are they blocked? Are they on fire? Coditions tell the NPC to act accordingly to what is happening.
Conditions show what is going on to the NPC. Are they drowning? Are they blocked? Are they on fire? Coditions tell the NPC to act accordingly to what is happening.


First, create a name for the [[Condition|condition]] you're making, and add it to the [[Enumeration|Enum]]. Once you have added the condition to the Enum, use the '''DECLARE_CONDITION''' macro in the '''AI_BEGIN_CUSTOM_NPC''' section.
First, create a name for the [[Condition|condition]] you're making, and add it to the [[Enumeration|Enum]]. Once you have added the condition to the Enum, use the '''DECLARE_CONDITION''' [[Wikipedia:Macro|macro]] in the '''AI_BEGIN_CUSTOM_NPC''' section.


== Creating a Task ==
== Creating a Task ==

Revision as of 22:40, 25 July 2007

In this tutorial we're going to create an functional NPC.

(

Todo:  Finish tutorial

)

Defining the NPC

Main article:  Defining the NPC

To begin the creation of your NPC you must first create a definition for it. The first step is to copy Npc_New.cpp to a new file. Next, make changes to the Precache, Spawn, and Classify functions.

Giving an NPC Memory

Main article:  Giving an NPC Memory

Creating a Condition

Main article:  Creating a condition

Conditions show what is going on to the NPC. Are they drowning? Are they blocked? Are they on fire? Coditions tell the NPC to act accordingly to what is happening.

First, create a name for the condition you're making, and add it to the Enum. Once you have added the condition to the Enum, use the DECLARE_CONDITION macro in the AI_BEGIN_CUSTOM_NPC section.

Creating a Task

Main article:  Creating a task

Creating an Activity

Main article:  Creating an activity

Creating an Animevent

Main article:  Creating an animevent

Creating a Squadslot

Main article:  Creating a squadslot

Creating an Interaction

Main article:  Creating an interaction
Note.pngNote:This tutorial isn't completely done, yet.