This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dragengine:modules:dragonscript:behavior_grabber [2025/05/02 21:51] – [Optional Behaviors] dragonlord | dragengine:modules:dragonscript:behavior_grabber [2026/10/09 16:35] (current) – dragonlord | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| Element class properties have the prefix '' | Element class properties have the prefix '' | ||
| - | ===== shape ===== | + | ===== bone ===== |
| - | Shape of collider used to detect grab spots. | + | Name of bone to attach to or empty string to attach to the parent element. |
| - | * Full name: '' | + | * Full name: '' |
| - | * Type: string | + | * Type: string |
| * Default Value: empty string | * Default Value: empty string | ||
| - | * Example (*.deeclass): | + | * Example (*.deeclass): |
| + | |||
| + | ===== collisionFilter ===== | ||
| + | |||
| + | Set [[gamedev:collisionfiltering|collision filter]]. Filter bits are defined using a list of names mapped to collision filter bit indices using BaseGameApp.getCollisionFilterMap(). | ||
| + | * Full name: '' | ||
| + | * Type: string. Format can be '' | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ===== position ===== | ===== position ===== | ||
| Line 45: | Line 53: | ||
| * Example (*.deeclass): | * Example (*.deeclass): | ||
| - | ===== bone ===== | + | ===== shape ===== |
| - | Name of bone to attach to or empty string to attach to the parent element. | + | Shape of collider used to detect grab spots. |
| - | * Full name: '' | + | * Full name: '' |
| - | * Type: string | + | * Type: string |
| * Default Value: empty string | * Default Value: empty string | ||
| - | * Example (*.deeclass): | + | * Example (*.deeclass): |
| ====== Events ====== | ====== Events ====== | ||
| Line 77: | Line 85: | ||
| Grabber enabled changed. | Grabber enabled changed. | ||
| + | |||
| ====== Behavior Tree Actions ====== | ====== Behavior Tree Actions ====== | ||
| Line 95: | Line 104: | ||
| </ | </ | ||
| - | ===== grabber.release | + | ===== grabber.update |
| - | Release grab spot if grabbing one. | + | Update grabber. |
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |release| |Release grab spot if grabbing one.| | ||
| + | |interactElement.assign|string|Assign grab spot element to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if no element is grabbed or interact element behavior is absent| | ||
| + | |interact|string|Interact with grab spot. 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=' |
| + | < | ||
| + | </action> | ||
| </ | </ | ||
| Line 111: | Line 128: | ||
| |enabled|'' | |enabled|'' | ||
| |grabbing|'' | |grabbing|'' | ||
| + | |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 133: | Line 155: | ||
| |grabber.enabled|'' | |grabber.enabled|'' | ||
| |grabber.grabbing|'' | |grabber.grabbing|'' | ||
| + | |grabber.interact.name|string|Name of interaction| | ||
| + | |grabber.interact.has|'' | ||
| + | |grabber.interact.query|'' | ||
| + | |grabber.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 141: | Line 167: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ====== State Machine Actions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Conditions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Events ====== | ||
| + | |||
| + | This behavior sends these state machine events. If behavior has non-empty identifier replace '' | ||
| + | |||
| + | ===== grabber.enabled ===== | ||
| + | |||
| + | Grabber has been enabled. | ||
| + | |||
| + | ===== grabber.disabled ===== | ||
| + | |||
| + | Grabber has been disabled. | ||
| + | |||
| + | ===== grabber.grabbed ===== | ||
| + | |||
| + | Grabber grabbed grab spot. | ||
| + | |||
| + | ===== grabber.released ===== | ||
| + | |||
| + | Grabber released grab spot. | ||
| + | |||
| + | ===== grabber.touch ===== | ||
| + | |||
| + | Start touching grab spot. | ||
| + | |||
| + | ===== grabber.untouch ===== | ||
| + | |||
| + | Stop touching grab spot. | ||
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
| Line 210: | Line 272: | ||
| <!-- optional: use vr hand with id instead of empty string --> | <!-- optional: use vr hand with id instead of empty string --> | ||
| <string name=' | <string name=' | ||
| - | | ||
| - | <!-- optional: set collision filter. default value ' | ||
| - | | ||
| - | | ||
| - | | ||
| - | are a list of bits to set. --> | ||
| - | <string name=' | ||
| | | ||
| <!-- optional: use behavior tree with id instead of empty string --> | <!-- optional: use behavior tree with id instead of empty string --> | ||