Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.BaseActorAI Class Reference

Base actor AI. More...

Inheritance diagram for Dragengine.Scenery.BaseActorAI:
Dragengine.LoadSave.Persistable Dragengine.Scenery.BAAIBehaviorTree

Classes

class  Factory
 Factory for loading actor ai. More...
 

Public Member Functions

void actionFailed ()
 Action failed. More...
 
void actionFinished ()
 Action finished successfully. More...
 
void activate (BehaviorElement actor)
 AI has been set as active AI in an actor. More...
 
void activateWhileLoading (BehaviorElement actor)
 AI has been set as active AI in an actor while loading. More...
 
void collision (Collider owner, CollisionInfo info)
 Collision detected. More...
 
void deactivate ()
 Action has been unset as active action in an actor. More...
 
void dispose ()
 Dispose of base actor ai. More...
 
void enterConversation ()
 Actor has been added to a conversation playback. More...
 
void enteredGameWorld ()
 Actor entered game world. More...
 
void enterFrame ()
 Actor has been added to game world and enterFrame() is called once. More...
 
BehaviorElement getActor ()
 Actor owning the action. More...
 
ECBehaviorActorAIAction.Instance getAIAction ()
 Behavior actor ai-action or null. More...
 
ECBehaviorPlayerControllable.Instance getPlayerControllable ()
 Behavior player controllable or null. More...
 
bool isActive ()
 AI is active actor AI. More...
 
bool isControlledByPlayer ()
 Actor is controlled by player. More...
 
bool isNotActive ()
 AI is not active actor AI. More...
 
void leaveConversation ()
 Actor has been removed from a conversation playback. More...
 
void leftGameWorld ()
 Actor left game world. More...
 
void log (Console console, Element element, String text)
 Log text about element to console prefixed with actor information. More...
 
void log (Console console, Exception exception)
 Log exception to console prefixed with actor information. More...
 
void log (Console console, String text)
 Log text to console prefixed with actor information. More...
 
void log (Element element, String text)
 Log text about element to BaseGameApp console prefixed with actor information. More...
 
void log (Exception exception)
 Log exception to BaseGameApp console prefixed with actor information. More...
 
void log (String text)
 Log text to BaseGameApp console prefixed with actor information. More...
 
String loggingPrefix ()
 Logging prefix. More...
 
BaseActorAI new ()
 Create base actor ai. More...
 
String persistencyFactoryName ()
 Name of PersistencyFactory required to load object from file. More...
 
void playerReleasesControl ()
 Player released control of actor. More...
 
void playerTakesControl ()
 Player takes control of actor. More...
 
void think (float elapsed)
 Thinking. More...
 
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)
 Write object to file writer. More...
 

Protected Member Functions

void initBehaviors ()
 Init behaviors. More...
 

Protected Attributes

BehaviorElement actor
 Actor the action is assigned to or null. More...
 
ECBehaviorActorAIAction.Instance aiAction
 Behavior actor ai-action or null. More...
 
ECBehaviorPlayerControllable.Instance playerControllable
 Behavior player controllable or null. More...
 

Detailed Description

Base actor AI.

Action supports the Persistable interface an can be read from and writen to file writers.

Member Function Documentation

◆ actionFailed()

void Dragengine.Scenery.BaseActorAI.actionFailed ( )

Action failed.

◆ actionFinished()

void Dragengine.Scenery.BaseActorAI.actionFinished ( )

Action finished successfully.

◆ activate()

void Dragengine.Scenery.BaseActorAI.activate ( BehaviorElement  actor)

AI has been set as active AI in an actor.

Calls these hook methods:

◆ activateWhileLoading()

void Dragengine.Scenery.BaseActorAI.activateWhileLoading ( BehaviorElement  actor)

AI has been set as active AI in an actor while loading.

Similar to activate(BehaviorElement) but only stores the actor and calls initBehaviors(). This is required since while loading behaviors load their state and AIs load their states. If activate(BehaviorElement) is called these states would be reset to initial values.

◆ collision()

void Dragengine.Scenery.BaseActorAI.collision ( Collider  owner,
CollisionInfo  info 
)

Collision detected.

Action does collision response and changes the parameters of owner. AI is only notified about the collision and should not interfere with collision response.

◆ deactivate()

void Dragengine.Scenery.BaseActorAI.deactivate ( )

Action has been unset as active action in an actor.

◆ dispose()

void Dragengine.Scenery.BaseActorAI.dispose ( )

