This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_stepaside [2024/03/14 16:56] – dragonlord | dragengine:modules:dragonscript:behavior_stepaside [2025/05/05 13:37] (current) – [State Machine Events] dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 8: | Line 8: | ||
====== ECBehaviorStepAside ====== | ====== ECBehaviorStepAside ====== | ||
+ | |||
+ | <WRAP center 100%> | ||
+ | <WRAP center box 450px> | ||
+ | {{youtube> | ||
+ | <WRAP centeralign> | ||
+ | </ | ||
+ | </ | ||
Behavior adding support to actors to step aside if told. | Behavior adding support to actors to step aside if told. | ||
Line 16: | Line 23: | ||
This behavior can be disabled temporarily to prevent actors from stepping aside. | This behavior can be disabled temporarily to prevent actors from stepping aside. | ||
- | |||
- | <WRAP center 100%> | ||
- | <WRAP center box 450px> | ||
- | {{youtube> | ||
- | <WRAP centeralign> | ||
- | </ | ||
- | </ | ||
====== Instance Counts ====== | ====== Instance Counts ====== | ||
Line 28: | Line 28: | ||
====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
- | Element class properties have the prefix | + | Element class properties have the prefix |
===== enabled ===== | ===== enabled ===== | ||
Determines if the behavior is initially enabled. | Determines if the behavior is initially enabled. | ||
- | * Full name: "stepAside.enabled" | + | * Full name: '' |
* Type: boolean | * Type: boolean | ||
- | * Default Value: true | + | * Default Value: |
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
===== radius ===== | ===== radius ===== | ||
Avoid radius. Actor tries to move to a position with this distance away from the moving lane of the actor requesting to step aside. | Avoid radius. Actor tries to move to a position with this distance away from the moving lane of the actor requesting to step aside. | ||
- | * Full name: "stepAside.radius" | + | * Full name: '' |
* Type: floating point | * Type: floating point | ||
* Minimum Value: 0 | * Minimum Value: 0 | ||
* Default value: 0.4 | * Default value: 0.4 | ||
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. | ||
+ | |||
+ | ===== stepAside.set ===== | ||
+ | |||
+ | Set one or more step aside parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |enabled|'' | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== stepAside.check ===== | ||
+ | |||
+ | Check one or more step aside parameters. Action succeeds if all parameter value matches their respective step aside parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a step aside parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |enabled|'' | ||
+ | |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 step aside is enabled --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. | ||
+ | |||
+ | ===== stepAside.check ===== | ||
+ | |||
+ | Check one or more step aside parameters. Conditions returns true if all parameter value match their respective step aside parameter. This condition is typically used to run an action or sequence of actions as long as step aside conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |stepAside.enabled|'' | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ===== stepAside.stepAside ===== | ||
+ | |||
+ | Step aside. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 49: | Line 120: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | |
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 57: | Line 130: | ||
# | # | ||
- | Since DragonScript Module Version | + | Since DragonScript Module Version |
====== Use Cases ====== | ====== Use Cases ====== | ||
Line 90: | Line 163: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | < | ||
+ | <!-- 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 --> | ||
+ | <float name=' | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Live Examples ====== | ||
+ | |||
+ | * [[https:// | ||
+ |