Creating an NPC
From Valve Developer Community
Creating an NPC
In this tutorial we're going to create an functional NPC.
(
To do: Finish tutorial)
| Table of contents |
[edit]
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.
[edit]
Giving an NPC Memory
- Main article: Giving an NPC Memory
[edit]
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.
[edit]
Creating a Task
- Main article: Creating a task
To start creating your custom task declare a new Enum.
[edit]
Creating an Activity
- Main article: Creating an activity
[edit]
Creating an Animevent
- Main article: Creating an animevent
[edit]
Creating a Squadslot
- Main article: Creating a squadslot
[edit]
Creating an Interaction
- Main article: Creating an interaction
[edit]
Creating a Schedule
- Main article: Creating a schedule
| ← Back to Creating an NPC | Return to Creating an NPC | Continue to Defining the NPC → |

