Creating an interaction: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{npc tut}}
{{npc tut}}
==Declaration==
The first step to creating an interaction for your NPC is to create a name for it and add it to the "Interactions" section as well as adding it to <code>src\dlls\hl2_dll\AI_Interactions.h</code> Here's an example name for an activity: '''g_interactionVortigauntKick'''.
The first step to creating an interaction for your NPC is to create a name for it and add it to the "Interactions" section as well as adding it to <code>src\dlls\hl2_dll\AI_Interactions.h</code> Here's an example name for an activity: '''g_interactionVortigauntKick'''.


Line 7: Line 8:
<pre> DECLARE_INTERACTION( g_interactionExample )</pre>
<pre> DECLARE_INTERACTION( g_interactionExample )</pre>
{{note|An interaction should only be declared in one NPC's '''AI_BEGIN_CUSTOM_NPC''' section, regardless of how many NPCs utilize it.}}
{{note|An interaction should only be declared in one NPC's '''AI_BEGIN_CUSTOM_NPC''' section, regardless of how many NPCs utilize it.}}
==Implementation==
{{todo|Implementation}}
{{navbar|Creating a squadslot|Creating an NPC|Creating a schedule}}
{{navbar|Creating a squadslot|Creating an NPC|Creating a schedule}}

Revision as of 13:33, 8 June 2006

Declaration

The first step to creating an interaction for your NPC is to create a name for it and add it to the "Interactions" section as well as adding it to src\dlls\hl2_dll\AI_Interactions.h Here's an example name for an activity: g_interactionVortigauntKick.

Once the activity is added, you must use the DECLARE_INTERACTION macro in the AI_BEGIN_CUSTOM_NPC section.

Here's an example of the DECLARE_INTERACTION code:

	DECLARE_INTERACTION( g_interactionExample )
Note.pngNote:An interaction should only be declared in one NPC's AI_BEGIN_CUSTOM_NPC section, regardless of how many NPCs utilize it.

Implementation

Todo: Implementation