This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_attachable [2025/05/02 10:42] – dragonlord | dragengine:modules:dragonscript:behavior_attachable [2025/05/13 14:03] (current) – dragonlord | ||
---|---|---|---|
Line 34: | Line 34: | ||
Attachable has been removed from slot. | Attachable has been removed from slot. | ||
+ | |||
====== Behavior Tree Actions ====== | ====== Behavior Tree Actions ====== | ||
This behavior adds these behavior tree actions if behavior tree is present. | This behavior adds these behavior tree actions if behavior tree is present. | ||
- | ===== attachable.detach | + | ===== attachable.update |
- | Detach element from attach slot if attached to an attach slot. | + | Update attachable. |
^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
- | |dispose| | + | |detach|empty string, '' |
+ | |interactElement.assign|string|Assign attach slot element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if not attached to an attach slot or interact element behavior is absent| | ||
+ | |interact|string|Interact with attach slot. If element is absent action fails. Runs interaction with name value. If interaction with name value is absent fails action. If interaction returns false fails action. Otherwise action succeeds.| | ||
+ | |interact.parameters|string|Optional parameters to use with '' | ||
This is an example of using this action: | This is an example of using this action: | ||
<code xml> | <code xml> | ||
- | <action name=' | + | <action name=' |
- | < | + | < |
</ | </ | ||
</ | </ | ||
Line 58: | Line 62: | ||
^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
|attached|'' | |attached|'' | ||
+ | |interact.name|string|Name of interaction| | ||
+ | |interact.has|'' | ||
+ | |interact.query|'' | ||
+ | |interact.parameters|string|Optional parameters to use with '' | ||
+ | |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled| | ||
This is an example of using this action: | This is an example of using this action: | ||
Line 79: | Line 88: | ||
^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
|attachable.attached|'' | |attachable.attached|'' | ||
+ | |attachable.interact.name|string|Name of interaction| | ||
+ | |attachable.interact.has|'' | ||
+ | |attachable.interact.query|'' | ||
+ | |attachable.interact.parameters|string|Optional parameters to use with '' | ||
This is an example of using this condition: | This is an example of using this condition: | ||
Line 87: | Line 100: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | ====== State Machine Actions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Conditions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Events ====== | ||
+ | |||
+ | This behavior sends these state machine events. | ||
+ | |||
+ | ===== attachable.attached ===== | ||
+ | |||
+ | Attachable has been attached to slot. | ||
+ | |||
+ | ===== attachable.detached ===== | ||
+ | |||
+ | Attachable has been removed from slot. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 95: | Line 128: | ||
* [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 137: | Line 171: | ||
| | ||
< | < | ||
+ | <!-- optional: use behavior tree with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use state machine 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 --> | ||
<string name=' | <string name=' |