|
Drag[en]gine Script Module DragonScript 1.35
|
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. | |
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.
Action and AI instances are created from factories during Instance.postInit() not inside Instance.init(). This ensures all behaviors added after this behavior can properly add their behavior tree and state machine actions and conditions before the state machine or behavior tree runs for the first time due to action or AI activation.
| void Dragengine.Scenery.ECBehaviorActorAIAction.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
References dispose(), pColliderAI, pConversationActor, and pPlayerControllable.
Referenced by dispose(), getBehaviorIn(), and getPrefix().
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.getAction | ( | ) |
Action to use instead of factory action.
Referenced by getAI(), getBehaviorIn(), and setLoadStateMachine().
| ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.getActionFactory | ( | ) |
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.getAI | ( | ) |
AI to use instead of factory AI.
References getAction(), getActionFactory(), and getPersistency().
Referenced by getBehaviorIn(), and getBTSMs().
| AIFactory Dragengine.Scenery.ECBehaviorActorAIAction.getAIFactory | ( | ) |
AI factory.
Referenced by getBehaviorIn(), and getBTSMs().
|
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.
References Dragengine.Scenery.ECBehavior.createInstance(), dispose(), getAction(), getActionFactory(), getAI(), getAIFactory(), getBehaviorIn(), getBTSMs(), getColliderAI(), getConversationActor(), getLoadBehaviorTree(), getLoadStateMachine(), getPersistency(), getPlayerControllable(), getPrefix(), instance(), new(), pAction, pActionFactory, pAIFactory, pBTSMs, pColliderAI, pConversationActor, pLoadBehaviorTree, pLoadStateMachine, pPersistency, pPlayerControllable, pPrefix, setActionFactory(), setAIFactory(), setColliderAI(), setConversationActor(), setLoadBehaviorTree(), setLoadStateMachine(), setPersistency(), and setPlayerControllable().
Referenced by getBehaviorIn().
| ECComposeBTSM Dragengine.Scenery.ECBehaviorActorAIAction.getBTSMs | ( | ) |
Compose behavior trees and state machines.
References getAI(), getAIFactory(), and getPersistency().
Referenced by getBehaviorIn(), and setActionFactory().
| ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.getColliderAI | ( | ) |
Collider AI behavior or null.
Referenced by getBehaviorIn(), and getConversationActor().
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.getConversationActor | ( | ) |
Conversation actor behavior or null.
References getColliderAI(), getConversationActor(), getPlayerControllable(), instance(), pColliderAI, and pConversationActor.
Referenced by getBehaviorIn(), getConversationActor(), and setLoadBehaviorTree().
| LoadBehaviorTree Dragengine.Scenery.ECBehaviorActorAIAction.getLoadBehaviorTree | ( | ) |
| LoadStateMachine Dragengine.Scenery.ECBehaviorActorAIAction.getLoadStateMachine | ( | ) |
State machine loader.
References getPlayerControllable(), pConversationActor, and pPlayerControllable.
Referenced by getBehaviorIn().
| Persistency Dragengine.Scenery.ECBehaviorActorAIAction.getPersistency | ( | ) |
Persistency used to create action.
References pAction.
Referenced by getAI(), getBehaviorIn(), and getBTSMs().
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.getPlayerControllable | ( | ) |
Player controllable behavior or null.
References pColliderAI.
Referenced by getBehaviorIn(), getConversationActor(), getLoadStateMachine(), and setConversationActor().
| String Dragengine.Scenery.ECBehaviorActorAIAction.getPrefix | ( | ) |
| Instance Dragengine.Scenery.ECBehaviorActorAIAction.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
References pAction.
Referenced by Dragengine.Scenery.ECBehaviorActorAIAction.Instance.aiActionFailure(), Dragengine.Scenery.ECBehaviorActorAIAction.Instance.getAI(), getBehaviorIn(), getConversationActor(), Dragengine.Scenery.ECBehaviorActorAIAction.Instance.init(), Dragengine.Scenery.ECBehaviorActorAIAction.Instance.removeFromGameWorld(), Dragengine.Scenery.ECBehaviorActorAIAction.Instance.setAction(), and setConversationActor().
| 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.
Referenced by Dragengine.Scenery.ECBehaviorActorAIAction.AIFactory.createAI(), getBehaviorIn(), and setActionFactory().
| ECBehaviorActorAIAction Dragengine.Scenery.ECBehaviorActorAIAction.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorColliderAI | colliderAI, | ||
| ECBehaviorConversationActor | conversationActor, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| String | prefix ) |
| void Dragengine.Scenery.ECBehaviorActorAIAction.setActionFactory | ( | ActionFactory | factory | ) |
| void Dragengine.Scenery.ECBehaviorActorAIAction.setAIFactory | ( | AIFactory | factory | ) |
Set AI factory.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorActorAIAction.setColliderAI | ( | ECBehaviorColliderAI | colliderAI | ) |
Set collider AI behavior or null.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorActorAIAction.setConversationActor | ( | ECBehaviorConversationActor | conversationActor | ) |
Set conversation actor behavior or null.
If set conversation conditions and commands are added.
References getPlayerControllable(), instance(), and pPlayerControllable.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorActorAIAction.setLoadBehaviorTree | ( | LoadBehaviorTree | loader | ) |
Set behavior tree loader.
References getConversationActor().
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorActorAIAction.setLoadStateMachine | ( | LoadStateMachine | loader | ) |
| void Dragengine.Scenery.ECBehaviorActorAIAction.setPersistency | ( | Persistency | persistency | ) |
Set persistency used to create action.
References pAction.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorActorAIAction.setPlayerControllable | ( | ECBehaviorPlayerControllable | playerControllable | ) |
Set player controllable behavior or null.
References pConversationActor.
Referenced by getBehaviorIn().
| ECPString Dragengine.Scenery.ECBehaviorActorAIAction.pAction |
Referenced by getBehaviorIn(), getPersistency(), instance(), and setPersistency().
| ActionFactory Dragengine.Scenery.ECBehaviorActorAIAction.pActionFactory |
Referenced by getBehaviorIn().
| AIFactory Dragengine.Scenery.ECBehaviorActorAIAction.pAIFactory |
Referenced by getBehaviorIn().
| ECComposeBTSM Dragengine.Scenery.ECBehaviorActorAIAction.pBTSMs |
Referenced by getBehaviorIn().
| ECBehaviorColliderAI Dragengine.Scenery.ECBehaviorActorAIAction.pColliderAI |
Referenced by dispose(), getBehaviorIn(), getConversationActor(), and getPlayerControllable().
| ECBehaviorConversationActor Dragengine.Scenery.ECBehaviorActorAIAction.pConversationActor |
Referenced by dispose(), getBehaviorIn(), getConversationActor(), getLoadStateMachine(), and setPlayerControllable().
| LoadBehaviorTree Dragengine.Scenery.ECBehaviorActorAIAction.pLoadBehaviorTree |
Referenced by getBehaviorIn().
| LoadStateMachine Dragengine.Scenery.ECBehaviorActorAIAction.pLoadStateMachine |
Referenced by getBehaviorIn().
| Persistency Dragengine.Scenery.ECBehaviorActorAIAction.pPersistency |
Referenced by getBehaviorIn().
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorActorAIAction.pPlayerControllable |
Referenced by dispose(), getActionFactory(), getBehaviorIn(), getLoadStateMachine(), and setConversationActor().
| String Dragengine.Scenery.ECBehaviorActorAIAction.pPrefix |
Referenced by getBehaviorIn().