Home | Trees | Index | Help |
---|
|
act()
method, which performs actions in an
attempt to complete the task. Each time the act()
method is
called, it returns a TaskResult
, indicating what action should
be taken next by the script:
Finished
: Move on to the next task.
Wait
: Wait the given amount of time,
and try the task again.
DoFirst
: Perform the given list of
subtasks first, and then try the task again.
DoInstead
: Perform the given list of
subtasks instead.
Failed
: The task could not be
completed; notify the parent task (if any).
Note that DoFirst
and DoInstead
can be used
to spawn sub-tasks, leading to a depth-first "tree" of
tasks.
EndTask
to the end of the the script's task
list.
To Do: Add interrupts
Method Summary | |
---|---|
Create a new script. | |
check_interrupts(self,
level)
| |
check_timeouts(self,
level,
duration)
| |
Perform a single action for this script. | |
_debug_get_depth(self,
task)
| |
_handle_result(self,
result,
level)
|
Instance Variable Summary | |
---|---|
interrupts : A list of 'interrupts' that we should check (how often?). | |
update_delay : How long has it been since the last time this script's update was
called. | |
update_interval : How long should the game engine wait between calls to this script's
update. |
Class Variable Summary | |
---|---|
bool |
debug = False
|
Method Details |
---|
__init__(self,
*tasks)
Create a new script.
|
check_interrupts(self, level) |
check_timeouts(self, level, duration) |
step(self, level, duration)Perform a single action for this script. |
_debug_get_depth(self, task) |
_handle_result(self, result, level) |
Instance Variable Details |
---|
interruptsA list of 'interrupts' that we should check (how often?). Each interrupt is a pair (Condition, task), where we'll jump streight to task & report the interrupt. |
update_delayHow long has it been since the last time this script's update was called. |
update_intervalHow long should the game engine wait between calls to this script's update. |
Class Variable Details |
---|
debug
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:44 2005 | http://epydoc.sf.net |