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

Behavior adding AI and Action support to actors. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorActorAIAction:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

interface  ActionFactory
 Factory for creating action. More...
 
interface  AIFactory
 Factory for creating AI. More...
 
class  Instance
 Behavior instance. More...
 

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
ActionFactory getActionFactory ()
 Action factory. More...
 
AIFactory getAIFactory ()
 AI factory. More...
 
ECBehaviorColliderAI getColliderAI ()
 Collider AI behavior or null. More...
 
ECBehaviorConversationActor getConversationActor ()
 Conversation actor behavior or null. More...
 
ECBehaviorPlayerControllable getPlayerControllable ()
 Player controllable behavior or null. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorActorAIAction new (BehaviorElementClass eclass, ECBehaviorColliderAI colliderAI, ECBehaviorConversationActor conversationActor, ECBehaviorPlayerControllable playerControllable)
 Create behavior element class. More...
 
ECBehaviorActorAIAction new (BehaviorElementClass eclass, ECBehaviorColliderAI colliderAI, ECBehaviorConversationActor conversationActor, ECBehaviorPlayerControllable playerControllable, String prefix)
 
void setActionFactory (ActionFactory factory)
 Set action factory. More...
 
void setAIFactory (AIFactory factory)
 Set AI factory. More...
 
void setColliderAI (ECBehaviorColliderAI colliderAI)
 Set collider AI behavior or null. More...
 
void setConversationActor (ECBehaviorConversationActor conversationActor)
 Set conversation actor behavior or null. More...
 
void setPlayerControllable (ECBehaviorPlayerControllable playerControllable)
 Set player controllable behavior or null. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 

Static Public Member Functions

static ECBehaviorActorAIAction getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 
static Instance getInstanceIn (BehaviorElement element)
 Get instance in element or null if absent. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior adding AI and Action support to actors.

Allows instance of BaseActorAction and BaseActorAI to be assigned to actor. During thinking first the AI then the Action is called.

Actions allow actors to perform a specific, well defined and enclosed action like interacting with an object. Actions are suitable to be used by player and computer controlled actors alike. This concept allows using the same actions for both player and computer controlled actors reducing coding effort, misbehavior and overall ensures that what a player can do a computer controlled actor can do and vice versa.

AIs allow computer controlled actors to act on their own. With player controlled actors the AI is skipped and the player is the AI. AI provides long running actor actions like guarding a zone with the possiblity to switch between different actions depending on how the actor wants to react to events. This separation makes it simple to design AI in coarse grain placing actual small grained actions into reusable action instances. This separation also allows actors to easily switch between player and computer controlled because both can reuse the same action instances.

Supports these optional behaviors:

If conversation actor is used see ECBehaviorActorAIAction.ConvoCondition and ECBehaviorActorAIAction.ConvoCommand for supported syntax.

Member Function Documentation

◆ createInstance()

ECBehaviorInstance Dragengine.Scenery.ECBehaviorActorAIAction.createInstance ( BehaviorElement  element)

Create Behavior instance.

Implements Dragengine.Scenery.ECBehavior.

◆ dispose()

void Dragengine.Scenery.ECBehaviorActorAIAction.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getActionFactory()

ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.getActionFactory ( )

Action factory.

◆ getAIFactory()

AIFactory Dragengine.Scenery.ECBehaviorActorAIAction.getAIFactory ( )

AI factory.

◆ getBehaviorIn()

static ECBehaviorActorAIAction Dragengine.Scenery.ECBehaviorActorAIAction.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorActorAIAction.

◆ getColliderAI()

ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.getColliderAI ( )

Collider AI behavior or null.

◆ getConversationActor()

ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.getConversationActor ( )

Conversation actor behavior or null.

◆ getInstanceIn()

static Instance Dragengine.Scenery.ECBehaviorActorAIAction.getInstanceIn ( BehaviorElement  element)
static

Get instance in element or null if absent.

Use this method to check if a particular BehaviorElement contains a behavior instance of type ECBehaviorActorAIAction.Instance .

◆ getPlayerControllable()

ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.getPlayerControllable ( )

Player controllable behavior or null.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorActorAIAction.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/2]

ECBehaviorActorAIAction Dragengine.Scenery.ECBehaviorActorAIAction.new ( BehaviorElementClass  eclass,
ECBehaviorColliderAI  colliderAI,
ECBehaviorConversationActor  conversationActor,
ECBehaviorPlayerControllable  playerControllable 
)

Create behavior element class.

These values are optional and can be null: colliderAI, conversationActor, playerControllable.

The default Action and AI factory are BAAFirstPerson and BAAIBehaviorTree.

◆ new() [2/2]

ECBehaviorActorAIAction Dragengine.Scenery.ECBehaviorActorAIAction.new ( BehaviorElementClass  eclass,
ECBehaviorColliderAI  colliderAI,
ECBehaviorConversationActor  conversationActor,
ECBehaviorPlayerControllable  playerControllable,
String  prefix 
)

◆ setActionFactory()

void Dragengine.Scenery.ECBehaviorActorAIAction.setActionFactory ( ActionFactory  factory)

Set action factory.

◆ setAIFactory()

void Dragengine.Scenery.ECBehaviorActorAIAction.setAIFactory ( AIFactory  factory)

Set AI factory.

◆ setColliderAI()

void Dragengine.Scenery.ECBehaviorActorAIAction.setColliderAI ( ECBehaviorColliderAI  colliderAI)

Set collider AI behavior or null.

◆ setConversationActor()

void Dragengine.Scenery.ECBehaviorActorAIAction.setConversationActor ( ECBehaviorConversationActor  conversationActor)

Set conversation actor behavior or null.

If set conversation conditions and commands are added.

◆ setPlayerControllable()

void Dragengine.Scenery.ECBehaviorActorAIAction.setPlayerControllable ( ECBehaviorPlayerControllable  playerControllable)

Set player controllable behavior or null.


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