Module ...

Handles actors artificial intelligence (or dumbness ... ;)

Functions

_M:aiSeeTargetPos (target) Returns the seen coords of the target This will usualy return the exact coords, but if the target is only partialy visible (or not at all) it will return estimates, to throw the AI a bit off
_M:doAI () Main entry point for AIs
_M:getTarget (typ) Returns the current target
_M:loadDefinition (dir) Defines AIs Static!
_M:moveDirection (x, y) Move one step to the given target if possible This tries the most direct route, if not available it checks sides and always tries to get closer
_M:newAI (name, fct) Deinfe AI
_M:setTarget (target) Sets the current target


Functions

_M:aiSeeTargetPos (target)
Returns the seen coords of the target This will usualy return the exact coords, but if the target is only partialy visible (or not at all) it will return estimates, to throw the AI a bit off

Parameters

  • target: the target we are tracking

Return value:

x, y coords to move/cast to
_M:doAI ()
Main entry point for AIs
_M:getTarget (typ)
Returns the current target

Parameters

  • typ:
_M:loadDefinition (dir)
Defines AIs Static!

Parameters

  • dir:
_M:moveDirection (x, y)
Move one step to the given target if possible This tries the most direct route, if not available it checks sides and always tries to get closer

Parameters

  • x:
  • y:
_M:newAI (name, fct)
Deinfe AI

Parameters

  • name:
  • fct:
_M:setTarget (target)
Sets the current target

Parameters

  • target:

Valid XHTML 1.0!