User Tools

Site Tools


dragengine:modules:dragonscript:behavior_actortransmission

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:behavior_actortransmission [2024/03/14 16:49] dragonlorddragengine:modules:dragonscript:behavior_actortransmission [2025/05/11 13:12] (current) – [actorTransmission.transmission] dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorActorTransmission**+[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorActorTransmission**
 </WRAP> </WRAP>
  
Line 19: Line 19:
 ====== Instance Counts ====== ====== Instance Counts ======
  
-This behavior can be added only once to an element class. While technically possible it there is no reason to use multiple transmissions since the sub titles can be styled.+This behavior can be used only once on an element.
  
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **transmission.** if id is not empty.+Element class properties have the prefix ''transmission.''.
  
 ===== waitInConversation ===== ===== waitInConversation =====
 If enabled causes conversation scripts to wait for the transmission to end. If enabled causes conversation scripts to wait for the transmission to end.
-  * Full name: "transmission.waitInConversation" +  * Full name: ''transmission.waitInConversation'' 
-  * Type boolean +  * Typeboolean 
-  * Default Value false+  * Default Value: ''false''
   * Example (*.deeclass) <code xml><boolean name='transmission.waitInConversation'>true</boolean></code>   * Example (*.deeclass) <code xml><boolean name='transmission.waitInConversation'>true</boolean></code>
  
 ===== style ===== ===== style =====
 Style identifier to use. Same as style identifiers used in sub title boxes. Style identifier to use. Same as style identifiers used in sub title boxes.
-  * Full name: "transmission.style" +  * Full name: ''transmission.style'' 
-  * Type string +  * Typestring 
-  * Default Value //null//+  * Default Value: ''null''
   * Example (*.deeclass) <code xml><string name='transmission.style'>think</string></code>   * Example (*.deeclass) <code xml><string name='transmission.style'>think</string></code>
  
 ===== timeout ===== ===== timeout =====
 Timeout in seconds to display individual transmission parts. Timeout in seconds to display individual transmission parts.
-  * Full name: "transmission.timeout" +  * Full name: ''transmission.timeout'' 
-  * Type float +  * Typefloat 
-  * Default Value 5 +  * Default Value: ''5'' 
-  * Example (*.deeclass) <code xml><string name='actorIK.controllerIKHeight'>ik.height</string></code>+  * Example (*.deeclass) <code xml><string name='transmission.timeout'>ik.height</string></code> 
 + 
 +===== clearEnterConversation ===== 
 +Set clear transmission upon entering conversation. 
 +  * Full name: ''transmission.clearEnterConversation'' 
 +  * Type: boolean 
 +  * Default Value: false 
 +  * Example (*.deeclass) <code xml><boolean name='transmission.clearEnterConversation'>true</boolean></code> 
 + 
 +====== 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 ''actorTransmission'' with ''actorTransmission(id)''
 + 
 +===== actorTransmission.set ===== 
 + 
 +Set one or more actor transmission parameters. 
 + 
 +^Parameter^Value^Description^ 
 +|waitInConversation|''true'', ''false''|Enable wait in conversation| 
 +|clearEnterConversation|''true'', ''false''|Clear transmission on enter conversation| 
 + 
 +This is an example of using this action: 
 +<code xml> 
 +<action name='actorTransmission.set'> 
 +  <parameter name='waitInConversation'>true</parameter> 
 +</action> 
 +</code> 
 + 
 +===== actorTransmission.update ===== 
 + 
 +Update transmission. 
 + 
 +^Parameter^Value^Description^ 
 +|skip| |Skip current transmission part and show the next part if present| 
 +|clear| |Clear all transmission parts| 
 +|pause|float|Add a pause to the transmission| 
 +|text|string|Add text part to transmission| 
 +|text.style|string|Style to use for text. If absent uses style set in behavior| 
 +|text.timeout|float|Time in seconds to display text. If absent uses timeout set in behavior| 
 + 
 +This is an example of using this action: 
 +<code xml> 
 +<action name='actorTransmission.update'> 
 +  <parameter name='clear'/> 
 +  <parameter name='text'>Text shown to the player in a transmission box.</parameter> 
 +</action> 
 +</code> 
 + 
 +===== actorTransmission.check ===== 
 + 
 +Check one or more actor transmission parameters. Action succeeds if all parameter value matches their respective actor transmission parameter otherwise action fails. This action is typically used as first action in a sequence to run the sequence only if a actor transmission parameter matches (or not). 
 + 
 +^Parameter^Value^Description^ 
 +|waitInConversation|''true'', ''false''|Wait in conversation is enabled| 
 +|clearEnterConversation|''true'', ''false''|Clear transmission on enter conversation| 
 +|running|''true'', ''false''|Transmission is running| 
 +|parts.less|integer|Count of remaining parts in transmission is less than integer value| 
 +|parts.greater|integer|Count of remaining parts in transmission is greater than integer value| 
 +|remainingDisplayTime.less|float|Remaining part display time is less than value seconds| 
 +|remainingDisplayTime.greater|float|Remaining part display time is greater than value 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> 
 +<sequence> 
 +  <action name='actorTransmission.check'> 
 +    <parameter name='running'>true</parameter> 
 +    <parameter name='remainingDisplayTime.less'>3</parameter> 
 +  </action> 
 +  <!-- actions here run only if transmission is running with less than 3 seconds remaining for the current part --> 
 +</sequence> 
 +</code> 
 + 
 +====== Behavior Tree Conditions ====== 
 + 
 +This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace ''actorTransmission'' with ''actorTransmission(id)''
 + 
 +===== actorTransmission.check ===== 
 + 
 +Check one or more actor transmission parameters. Conditions returns true if all parameter value match their respective actor transmission parameter. This condition is typically used to run an action or sequence of actions as long as actor transmission conditions are true. 
 + 
 +^Parameter^Value^Description^ 
 +|actorTransmission.waitInConversation|''true'', ''false''|Wait in conversation is enabled| 
 +|actorTransmission.clearEnterConversation|''true'', ''false''|Clear transmission on enter conversation| 
 +|actorTransmission.running|''true'', ''false''|Transmission is running| 
 +|actorTransmission.parts.less|integer|Count of remaining parts in transmission is less than integer value| 
 +|actorTransmission.parts.greater|integer|Count of remaining parts in transmission is greater than integer value| 
 +|actorTransmission.remainingDisplayTime.less|float|Remaining part display time is less than value seconds| 
 +|actorTransmission.remainingDisplayTime.greater|float|Remaining part display time is greater than value seconds| 
 + 
 +This is an example of using this condition: 
 +<code xml> 
 +<action name='myAction' id='doing something'> 
 +  <parameter name='actorTransmissionrunning'>true</parameter> 
 +  <parameter name='actorTransmissionremainingDisplayTime.less'>3</parameter> 
 +  <condition>actorTransmission.check</condition> 
 +</action> 
 +</code> 
 + 
 +====== State Machine Actions ====== 
 + 
 +Same as [[#behavior_tree_actions|Behavior Tree Actions]]. 
 + 
 +====== State Machine Conditions ====== 
 + 
 +Same as [[#behavior_tree_conditions|Behavior Tree Conditions]]. 
 + 
 +====== State Machine Events ====== 
 + 
 +This behavior sends these state machine events. If behavior has non-empty identifier replace ''actorTransmission'' with ''actorTransmission(id)''
 + 
 +===== actorTransmission.start ===== 
 + 
 +Transmission started. Send if a pause or text part is added while the part count is 0. 
 + 
 +===== actorTransmission.part ===== 
 + 
 +Next part in a transmission is shown. 
 + 
 +===== actorTransmission.finished ===== 
 + 
 +Last part in the transmission finished.
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
 +
   * [[behavior_conversationactor|ECBehaviorConversationActor]]   * [[behavior_conversationactor|ECBehaviorConversationActor]]
  
 ====== Optional Behaviors ====== ====== Optional Behaviors ======
-This behavior does not support optional behaviors.+ 
 +  * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use. 
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
  
 ====== Persistency ====== ====== Persistency ======
 +
 This behavior supports persistency. These parameters are persisted: This behavior supports persistency. These parameters are persisted:
   * Wait in conversation flag   * Wait in conversation flag
Line 62: Line 191:
 #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorActorTransmission.html,ECBehaviorActorTransmission~@#. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorActorTransmission.html,ECBehaviorActorTransmission~@#.
  
-Since DragonScript Module Version **1.7**+Since DragonScript Module Version ''1.7''
  
 ====== Use Cases ====== ====== Use Cases ======
Line 112: Line 241:
 end end
 </code> </code>
 +
 +====== Behavior Factory ======
 +
 +Using element class supporting adding behaviors the behavior can be added like this:
 +<code xml>
 +<?xml version='1.0' encoding='UTF-8'?>
 +<elementClass name='MyClass' class='GenericBehaviorElement'>
 +  <behavior type='ECBehaviorComponent'/>
 +  <behavior type='ECBehaviorCollider'/>
 +  <behavior type='ECBehaviorConversationActor'/>
 +  
 +  <behavior type='ECBehaviorActorTransmission'>
 +    <!-- optional: use BaseGameApp sub title. game can add more supported values.
 +                   default is 'default' -->
 +    <string name='subTitle'>default</string>
 +    
 +    <!-- optional: use behavior tree with id instead of empty string -->
 +    <string name='behaviorTree'>second</string>
 +    
 +    <!-- optional: use state machine with id instead of empty string -->
 +    <string name='stateMachine'>second</string>
 +    
 +    <!-- set element properties. omit property prefix if used inside behavior tag -->
 +    <float name='.timeout'>3</float>
 +  </behavior>
 +</elementClass>
 +</code>
 +
 +====== Live Examples ======
 +
 +  * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]
 +
dragengine/modules/dragonscript/behavior_actortransmission.1710434941.txt.gz · Last modified: 2024/03/14 16:49 by dragonlord