Task: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Redirected page to Creating a task)
Line 1: Line 1:
A '''task''' is a logical step in a [[schedule]], it can be seen as a sequential set of steps the NPC must take in order to accomplish a schedule.
#redirect [[Creating a task]]
 
A '''task''' becomes latent if TaskComplete() or TaskFail() isn't called.  Meaning the schedule will not procede to the next '''task''' until the current one has been taken care of.
 
If a '''task''' fails the schedule will fail and exit. It will NOT proceed to the next '''task'''.
 
 
 
'''''ADDING A TASK TO A NPC CLASS'''''
*Add the task to an enum declaration in your class :
<pre>
enum
{
    TASK_ONE = BaseClass::NEXT_TASK,
    TASK_TWO,
    TASK_THREE,
}
</pre>
 
 
*Declare the task below the AI_BEGIN_CUSTOM_NPC(...) using the DECLARE_TASK(...) macro.
 
*Add your case to the StartTask()
 
*Add your case to RunTask() ( needed if TaskComplete() not called in StartTask() )
 
 
==See Also ==
*[[Creating a task]]
*[[Shared tasks]]
 
 
 
[[Category:AI Programming]]

Revision as of 11:31, 15 September 2011

Redirect to: