This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_timer [2025/03/13 16:26] – created dragonlord | dragengine:modules:dragonscript:behavior_timer [2025/05/04 13:49] (current) – [timer.check] dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 124: | Line 124: | ||
===== timerCancelled ===== | ===== timerCancelled ===== | ||
+ | |||
+ | Timer cancelled. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== timer.set ===== | ||
+ | |||
+ | Set one or more timer trigger parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |target|'' | ||
+ | |timer|'' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | </ | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== timer.check ===== | ||
+ | |||
+ | Check one or more timer trigger parameters. Action succeeds if all parameter value matches their respective timer trigger parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a timer trigger parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |trigger|'' | ||
+ | |target.fired|'' | ||
+ | |target.everFired|'' | ||
+ | |running|'' | ||
+ | |remaining.less|float|Remaining timer time is less than value in seconds| | ||
+ | |remaining.greater|float|Remaining timer time is greater than value in seconds| | ||
+ | |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 timer is running with less than 3 seconds remaining --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== timer.check ===== | ||
+ | |||
+ | Check one or more timer trigger parameters. Conditions returns true if all parameter value match their respective timer trigger parameter. This condition is typically used to run an action or sequence of actions as long as timer trigger conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |timer.trigger|'' | ||
+ | |timer.target.fired|'' | ||
+ | |timer.target.everFired|'' | ||
+ | |timer.running|'' | ||
+ | |timer.remaining.less|float|Remaining timer time is less than value in seconds| | ||
+ | |timer.remaining.greater|float|Remaining timer time is greater than value in seconds| | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | ===== timer.started ===== | ||
+ | |||
+ | Timer started. | ||
+ | |||
+ | ===== timer.elapsed ===== | ||
+ | |||
+ | Timer elapsed. | ||
+ | |||
+ | ===== timer.cancelled ===== | ||
Timer cancelled. | Timer cancelled. | ||
Line 133: | Line 231: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: |
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== Persistency ====== | ====== Persistency ====== | ||
Line 174: | Line 272: | ||
| | ||
<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 --> |