|
Drag[en]gine Script Module DragonScript 1.32.1
|
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 | Factory |
| Behavior factory. More... | |
| class | Instance |
| Behavior instance. More... | |
Public Member Functions | |
| void | dispose () |
| Dispose of behavior. | |
| ECPString | getAction () |
| Action to use instead of factory action. | |
| ActionFactory | getActionFactory () |
| Action factory. | |
| ECPString | getAI () |
| AI to use instead of factory AI. | |
| AIFactory | getAIFactory () |
| AI factory. | |
| ECComposeBTSM | getBTSMs () |
| Compose behavior trees and state machines. | |
| ECBehaviorColliderAI | getColliderAI () |
| Collider AI behavior or null. | |
| ECBehaviorConversationActor | getConversationActor () |
| Conversation actor behavior or null. | |
| LoadBehaviorTree | getLoadBehaviorTree () |
| Behavior tree loader. | |
| LoadStateMachine | getLoadStateMachine () |
| State machine loader. | |
| Persistency | getPersistency () |
| Persistency used to create action. | |
| ECBehaviorPlayerControllable | getPlayerControllable () |
| Player controllable behavior or null. | |
| String | getPrefix () |
| Prefix. | |
| Instance | instance (BehaviorElement element) |
| Get instance in element from owner element class. | |
| ECBehaviorActorAIAction | new (BehaviorElementClass eclass, ECBehaviorColliderAI colliderAI, ECBehaviorConversationActor conversationActor, ECBehaviorPlayerControllable playerControllable) |
| Create behavior element class. | |
| ECBehaviorActorAIAction | new (BehaviorElementClass eclass, ECBehaviorColliderAI colliderAI, ECBehaviorConversationActor conversationActor, ECBehaviorPlayerControllable playerControllable, String prefix) |
| void | setActionFactory (ActionFactory factory) |
| Set action factory. | |
| void | setAIFactory (AIFactory factory) |
| Set AI factory. | |
| void | setColliderAI (ECBehaviorColliderAI colliderAI) |
| Set collider AI behavior or null. | |
| void | setConversationActor (ECBehaviorConversationActor conversationActor) |
| Set conversation actor behavior or null. | |
| void | setLoadBehaviorTree (LoadBehaviorTree loader) |
| Set behavior tree loader. | |
| void | setLoadStateMachine (LoadStateMachine loader) |
| Set state machine loader. | |
| void | setPersistency (Persistency persistency) |
| Set persistency used to create action. | |
| void | setPlayerControllable (ECBehaviorPlayerControllable playerControllable) |
| Set player controllable behavior or null. | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| void | assignInstanceIndex (int instanceIndex) |
| Assign instance index. | |
| String | getBehaviorID () |
| Unique identifier of behavior. | |
| String | getID () |
| Identifier. | |
| int | getInstanceIndex () |
| Instance index. | |
| void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
| Load instance data of another behavior. | |
| bool | supportsBehaviorID (String identifier) |
| Behavior supports loading instance data of another behavior. | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
| ECBehaviorInstance | createInstance (BehaviorElement element) |
| Create Behavior instance. | |
Static Public Member Functions | |
| static ECBehaviorActorAIAction | getBehaviorIn (BehaviorElementClass eclass) |
| Get behavior in element class or null if absent. | |
Public Attributes | |
| ECPString | pAction |
| ActionFactory | pActionFactory |
| AIFactory | pAIFactory |
| ECComposeBTSM | pBTSMs |
| ECBehaviorColliderAI | pColliderAI |
| ECBehaviorConversationActor | pConversationActor |
| LoadBehaviorTree | pLoadBehaviorTree |
| LoadStateMachine | pLoadStateMachine |
| Persistency | pPersistency |
| ECBehaviorPlayerControllable | pPlayerControllable |
| String | pPrefix |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| DefaultECBehavior | new (BehaviorElementClass eclass) |
| Create default composeable behavior with empty identifier. | |
| DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
| Create default composeable behavior. | |
| void | setBehaviorID (String identifier) |
| Set behavior identifier. | |
| void | useClassNameAsBehaviorID () |
| Set behavior identifier to "<class-name>:<identifier>". | |
| void | useFullyQualifiedClassNameAsBehaviorID () |
| Set behavior identifier to "<fully-qualified-class-name>:<identifier>". | |
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.
| void Dragengine.Scenery.ECBehaviorActorAIAction.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.getAction | ( | ) |
Action to use instead of factory action.
| ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.getActionFactory | ( | ) |
Action factory.
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.getAI | ( | ) |
AI to use instead of factory AI.
| 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.
| ECComposeBTSM Dragengine.Scenery.ECBehaviorActorAIAction.getBTSMs | ( | ) |
Compose behavior trees and state machines.
| ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.getColliderAI | ( | ) |
Collider AI behavior or null.
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.getConversationActor | ( | ) |
Conversation actor behavior or null.
| LoadBehaviorTree Dragengine.Scenery.ECBehaviorActorAIAction.getLoadBehaviorTree | ( | ) |
Behavior tree loader.
| LoadStateMachine Dragengine.Scenery.ECBehaviorActorAIAction.getLoadStateMachine | ( | ) |
State machine loader.
| Persistency Dragengine.Scenery.ECBehaviorActorAIAction.getPersistency | ( | ) |
Persistency used to create action.
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.getPlayerControllable | ( | ) |
Player controllable behavior or null.
| String Dragengine.Scenery.ECBehaviorActorAIAction.getPrefix | ( | ) |
Prefix.
| 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.setLoadBehaviorTree | ( | LoadBehaviorTree | loader | ) |
Set behavior tree loader.
| void Dragengine.Scenery.ECBehaviorActorAIAction.setLoadStateMachine | ( | LoadStateMachine | loader | ) |
Set state machine loader.
| void Dragengine.Scenery.ECBehaviorActorAIAction.setPersistency | ( | Persistency | persistency | ) |
Set persistency used to create action.
| void Dragengine.Scenery.ECBehaviorActorAIAction.setPlayerControllable | ( | ECBehaviorPlayerControllable | playerControllable | ) |
Set player controllable behavior or null.
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.pAction |
| ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.pActionFactory |
| AIFactory Dragengine.Scenery.ECBehaviorActorAIAction.pAIFactory |
| ECComposeBTSM Dragengine.Scenery.ECBehaviorActorAIAction.pBTSMs |
| ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.pColliderAI |
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.pConversationActor |
| LoadBehaviorTree Dragengine.Scenery.ECBehaviorActorAIAction.pLoadBehaviorTree |
| LoadStateMachine Dragengine.Scenery.ECBehaviorActorAIAction.pLoadStateMachine |
| Persistency Dragengine.Scenery.ECBehaviorActorAIAction.pPersistency |
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.pPlayerControllable |
| String Dragengine.Scenery.ECBehaviorActorAIAction.pPrefix |