EntityAIWatcher
Hierarchy
- EntityAIClass
- EntityAIWatcher
Index
Constructors
constructor
Creates watcher entity AI type.
Parameters
customPrototype: EntityAIPrototype
AI type prototype
Returns EntityAIWatcher
Properties
data
Object containing the state of the AI type.
optionalentity
Numeric unique entity idenifier that uses this AI type
instance or null
if it is the pattern.
isInstance
If set to true, it is an instance of AI type, else the pattern (pattern should not be modified directly, AI controller calls instantiate to create instances of AI type).
params
All the parameters of the AI instance.
optionalparent
Instantiated custom entity that uses this AI type
instance or null
if it is the pattern.
Methods
aiEntityChanged
Occurs when entity this instance is assigned to this AI type instance, if you override this method, be sure to assign entity to EntityAIClass.EntityAIPrototype.
Parameters
entity: number
Returns void
changeSelfPriority
Changes own priority in parent's controller.
Parameters
priority: number
Returns void
disableAI
Disables any AI by it's name in the controller.
Parameters
name: string
AI name to be disabled
Returns void
enableAI
Enables any AI by it's name in the controller.
Parameters
name: string
AI name to be enables
priority: number
priority to be set to the enabled AI
extra: any
some extra data passed to
Returns void
finishExecution
Finishes AI execution and disables it in parent controller.
Returns void
getAI
Gets any AI object by it's name from the current controller.
Parameters
name: string
AI name
Returns EntityAIClass
getPriority
Gets any AI priority from the current controller by AI name.
Parameters
name: string
AI name
Returns number
instantiate
Method that is called to create AI type instance using current instance as pattern.
Parameters
parent: any
name: string
Returns EntityAIClass
removeExecutionTimer
Resets execution timer so that AI is executed with no time limits.
Returns void
setExecutionTimer
Sets execution timer time in ticks. AI will be executed specified number of ticks.
Parameters
timer: number
execution time in ticks
Returns void
setParams
Parameters
params: object
Returns void
AI type's default name.
setPriority
Sets any AI priority by it's name in the controller.
Parameters
name: string
AI name to change priority
priority: number
priority to be set to the AI
Returns void
Parent class for EntityAI.PanicWatcher, does nothing like EntityAI.Idle.