This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behaviortrees [2025/05/21 15:04] – dragonlord | dragengine:modules:dragonscript:behaviortrees [2025/06/12 17:01] (current) – [File Format (*.debt)] dragonlord | ||
---|---|---|---|
Line 67: | Line 67: | ||
The main use for this rule is to force waiting until a rule conditions fails. | The main use for this rule is to force waiting until a rule conditions fails. | ||
+ | |||
+ | Since this rules returns '' | ||
+ | <code xml> | ||
+ | <running id=' | ||
+ | </ | ||
===== Yield ===== | ===== Yield ===== | ||
Line 72: | Line 77: | ||
Returns '' | Returns '' | ||
- | This rule causes the behavior tree to yield processing for one frame update to continue with the next rule the next time it is run. This rule prevents endless choice loops. Choice loops happen if all rules in a looping choice are not applying. The last rule has to be a rule returning '' | + | This rule causes the behavior tree to yield processing for one frame update to continue with the next rule the next time it is run. This rule prevents endless choice loops. Choice loops happen if all rules in a looping choice are not applying. The last rule has to be a rule returning '' |
This rule can also be used to add single frame delays in a behavior tree, for example to ensure actors are not running actions too fast. | This rule can also be used to add single frame delays in a behavior tree, for example to ensure actors are not running actions too fast. | ||
+ | Since this rules can return '' | ||
+ | <code xml> | ||
+ | <yield id=' | ||
+ | </ | ||
====== File Format (*.debt) ====== | ====== File Format (*.debt) ====== | ||
- | The behavior tree file format is recognized by the LoadBehaviorTree script class. The file is an XML file with a simple structure to define a behavior tree using XML. | + | The behavior tree file format is recognized by the LoadBehaviorTree script class. The file is an XML file with a simple structure to define a behavior tree using XML. See [[https:// |
<uml> | <uml> | ||
Line 159: | Line 168: | ||
} | } | ||
behaviorTree --> yield | behaviorTree --> yield | ||
+ | |||
+ | object " | ||
+ | <# | ||
+ | |condition| | ||
+ | |conditionMode| | ||
+ | } | ||
+ | behaviorTree --> subtree | ||
@enduml | @enduml | ||
Line 183: | Line 199: | ||
^Attribute^Description^Occurance^Default^ | ^Attribute^Description^Occurance^Default^ | ||
|name|Name of action to run.|Required|-| | |name|Name of action to run.|Required|-| | ||
+ | |id|Rule identifier. Required for actions potentially returning '' | ||
|doNotFail|If action fails return '' | |doNotFail|If action fails return '' | ||
Line 203: | Line 220: | ||
^Attribute^Description^Occurance^Default^ | ^Attribute^Description^Occurance^Default^ | ||
|loop|Loop sequence.|Optional|'' | |loop|Loop sequence.|Optional|'' | ||
+ | |id|Rule identifier. Used to support persistance. If identifier starts with '' | ||
|doNotFail|If sequence fails return '' | |doNotFail|If sequence fails return '' | ||
Line 231: | Line 249: | ||
^Attribute^Description^Occurance^Default^ | ^Attribute^Description^Occurance^Default^ | ||
|loop|Loop choice.|Optional|'' | |loop|Loop choice.|Optional|'' | ||
+ | |id|Rule identifier. Used to support persistance. If identifier starts with '' | ||
|doNotFail|If choice fails return '' | |doNotFail|If choice fails return '' | ||
Line 288: | Line 307: | ||
Adds a running rule. | Adds a running rule. | ||
+ | |||
+ | ^Attribute^Description^Occurance^Default^ | ||
+ | |id|Rule identifier. Required to support persistance. If identifier starts with '' | ||
^Tag^Description^Occurance^Default^ | ^Tag^Description^Occurance^Default^ | ||
Line 304: | Line 326: | ||
Adds a yield rule. | Adds a yield rule. | ||
+ | |||
+ | ^Attribute^Description^Occurance^Default^ | ||
+ | |id|Rule identifier. Required to support persistance. If identifier starts with '' | ||
^Tag^Description^Occurance^Default^ | ^Tag^Description^Occurance^Default^ |