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

Protected Member Functions

void initBehaviors ()
 Init behaviors.

Protected Attributes

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

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.

References activateWhileLoading(), and actor.

Referenced by collision().

◆ actionFinished()

void Dragengine.Scenery.BaseActorAI.actionFinished ( )

Action finished successfully.

Referenced by collision().

◆ activate()

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

AI has been set as active AI in an actor.

Calls these hook methods:

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

References aiAction, and isActive().

Referenced by playerReleasesControl().

◆ 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.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

References aiAction, and isNotActive().

Referenced by actionFailed().

◆ 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.

References actionFailed(), and actionFinished().

Referenced by loggingPrefix().

◆ deactivate()

void Dragengine.Scenery.BaseActorAI.deactivate ( )

Action has been unset as active action in an actor.

Referenced by leftGameWorld().

◆ dispose()

void Dragengine.Scenery.BaseActorAI.dispose ( )

Dispose of base actor ai.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

References new().

Referenced by getPlayerControllable().

◆ enterConversation()

void Dragengine.Scenery.BaseActorAI.enterConversation ( )

Actor has been added to a conversation playback.

References playerReleasesControl().

Referenced by log().

◆ enteredGameWorld()

void Dragengine.Scenery.BaseActorAI.enteredGameWorld ( )

Actor entered game world.

References initBehaviors().

Referenced by initBehaviors().

◆ enterFrame()

void Dragengine.Scenery.BaseActorAI.enterFrame ( )

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

References playerTakesControl().

Referenced by log().

◆ getActor()

BehaviorElement Dragengine.Scenery.BaseActorAI.getActor ( )

◆ getAIAction()

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

Behavior actor ai-action or null.

Referenced by isActive(), and writeObjectToFile().

◆ getPlayerControllable()

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

Behavior player controllable or null.

References actor, and dispose().

Referenced by isActive(), and persistencyFactoryName().

◆ 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.

References enteredGameWorld().

Referenced by enteredGameWorld(), loggingPrefix(), and think().

◆ isActive()

bool Dragengine.Scenery.BaseActorAI.isActive ( )

◆ isControlledByPlayer()

bool Dragengine.Scenery.BaseActorAI.isControlledByPlayer ( )

Actor is controlled by player.

References actor, and getActor().

Referenced by isNotActive(), and Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile().

◆ isNotActive()

bool Dragengine.Scenery.BaseActorAI.isNotActive ( )

AI is not active actor AI.

Version
1.4

References aiAction, isControlledByPlayer(), and playerControllable.

Referenced by activateWhileLoading().

◆ leaveConversation()

void Dragengine.Scenery.BaseActorAI.leaveConversation ( )

Actor has been removed from a conversation playback.

References think().

Referenced by log().

◆ leftGameWorld()

void Dragengine.Scenery.BaseActorAI.leftGameWorld ( )

Actor left game world.

References actor, and deactivate().

Referenced by log().

◆ log() [1/6]

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

Log text about element to console prefixed with actor information.

References enterConversation().

◆ log() [2/6]

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

Log exception to console prefixed with actor information.

References leaveConversation().

◆ log() [3/6]

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

Log text to console prefixed with actor information.

References enterFrame().

◆ 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.

References leftGameWorld().

Referenced by Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile(), and writeObjectToFile().

◆ loggingPrefix()

String Dragengine.Scenery.BaseActorAI.loggingPrefix ( )

Logging prefix.

Returns string in the form "<actor-class>/<ai-class>" or "null/<ai-class>" if deactivated or disposed.

References collision(), and initBehaviors().

Referenced by writeObjectToFile().

◆ new()

BaseActorAI Dragengine.Scenery.BaseActorAI.new ( )

Create base actor ai.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

References aiAction.

Referenced by dispose().

◆ 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.

References actor, getPlayerControllable(), and playerControllable.

Referenced by writeObjectToFile().

◆ playerReleasesControl()

void Dragengine.Scenery.BaseActorAI.playerReleasesControl ( )

Player released control of actor.

References activate().

Referenced by enterConversation().

◆ playerTakesControl()

void Dragengine.Scenery.BaseActorAI.playerTakesControl ( )

Player takes control of actor.

Referenced by enterFrame().

◆ think()

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

Thinking.

Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.

References actor, and initBehaviors().

Referenced by leaveConversation().

◆ writeObjectToFile()

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

Member Data Documentation

◆ actor

◆ aiAction

ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActorAI.aiAction
protected

Behavior actor ai-action or null.

Referenced by activate(), activateWhileLoading(), isNotActive(), new(), and writeObjectToFile().

◆ playerControllable

ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActorAI.playerControllable
protected

Behavior player controllable or null.

Referenced by isActive(), isNotActive(), persistencyFactoryName(), and writeObjectToFile().


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