This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_toggle [2025/03/13 16:30] – created dragonlord | dragengine:modules:dragonscript:behavior_toggle [2025/05/04 13:50] (current) – [toggle.check] dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 51: | Line 51: | ||
===== toggled ===== | ===== toggled ===== | ||
+ | |||
+ | Trigger target toggled. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== toggle.set ===== | ||
+ | |||
+ | Set one or more toggle trigger parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |target|'' | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== toggle.check ===== | ||
+ | |||
+ | Check one or more toggle trigger parameters. Action succeeds if all parameter value matches their respective toggle trigger parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a toggle trigger parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |trigger|'' | ||
+ | |target.fired|'' | ||
+ | |target.everFired|'' | ||
+ | |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 target is in reset state and has been never fired yet --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== toggle.check ===== | ||
+ | |||
+ | Check one or more toggle trigger parameters. Conditions returns true if all parameter value match their respective toggle trigger parameter. This condition is typically used to run an action or sequence of actions as long as toggle trigger conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |toggle.trigger|'' | ||
+ | |toggle.target.fired|'' | ||
+ | |toggle.target.everFired|'' | ||
+ | |||
+ | 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. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== toggle.toggled ===== | ||
Trigger target toggled. | Trigger target toggled. | ||
Line 60: | Line 137: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: |
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 99: | Line 177: | ||
| | ||
<string name=' | <string name=' | ||
+ | | ||
+ | <!-- optional: identifier of ECBehaviorTriggered to synchronize with or empty | ||
+ | | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- 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 --> |