This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_statemachine [2025/03/11 18:54] – dragonlord | dragengine:modules:dragonscript:behavior_statemachine [2025/05/09 19:04] (current) – dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 44: | Line 44: | ||
===== path ===== | ===== path ===== | ||
Set path to state machine file to load. | Set path to state machine file to load. | ||
- | * Full name: '' | + | * Full name: '' |
* Type: string | * Type: string | ||
* Default Value: empty string | * Default Value: empty string | ||
* Expected File Type: '' | * Expected File Type: '' | ||
- | * Example (*.deeclass) <code xml>< | + | * Example (*.deeclass) <code xml>< |
+ | |||
+ | ===== debug ===== | ||
+ | Debug mode prefix. If not empty string enables debug mode with prefix to locate log messages easily. | ||
+ | * Full name: '' | ||
+ | * Type: string | ||
+ | * Default Value: empty string | ||
+ | * Example (*.deeclass) <code xml>< | ||
===== Events ===== | ===== Events ===== | ||
This behavior has no events. | This behavior has no events. | ||
+ | |||
+ | ====== Behavior Tree Actions ====== | ||
+ | |||
+ | This behavior adds these behavior tree actions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== stateMachine.set ===== | ||
+ | |||
+ | Set one or more state machine parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |reset| |Set state machine root state as current state| | ||
+ | |state|string|Set state machine state to state with identifier matching string value| | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== stateMachine.event ===== | ||
+ | |||
+ | Run event on state machine. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |id|string|Identifier of event to run| | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== stateMachine.check ===== | ||
+ | |||
+ | Check one or more state machine parameters. Action succeeds if all parameter value matches their respective state machine parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a state machine parameter matches (or not). | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |state|string|Current state identifier matches string value| | ||
+ | |state.not|string|Current state identifier does not match string value| | ||
+ | |state.starts|string|Current state identifier starts with string value| | ||
+ | |state.starts.not|string|Current state identifier does not start with string value| | ||
+ | |state.ends|string|Current state identifier ends with string value| | ||
+ | |state.ends.not|string|Current state identifier does not end with string value| | ||
+ | |state.contains|string|Current state identifier contains string value| | ||
+ | |state.contains.not|string|Current state identifier does not contain string value| | ||
+ | |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 state machine is in the " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== stateMachine.check ===== | ||
+ | |||
+ | Check one or more state machine parameters. Conditions returns true if all parameter value match their respective state machine parameter. This condition is typically used to run an action or sequence of actions as long as state machine conditions are true. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |stateMachine.state|string|Current state identifier matches string value| | ||
+ | |stateMachine.state.not|string|Current state identifier does not match string value| | ||
+ | |stateMachine.state.starts|string|Current state identifier starts with string value| | ||
+ | |stateMachine.state.starts.not|string|Current state identifier does not start with string value| | ||
+ | |stateMachine.state.ends|string|Current state identifier ends with string value| | ||
+ | |stateMachine.state.ends.not|string|Current state identifier does not end with string value| | ||
+ | |stateMachine.state.contains|string|Current state identifier contains string value| | ||
+ | |stateMachine.state.contains.not|string|Current state identifier does not contain string value| | ||
+ | |||
+ | This is an example of using this condition: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
Line 60: | Line 151: | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
- | This behavior | + | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: |
====== Persistency ====== | ====== Persistency ====== |