This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| dragengine:modules:dragonscript:behavior_attachable [2025/05/13 14:03] – dragonlord | dragengine:modules:dragonscript:behavior_attachable [2026/10/12 18:21] (current) – dragonlord | ||
|---|---|---|---|
| Line 48: | Line 48: | ||
| |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|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 '' | |interact.parameters|string|Optional parameters to use with '' | ||
| + | |runEvent|string|Run named event on all [[behavior_statemachine|ECBehaviorStateMachine]] instance of attach slot with the attachable element as event parameter.| | ||
| - | This is an example of using this action: | + | This is an example of using this action |
| <code xml> | <code xml> | ||
| <action name=' | <action name=' | ||
| < | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | This is an example of running a state machine event on the attach slot element: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| </ | </ | ||
| </ | </ | ||
| Line 62: | Line 70: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| |attached|'' | |attached|'' | ||
| + | |flags.set|string|Attach slot element has [[behavior_flags|ECBehaviorFlags]] with named flag set.| | ||
| + | |flags.clear|string|Attach slot element has [[behavior_flags|ECBehaviorFlags]] with named flag cleared.| | ||
| |interact.name|string|Name of interaction| | |interact.name|string|Name of interaction| | ||
| |interact.has|'' | |interact.has|'' | ||
| Line 68: | Line 78: | ||
| |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled| | |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 |
| <code xml> | <code xml> | ||
| < | < | ||
| Line 75: | Line 85: | ||
| </ | </ | ||
| <!-- actions here run only if element is attached to a slot --> | <!-- actions here run only if element is attached to a slot --> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | This is an example of a sequence running only if attached element has flag set: | ||
| + | <code xml> | ||
| + | < | ||
| + | <action name=' | ||
| + | < | ||
| + | </ | ||
| + | <!-- actions here run only if attached to an attach slot, attach slot element has ECBehaviorFlags and the flag '' | ||
| </ | </ | ||
| </ | </ | ||
| Line 88: | Line 108: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| |attachable.attached|'' | |attachable.attached|'' | ||
| + | |attachable.flags.set|string|Attach slot element has [[behavior_flags|ECBehaviorFlags]] with named flag set.| | ||
| + | |attachable.flags.clear|string|Attach slot element has [[behavior_flags|ECBehaviorFlags]] with named flag cleared.| | ||
| |attachable.interact.name|string|Name of interaction| | |attachable.interact.name|string|Name of interaction| | ||
| |attachable.interact.has|'' | |attachable.interact.has|'' | ||
| Line 93: | Line 115: | ||
| |attachable.interact.parameters|string|Optional parameters to use with '' | |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 |
| <code xml> | <code xml> | ||
| <action name=' | <action name=' | ||
| < | < | ||
| < | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | This is an example of an action running only if attached element has flag set: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| + | < | ||
| </ | </ | ||
| </ | </ | ||