Difference between revisions of "Creating an activity"

From Valve Developer Community
Jump to: navigation, search
 
m (used define from npc_new)
Line 5: Line 5:
  
 
Here's an example of the DECLARE_ACTIVITY code:
 
Here's an example of the DECLARE_ACTIVITY code:
<pre> DECLARE_ACTIVITY( ACT_COMBINE_BUGBAIT )</pre>
+
<pre> DECLARE_ACTIVITY( ACT_NEWNPC_ACTIVITY )</pre>
 
{{note|It is not necessary to declare shared activities.}}
 
{{note|It is not necessary to declare shared activities.}}
 
{{navbar|Creating a task|Creating an NPC|Creating an animevent}}
 
{{navbar|Creating a task|Creating an NPC|Creating an animevent}}

Revision as of 20:01, 8 June 2006

The first step to creating an activity for your NPC is to create a name for it and add it to the enum. Here's an example name for a activity: ACT_COMBINE_BUGBAIT.

Once the activity is added to the enum, you must use the DECLARE_ACTIVITY macro in the AI_BEGIN_CUSTOM_NPC section.

Here's an example of the DECLARE_ACTIVITY code:

	DECLARE_ACTIVITY( ACT_NEWNPC_ACTIVITY )
Note:It is not necessary to declare shared activities.



Creating an NPC
Creating a task
Creating an animevent