dragengine:modules:dragonscript:behavior_statemachine
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |
dragengine:modules:dragonscript:behavior_statemachine [2024/03/14 16:36] – dragonlord | dragengine:modules:dragonscript:behavior_statemachine [2024/03/14 16:43] (current) – dragonlord |
---|
Behavior element behavior adding #@LinkApiDocDEDS2_HTML~classDragengine_1_1StateMachineSystem_1_1StateMachine.html,StateMachine~@# support. | Behavior element behavior adding #@LinkApiDocDEDS2_HTML~classDragengine_1_1StateMachineSystem_1_1StateMachine.html,StateMachine~@# support. |
| |
Loads state machine from file (*.desm) and creates an #@LinkApiDocDEDS2_HTML~classDragengine_1_1StateMachineSystem_1_1SMContext.html,SMContext~@#. Other behaviors can add [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html|actions]] and [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html|conditions]] to this state machine allowing to compose state machine actions and conditions easily. | Loads state machine from file (*.desm) and creates an #@LinkApiDocDEDS2_HTML~classDragengine_1_1StateMachineSystem_1_1SMContext.html,SMContext~@#. Other behaviors can add #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html,actions~@# and #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html,conditions~@# to this state machine allowing to compose state machine actions and conditions easily. |
| |
This behavior can be used in different ways depending on the needs. | This behavior can be used in different ways depending on the needs. |
**Action and Condition Factory** | **Action and Condition Factory** |
| |
You can assign [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html|actions]] and [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html|conditions]] without using other behaviors by using one or more [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Scenery_1_1ECBehaviorStateMachine_1_1ActionConditionFactory.html|Action/Condition Factories]]. The factories are added to the behavior. Upon creating the behavior instances the factories are asked to create and assign [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html|SMAction]] and [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html|SMCondition]]. | You can assign #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html,actions~@# and #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html,conditions~@# without using other behaviors by using one or more #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1Scenery_1_1ECBehaviorStateMachine_1_1ActionConditionFactory.html,Action/Condition Factories~@#. The factories are added to the behavior. Upon creating the behavior instances the factories are asked to create and assign #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMAction.html,SMAction~@# and #@LinkApiDocDEDS2_HTML~interfaceDragengine_1_1StateMachineSystem_1_1SMCondition.html,SMCondition~@#. |
| |
The example below shows how to use a factory to add a condition checking for a trigger and an action manipulating a trigger. | The example below shows how to use a factory to add a condition checking for a trigger and an action manipulating a trigger. |
dragengine/modules/dragonscript/behavior_statemachine.txt · Last modified: 2024/03/14 16:43 by dragonlord