Package pajammin :: Package ai :: Package script :: Module walker :: Class WalkUpToEntity
[show private | hide private]
[frames | no frames]

Type WalkUpToEntity

object --+    
         |    
      Task --+
             |
            WalkUpToEntity


Move the agent so that it is standing next to the given target entity, and facing towards it. This task uses the path planner to choose a route to the destination. If the path planner cannot find a task, or if the task fails to complete one of the links in the path, then this task will fail.
Method Summary
  __init__(self, agent, target, mindist, maxdist, timeout)
  act(self, level)
Attempt to accomplish this task, by examining and/or modifying the level; and should return a TaskResult object, indicating what action should be taken next.
    Inherited from Task
  __repr__(self)
  initialize(self, level)
This method is called when a script starts using this task.
  interrupt(self, level, condition, task_stack)
Attempt to accomplish this task, given that an interrupt condition occured.
  recover(self, level, failed_subtask, remaining_subtasks, failure_info)
Attempt to accomplish this task, given that a subtask failed.
  register(cls, *typesignature)
Register this task class as a task that can be used in the task list of a script. (Class method)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Instance Variable Summary
    Inherited from Task
NoneType fail_task: A variable used to hold the task that should be notified if this task fails.
NoneType next_task: A variable used to hold the task that should be performed after this task.
NoneType timeout: If set to a value other than None, then this task will automatically fail if it has not finished before this amount of time (in msec) has elapsed.

Class Variable Summary
    Inherited from Task
tuple interrupts = ()
NoneType require = None                                                                  
NoneType signature: The type signature of this task.
dict task_classes = {'WaitForAvatar': <class 'pajammin.ai.scr...

Instance Method Details

__init__(self, agent, target, mindist=5, maxdist=10, timeout=None)
(Constructor)

Parameters:
target - The target entity that the agent should be moved adjacent to.
mindist - The minimum acceptable distance between the side of the agent and the adjacent side of the target.
maxdist - The maximum acceptable distance between the side of the agent and the adjacent side of the target.
timeout - A timeout value for this task.
Overrides:
pajammin.ai.script.script.Task.__init__

act(self, level)

Attempt to accomplish this task, by examining and/or modifying the level; and should return a TaskResult object, indicating what action should be taken next. See the class descriptions for the subclasses of TaskResult for information about the actions performed by each task.

Each time act() is called, it should only do a very small amount of work -- this will ensure that the game runs more smoothly.
Overrides:
pajammin.ai.script.script.Task.act (inherited documentation)