Nuclide
Software Development Kit for id Technology (BETA)
|
Scheduled tasks for computer controlled characters. More...
Scheduled tasks for computer controlled characters.
Computer controlled NPC actors execute tasks within the game-world as part of a Schedule.
Schedules are defined within decl exclusively.
A schedule decl looks something like this:
You will pass the name dodgeEnemyFire
to ncSchedule::CreateSchedule() to assign the the above decl, if defined, to the targetted actor.
The actor will then iterate over each of the task_
keys, until it finishes every task in the named schedule.
You can also define when a schedule should end, besides when it's running out of tasks. Specifying a named output of an actor (such as OnLightDamage
) will, if activated, trigger this schedule's' EndTask
input.
A task is a single action that an NPC can perform. They are routinely part of a Schedule.
A task is merely a predefined Input. So anything an Input can provide, can be utilized in a task.
NPC classes call ncActor::SelectNewSchedule() routinely to find a new purpose within the game world.
The function will then return the handle of a new ncSchedule, or NULL if it's unable to do anything at all.
The NPC will then automatically perform the named schedule, if it is valid of course.
When debugging schedules, it is most convenient to use the following Input for this task:
Will tell an actor with the entity id 125 to perform the named schedule foobar
.
Classes | |
class | ncSchedule |