This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_actortransmission [2024/03/14 16:49] – dragonlord | dragengine:modules:dragonscript:behavior_actortransmission [2025/05/11 13:12] (current) – [actorTransmission.transmission] dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 19: | Line 19: | ||
====== Instance Counts ====== | ====== Instance Counts ====== | ||
- | This behavior can be added only once to an element | + | This behavior can be used only once on an element. |
====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
- | Element class properties have the prefix | + | Element class properties have the prefix |
===== 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: '' |
- | * Type boolean | + | * Type: boolean |
- | * Default Value false | + | * Default Value: '' |
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
===== 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: '' |
- | * Type string | + | * Type: string |
- | * Default Value //null// | + | * Default Value: '' |
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
===== timeout ===== | ===== timeout ===== | ||
Timeout in seconds to display individual transmission parts. | Timeout in seconds to display individual transmission parts. | ||
- | * Full name: "transmission.timeout" | + | * Full name: '' |
- | * Type float | + | * Type: float |
- | * Default Value 5 | + | * Default Value: '' |
- | * Example (*.deeclass) <code xml>< | + | * Example (*.deeclass) <code xml>< |
+ | |||
+ | ===== clearEnterConversation ===== | ||
+ | Set clear transmission upon entering conversation. | ||
+ | * Full name: '' | ||
+ | * Type: boolean | ||
+ | * Default Value: false | ||
+ | * Example (*.deeclass) <code xml>< | ||
+ | |||
+ | ====== 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.set ===== | ||
+ | |||
+ | Set one or more actor transmission parameters. | ||
+ | |||
+ | ^Parameter^Value^Description^ | ||
+ | |waitInConversation|'' | ||
+ | |clearEnterConversation|'' | ||
+ | |||
+ | This is an example of using this action: | ||
+ | <code xml> | ||
+ | <action name=' | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 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.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|'' | ||
+ | |clearEnterConversation|'' | ||
+ | |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> | ||
+ | < | ||
+ | <action name=' | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <!-- actions here run only if transmission is running with less than 3 seconds remaining for the current part --> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Tree Conditions ====== | ||
+ | |||
+ | This behavior adds these behavior tree conditions if behavior tree is present. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== 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|'' | ||
+ | |actorTransmission.clearEnterConversation|'' | ||
+ | |actorTransmission.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=' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== State Machine Actions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Conditions ====== | ||
+ | |||
+ | Same as [[# | ||
+ | |||
+ | ====== State Machine Events ====== | ||
+ | |||
+ | This behavior sends these state machine events. If behavior has non-empty identifier replace '' | ||
+ | |||
+ | ===== 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 | + | |
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
====== 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: | ||
# | # | ||
- | Since DragonScript Module Version | + | Since DragonScript Module Version |
====== Use Cases ====== | ====== Use Cases ====== | ||
Line 112: | Line 241: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | < | ||
+ | <!-- optional: use BaseGameApp sub title. game can add more supported values. | ||
+ | | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use behavior tree with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use state machine with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
+ | <float name=' | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Live Examples ====== | ||
+ | |||
+ | * [[https:// | ||
+ |