User Tools

Site Tools


dragengine:modules:dragonscript:behavior_ctrrbindings

ECBCTRRBindings

Behavior element behavior adding bindings tag resolving using CTRRBinding.

Adds a CTRRBinding rule to ECBehaviorConversationActor.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix ctrrBinding. .

Events

This behavior has no events.

Required Behaviors

Optional Behaviors

This behavior does not support optional behaviors.

Persistency

This behavior does not required element class to be persistable (setPersistable).

API Documentation

ECBCTRRBindings.

Since DragonScript Module Version 1.0

Use Cases

  • Add support to add rules to dynamically insert text in conversations.

Element Class Example

This example defines an element which support for conversation tag rules.

class MyElement extends BehaviorElementClass
  public var ECBehaviorConversationActor conversationActor
  public var ECBCTRRBindings ctrrBindings
  func new()
    conversationActor = ECBehaviorConversationActor.new(this)
    ctrrBindings = ECBCTRRBindings.new(this, conversationActor)
  end
end

Behavior Factory

Using element class supporting adding behaviors the behavior can be added like this:

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
  <behavior type='ECBehaviorConversationActor'/>
 
  <behavior type='ECBCTRRBindings'>
    <!-- optional: use BaseGameApp command mananager. game can add more supported values. default is 'default' -->
    <string name='commandManager'>default</string>
 
    <!-- optional: use BaseGameApp binding manager. game can add more supported values. default is 'default' -->
    <string name='bindingManager'>default</string>
 
    <!-- optional: use BaseGameApp subtitle theme. game can add more supported values.
                   default is 'default'. also supported is value 'path:/path/to/theme.guitheme' -->
    <string name='subtitleTheme'>default</string>
 
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.name'>value</string>
  </behavior>
 
  <!-- for adding multiple behaviors use unique identifiers -->
  <behavior type='ECBCTRRBindings' id='second'/>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
dragengine/modules/dragonscript/behavior_ctrrbindings.txt · Last modified: 2025/03/12 19:41 by dragonlord