This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_rideon [2025/03/12 14:15] – created dragonlord | dragengine:modules:dragonscript:behavior_rideon [2025/05/13 14:02] (current) – dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 28: | Line 28: | ||
Ridable changed. Element begins or stops touching a [[behavior_ridable|ECBehaviorRidable]]. | Ridable changed. Element begins or stops touching a [[behavior_ridable|ECBehaviorRidable]]. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. | ||
+ | |||
+ | ===== rideOn.update ===== | ||
+ | |||
+ | Update ride on. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |interact|string|Interact with ridable element. 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 '' | ||
+ | |interactElement.assign|string|Assign ridable to [[behavior_interactelement|ECBehaviorInteractElement]] with identifier matching value string. Action fails if no element is ridable or interact element behavior is absent| | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== rideOn.check ===== | ||
+ | |||
+ | Check one or more ride on parameters. Action succeeds if all parameter value matches their respective ride on parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a ride on parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |ridable|'' | ||
+ | |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: | ||
+ | <code xml> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | <!-- actions here run only if riding on an element --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. | ||
+ | |||
+ | ===== rideOn.check ===== | ||
+ | |||
+ | Check one or more ride on parameters. Conditions returns true if all parameter value match their respective ride on parameter. This condition is typically used to run an action or sequence of actions as long as ride on conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |rideOn.ridable|'' | ||
+ | |rideOn.interact.name|string|Name of interaction| | ||
+ | |rideOn.interact.has|'' | ||
+ | |rideOn.interact.query|'' | ||
+ | |rideOn.interact.parameters|string|Optional parameters to use with '' | ||
+ | |||
+ | This is an example of using this condition: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== State Machine Actions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Conditions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Events ====== | ||
+ | |||
+ | This behavior sends these state machine events. | ||
+ | |||
+ | ===== rideOn.begin ===== | ||
+ | |||
+ | Element is riding on a ridable while previously it did not ride on a ridable. | ||
+ | |||
+ | ===== rideOn.end ===== | ||
+ | |||
+ | Element is not riding on a ridable while previously it has been riding on a ridable. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
- | This behavior requires these other behaviors: | ||
* [[behavior_locomotion|ECBehaviorLocomotion]] | * [[behavior_locomotion|ECBehaviorLocomotion]] | ||
* [[behavior_projecttoground|ECBehaviorProjectToGround]] | * [[behavior_projecttoground|ECBehaviorProjectToGround]] | ||
Line 37: | Line 121: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: |
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 92: | Line 177: | ||
| | ||
< | < | ||
+ | <!-- 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=' |