Task: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
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. | 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. | ||
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 : | |||
enum | |||
{ | |||
TASK_ONE = BaseClass::NEXT_SCHEDULE, | |||
TASK_TWO, | |||
TASK_THREE, | |||
} | |||
''EDITOR: Can the code box wrap around the entire enum declaration?'' | |||
*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() ) | |||
[[Category:AI Programming]] | [[Category:AI Programming]] |
Revision as of 12:05, 25 October 2006
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.
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 :
enum {
TASK_ONE = BaseClass::NEXT_SCHEDULE, TASK_TWO, TASK_THREE,
} EDITOR: Can the code box wrap around the entire enum declaration?
- 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() )