User Tools

Site Tools


dragengine:modules:dragonscript:gabehavior_statemachine

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:gabehavior_statemachine [2026/10/15 20:10] – dragonlorddragengine:modules:dragonscript:gabehavior_statemachine [2026/10/16 01:18] (current) – [windowGameWorld.update] dragonlord
Line 45: Line 45:
   * Default Value: <null>   * Default Value: <null>
   * Example (*.deeclass) <code xml><string path='appBehavior/stateMachine/debug'>SM-Game</string></code>   * Example (*.deeclass) <code xml><string path='appBehavior/stateMachine/debug'>SM-Game</string></code>
- 
-====== Events ====== 
- 
-This behavior runs these state machine events. 
- 
-===== initGame ===== 
- 
-Run after all game app behaviors have initialized. 
- 
-===== servicesInitialized ===== 
- 
-Run once when all game service initialization has finished. 
- 
-===== update ===== 
- 
-Run every frame. The event parameter is the elapsed time in seconds. 
- 
-===== appActivated ===== 
- 
-Run when the application window has been activated. 
- 
-===== appDeactivated ===== 
- 
-Run when the application window has been deactivated. 
  
 ====== Actions ====== ====== Actions ======
Line 141: Line 117:
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 |visible|''true'', ''false''|Show/hide WindowGameWorld.| |visible|''true'', ''false''|Show/hide WindowGameWorld.|
 +|cameraDirector|''playerControlledActor''|<WRAP>Set camera directory in active world.
 +  * ''playerControlledActor'': Assign instance of #@LinkApiDocDEDS2_HTML~classDragengine_1_1CameraDirectors_1_1PlayerControlledActorCameraDirector.html,PlayerControlledActorCameraDirector~@#.
 +</WRAP>|
 +|cameraDirector.loadCamera|string|Load camera parameters from ''.decamera'' file.|
 +|cameraDirector.pivot|vector|Rotation point.|
 +|cameraDirector.pivot.aboveGround|float|Pivot point at desired distance above ground.|
 +|cameraDirector.localMatrix.position|vector|Position part of local matrix.|
 +|cameraDirector.localMatrix.rotation|vector|Rotation part of local matrix. Rotation is in degrees.|
 +|cameraDirector.azimuth|float|Vertical rotation.|
 +|cameraDirector.azimuth.lock|''true'', ''false''|Do to not update azimuth from locomotion changes.|
 +|cameraDirector.elevation|float|Horizontal rotation.|
 +|cameraDirector.elevation.lock|''true'', ''false''|Do not update elevation from locomotion changes.|
 +|cameraDirector.distance|float|Distance.|
 +|cameraDirector.useOrientation|''true'', ''false''|Camera rotates together with the element.|
 +|cameraDirector.bone|string|Name of bone to use as rotation point. Requires [[behavior_component|ECBehaviorComponent]] to be present.|
  
 This is an example of using this action to hide the WindowGameWorld: This is an example of using this action to hide the WindowGameWorld:
Line 154: Line 145:
  
 ^Parameter^Value^Description^ ^Parameter^Value^Description^
 +|addBehavior|string|Create game world behavior from named game world behavior factory and add it to active game world.|
 +|addBehavior.id|string|Identifier to use for ''addBehvior''. Default is empty string.|
 +|createElement|string|Create element with value named element class and add it to the active game world.|
 +|createElement.spawn|string|Name of spawn point to spawn element at.|
 +|clearWorld| |Clear the active game world if present.|
 +|loadWorld|string|Start loading world from ''.deworld'' file and assigns it as active world once finished successfully. See events ''windowGameWorld.loadWorld.*''.|
 +|loadWorld.enableNetworking|''true'', ''false''|Enable networking.|
 +|loadWorld.ignorePersistableElements|''true'', ''false''|Persistable elements are ignored. Set to true for loading persisted game states.|
 |runEvent|string|Run event on [[gwbehavior_btsm|GWBehaviorBTSM]] in the active game world. This allows application state machine to interact with element behavior state machines inside the game world.| |runEvent|string|Run event on [[gwbehavior_btsm|GWBehaviorBTSM]] in the active game world. This allows application state machine to interact with element behavior state machines inside the game world.|
  
Line 238: Line 237:
 </action> </action>
 </code> </code>
 +
 +====== Events ======
 +
 +This behavior runs these state machine events.
 +
 +===== initGame =====
 +
 +Run after all game app behaviors have initialized.
 +
 +===== servicesInitialized =====
 +
 +Run once when all game service initialization has finished.
 +
 +===== update =====
 +
 +Run every frame. The event parameter is the elapsed time in seconds.
 +
 +===== appActivated =====
 +
 +Run when the application window has been activated.
 +
 +===== appDeactivated =====
 +
 +Run when the application window has been deactivated.
 +
 +===== windowGameWorld.loadWorld.finished =====
 +
 +Loading game world started by ''windowGameWorld.loadWorld'' has finished successfully and the loaded world is now the active world.
 +
 +===== windowGameWorld.loadWorld.failed =====
 +
 +Loading game world started by ''windowGameWorld.loadWorld'' has failed. The active game world has not changed.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 260: Line 291:
 ====== Live Examples ====== ====== Live Examples ======
  
-  * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]: Element class changing color using a state machine receiving trigger events.+  * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]
  
dragengine/modules/dragonscript/gabehavior_statemachine.1792095058.txt.gz · Last modified: by dragonlord