Dispose of base actor ai.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

◆ enterConversation()

void Dragengine.Scenery.BaseActorAI.enterConversation ( )

Actor has been added to a conversation playback.

◆ enteredGameWorld()

void Dragengine.Scenery.BaseActorAI.enteredGameWorld ( )

Actor entered game world.

◆ enterFrame()

void Dragengine.Scenery.BaseActorAI.enterFrame ( )

Actor has been added to game world and enterFrame() is called once.

◆ getActor()

BehaviorElement Dragengine.Scenery.BaseActorAI.getActor ( )

Actor owning the action.

◆ getAIAction()

ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActorAI.getAIAction ( )

Behavior actor ai-action or null.

◆ getPlayerControllable()

ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActorAI.getPlayerControllable ( )

Behavior player controllable or null.

◆ initBehaviors()

void Dragengine.Scenery.BaseActorAI.initBehaviors ( )
protected

Init behaviors.

Retrieve and store required and optional behavior instances from the actor element.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

◆ isActive()

bool Dragengine.Scenery.BaseActorAI.isActive ( )

AI is active actor AI.

Version
1.4

◆ isControlledByPlayer()

bool Dragengine.Scenery.BaseActorAI.isControlledByPlayer ( )

Actor is controlled by player.

◆ isNotActive()

bool Dragengine.Scenery.BaseActorAI.isNotActive ( )

AI is not active actor AI.

Version
1.4

◆ leaveConversation()

void Dragengine.Scenery.BaseActorAI.leaveConversation ( )

Actor has been removed from a conversation playback.

◆ leftGameWorld()

void Dragengine.Scenery.BaseActorAI.leftGameWorld ( )

Actor left game world.

◆ log() [1/6]

void Dragengine.Scenery.BaseActorAI.log ( Console  console,
Element  element,
String  text 
)

Log text about element to console prefixed with actor information.

◆ log() [2/6]

void Dragengine.Scenery.BaseActorAI.log ( Console  console,
Exception  exception 
)

Log exception to console prefixed with actor information.

◆ log() [3/6]

void Dragengine.Scenery.BaseActorAI.log ( Console  console,
String  text 
)

Log text to console prefixed with actor information.

◆ log() [4/6]

void Dragengine.Scenery.BaseActorAI.log ( Element  element,
String  text 
)

Log text about element to BaseGameApp console prefixed with actor information.

◆ log() [5/6]

void Dragengine.Scenery.BaseActorAI.log ( Exception  exception)

Log exception to BaseGameApp console prefixed with actor information.

◆ log() [6/6]

void Dragengine.Scenery.BaseActorAI.log ( String  text)

Log text to BaseGameApp console prefixed with actor information.

◆ loggingPrefix()

String Dragengine.Scenery.BaseActorAI.loggingPrefix ( )

Logging prefix.

Returns string in the form "<actor-class>/<ai-class>".

◆ new()

BaseActorAI Dragengine.Scenery.BaseActorAI.new ( )

Create base actor ai.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

◆ persistencyFactoryName()

String Dragengine.Scenery.BaseActorAI.persistencyFactoryName ( )

Name of PersistencyFactory required to load object from file.

Name of PersistencyFactory is first written to the file as string with 8-bit length. Then writeToFile() is called to write the object itself. Empty name is not allowed as is names longer than 255 characters. Name has to match a PersistencyFactory present in the Persistency instance used for loading objects. Object is read using PersistencyFactory.readObjectFromFile() of the matching PersistencyFactory.

Implements Dragengine.LoadSave.Persistable.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

◆ playerReleasesControl()

void Dragengine.Scenery.BaseActorAI.playerReleasesControl ( )

Player released control of actor.

◆ playerTakesControl()

void Dragengine.Scenery.BaseActorAI.playerTakesControl ( )

Player takes control of actor.

◆ think()

void Dragengine.Scenery.BaseActorAI.think ( float  elapsed)

Thinking.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

◆ writeObjectToFile()

void Dragengine.Scenery.BaseActorAI.writeObjectToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object to file writer.

Implements Dragengine.LoadSave.Persistable.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

Member Data Documentation

◆ actor

BehaviorElement Dragengine.Scenery.BaseActorAI.actor
protected

Actor the action is assigned to or null.

◆ aiAction

ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActorAI.aiAction
protected

Behavior actor ai-action or null.

◆ playerControllable

ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActorAI.playerControllable
protected

Behavior player controllable or null.


The documentation for this class was generated from the following file: