Creating a task: Difference between revisions
Jump to navigation
Jump to search
Note:It is not necessary to declare tasks inherited from the BaseClass
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{npc tut}} | {{npc tut}} | ||
==Declaring the task== | |||
The first step to creating a task for your NPC is to create a name for it and add it to the enum. Here's an example name for a task: '''TASK_COMBINE_DIE_INSTANTLY'''. | The first step to creating a task for your NPC is to create a name for it and add it to the enum. Here's an example name for a task: '''TASK_COMBINE_DIE_INSTANTLY'''. | ||
Line 7: | Line 8: | ||
<pre> DECLARE_TASK( TASK_NEWNPC_TASK )</pre> | <pre> DECLARE_TASK( TASK_NEWNPC_TASK )</pre> | ||
{{note|It is not necessary to declare tasks inherited from the BaseClass}} | {{note|It is not necessary to declare tasks inherited from the BaseClass}} | ||
==Implementing the task== | |||
{{todo|Implementing the task}} | |||
{{navbar|Defining the NPC|Creating an NPC|Creating an activity}} | {{navbar|Defining the NPC|Creating an NPC|Creating an activity}} |
Revision as of 13:32, 8 June 2006
Declaring the task
The first step to creating a task for your NPC is to create a name for it and add it to the enum. Here's an example name for a task: TASK_COMBINE_DIE_INSTANTLY.
Once the task is added to the enum, you must use the DECLARE_TASK macro in the AI_BEGIN_CUSTOM_NPC section.
Here's an example of the DECLARE_TASK code:
DECLARE_TASK( TASK_NEWNPC_TASK )

Implementing the task
Todo: Implementing the task