Creating an NPC

From Valve Developer Community
Jump to: navigation, search

Stub

This article or section is a stub. You can help by adding to it.

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? Conditions 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

To start creating your custom task declare a new Enum.

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

Creating a Schedule

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

NPC Relationship Table

Dont Forget to add your NPC in the relationship table