Module ...
Handles actors artificial intelligence (or dumbness ... ;)
Functions
_M:aiSeeTargetPos (target) | Returns the seen coords of the target This will usually return the exact coords, but if the target is only partially 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, force) | 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) | Define AI |
_M:setTarget (target, last_seen) | Sets the current target |
Functions
- _M:aiSeeTargetPos (target)
-
Returns the seen coords of the target This will usually return the exact coords, but if the target is only partially 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, force)
-
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:
- force:
- _M:newAI (name, fct)
-
Define AI
Parameters
- name:
- fct:
- _M:setTarget (target, last_seen)
-
Sets the current target
Parameters
- target:
- last_seen: