Drag[en]gine Script Module DragonScript
1.21
|
Behavior adding AI and Action support to actors. More...
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... | |
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.
ECBehaviorInstance Dragengine.Scenery.ECBehaviorActorAIAction.createInstance | ( | BehaviorElement | element | ) |
Create Behavior instance.
Implements Dragengine.Scenery.ECBehavior.
void Dragengine.Scenery.ECBehaviorActorAIAction.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.getActionFactory | ( | ) |
Action factory.
AIFactory Dragengine.Scenery.ECBehaviorActorAIAction.getAIFactory | ( | ) |
AI factory.
|
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.
ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.getColliderAI | ( | ) |
Collider AI behavior or null.
ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.getConversationActor | ( | ) |
Conversation actor behavior or null.
|
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 .
ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.getPlayerControllable | ( | ) |
Player controllable behavior or null.
Instance Dragengine.Scenery.ECBehaviorActorAIAction.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
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.
ECBehaviorActorAIAction Dragengine.Scenery.ECBehaviorActorAIAction.new | ( | BehaviorElementClass | eclass, |
ECBehaviorColliderAI | colliderAI, | ||
ECBehaviorConversationActor | conversationActor, | ||
ECBehaviorPlayerControllable | playerControllable, | ||
String | prefix | ||
) |
void Dragengine.Scenery.ECBehaviorActorAIAction.setActionFactory | ( | ActionFactory | factory | ) |
Set action factory.
void Dragengine.Scenery.ECBehaviorActorAIAction.setAIFactory | ( | AIFactory | factory | ) |
Set AI factory.
void Dragengine.Scenery.ECBehaviorActorAIAction.setColliderAI | ( | ECBehaviorColliderAI | colliderAI | ) |
Set collider AI behavior or null.
void Dragengine.Scenery.ECBehaviorActorAIAction.setConversationActor | ( | ECBehaviorConversationActor | conversationActor | ) |
Set conversation actor behavior or null.
If set conversation conditions and commands are added.
void Dragengine.Scenery.ECBehaviorActorAIAction.setPlayerControllable | ( | ECBehaviorPlayerControllable | playerControllable | ) |
Set player controllable behavior or null.