This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dragengine:modules:dragonscript:behavior_actoraiaction [2025/03/12 19:37] – [Optional Behaviors] dragonlord | dragengine:modules:dragonscript:behavior_actoraiaction [2026/09/26 21:47] (current) – [Element Class Properties] dragonlord | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{tag> | {{tag> | ||
| <WRAP youarehere> | <WRAP youarehere> | ||
| - | [[: | + | [[: |
| </ | </ | ||
| Line 22: | Line 22: | ||
| ====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
| Element class properties have the prefix '' | Element class properties have the prefix '' | ||
| + | |||
| + | ===== action ===== | ||
| + | |||
| + | Name of action factory to use to create action instance. Name is looked up using BaseGameApp.getLoader().getPersistency().getFactoryNamed(). The factory must inherit from ECBehaviorActorAIAction.ActionFactory. The following factories are added by BaseGameApp: | ||
| + | |||
| + | * BaseActorAction: | ||
| + | * BAAFirstPerson: | ||
| + | * BAAFirstPersonVR: | ||
| + | * BAAVehicle: Vehicle actor action. | ||
| + | * BAAStateMachine: | ||
| + | |||
| + | To use custom factories add using Persistency.addFactory() using the name you like to use. Names are not required to match the class name but doing so makes it easier to find the responsible class | ||
| + | |||
| + | * Full name: '' | ||
| + | * Type: string | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== ai ===== | ||
| + | |||
| + | Name of AI factory to use to create action instance. Name is looked up using BaseGameApp.getLoader().getPersistency().getFactoryNamed(). The factory must inherit from ECBehaviorActorAIAction.AIFactory. The following factories are added by BaseGameApp: | ||
| + | |||
| + | * BaseActorAI: | ||
| + | * BAAIBehaviorTree: | ||
| + | |||
| + | To use custom factories add using Persistency.addFactory() using the name you like to use. Names are not required to match the class name but doing so makes it easier to find the responsible class | ||
| + | |||
| + | * Full name: '' | ||
| + | * Type: string | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ====== Events ====== | ====== Events ====== | ||
| Since this behavior provides no support to apply the chosen color listening is used. Behaviors knowing how to apply the color add a listener and are notified if the color changes. These events can be received: | Since this behavior provides no support to apply the chosen color listening is used. Behaviors knowing how to apply the color add a listener and are notified if the color changes. These events can be received: | ||
| + | |||
| + | ====== Behavior Tree Actions ====== | ||
| + | |||
| + | This behavior adds these behavior tree actions if behavior tree is present. | ||
| + | |||
| + | ===== aiAction.set ===== | ||
| + | |||
| + | Set one or more actor ai/action parameters. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |ai.behaviorTree|string|Set AI using BAAIBehaviorTree with behavior tree loaded from value path. Path can be relative to behavior tree file containing this action| | ||
| + | |action.stateMachine|string|Set Action using BAAStateMachine with state machine loaded from value path. Path can be relative to behavior tree or state machine file containing this action| | ||
| + | |action.conversationWait|'' | ||
| + | |||
| + | This is an example of using this action: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== aiAction.update ===== | ||
| + | |||
| + | Update AI/Action. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |ai.actionFinished|'' | ||
| + | |||
| + | This is an example of using this action: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== aiAction.check ===== | ||
| + | |||
| + | Check one or more behavior parameters. Action succeeds if all parameter value matches their respective player input crouch parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a player input crouch parameter matches (or not). | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |action.conversationWait|'' | ||
| + | |||
| + | This is an example of using this action: | ||
| + | <code xml> | ||
| + | < | ||
| + | <action name=' | ||
| + | < | ||
| + | </ | ||
| + | <!-- actions here run only if conversation wait is enabled --> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ====== Behavior Tree Conditions ====== | ||
| + | |||
| + | This behavior adds these behavior tree conditions if behavior tree is present. | ||
| + | |||
| + | ===== aiAction.check ===== | ||
| + | |||
| + | Check one or more behavior parameters. Conditions returns true if all parameter value match their respective player input crouch parameter. This condition is typically used to run an action or sequence of actions as long as player input crouch conditions are true. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |aiAction.action.conversationWait|'' | ||
| + | |||
| + | This is an example of using this condition: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
| Line 36: | Line 138: | ||
| * [[behavior_conversationactor|ECBehaviorConversationActor]]: | * [[behavior_conversationactor|ECBehaviorConversationActor]]: | ||
| * [[behavior_playercontrollable|ECBehaviorPlayerControllable]]: | * [[behavior_playercontrollable|ECBehaviorPlayerControllable]]: | ||
| + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
| ====== Persistency ====== | ====== Persistency ====== | ||
| Line 89: | Line 192: | ||
| < | < | ||
| <!-- behavior factory automatically assigns all optional behaviors if present --> | <!-- behavior factory automatically assigns all optional behaviors if present --> | ||
| + | | ||
| + | <!-- optional: use behavior tree with id instead of empty string --> | ||
| + | <string name=' | ||
| | | ||
| <!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||