User Tools

Site Tools


dragengine:modules:dragonscript:behavior_convocoordsystem

ECBehaviorConvoCoordSystem

Behavior element behavior adding conversation coordinate support.

Instance adds a ElementConvoCoordSystem to the game world the element is added to. These can be added to conversation playbacks as targets for actions. Creates a ECBehaviorConvoCoordSystem which returns the position relative to the element if queried.

Instance Counts

This behavior can be used multiple times on an element to add multiple ECBehaviorConvoCoordSystem to mainpulate. Use the behavior identifier to tell them apart.

Element Class Properties

Element class properties have the prefix convoCoordSystem. or convoCoordSystem({id}). if id is not empty.

name

Set name of conversation coordinate system. Name has to be unique in the game world the element is added to.

  • Full name: convoCoordSystem.name or convoCoordSystem({id}).name
  • Type: string
  • Default Value: empty string
  • Example (*.deeclass)
    <string name='convoCoordSystem(body).name'>target1</string>

position

Set position relative to behavior element.

  • Full name: convoCoordSystem.position or convoCoordSystem({id}).position
  • Type: 3-component float vector
  • Default Value: (0,0,0)
  • Example (*.deeclass)
    <vector name='convoCoordSystem.position' x='0' y='0' z='0.1'/>

orientation

Set orientation relative to behavior element.

  • Full name: convoCoordSystem.orientation or convoCoordSystem({id}).orientation
  • Type: 3-component float vector
  • Default Value: (0,0,0)
  • Example (*.deeclass)
    <vector name='convoCoordSystem.orientation' x='30' y='0' z='0'/>

Events

This behavior has no events.

Required Behaviors

This behavior requires no other behaviors.

Optional Behaviors

This behavior does not support optional behaviors.

Persistency

This behavior does require the element class to be persistable (setPersistable).

API Documentation

ECBehaviorConvoCoordSystem.

Since DragonScript Module Version 1.0

Use Cases

  • Allow actors to look at specific position on element during conversations.
  • Allow game scripts to align elements against a known coordinate system on the element.

Element Class Example

This example defines an element which contains a conversation coordinate system.

class MyElement extends BehaviorElementClass
  public var ECBehaviorConvoCoordSystem convoCoordSystem
  func new()
    convoCoordSystem = ECBehaviorConvoCoordSystem.new(this)
    convoCoordSystem.getPosition().setVector(Vector.new(0, 0, 0.3))
  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='ECBehaviorConvoCoordSystem'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.name'>target1</string>
  </behavior>
 
  <!-- for adding multiple behaviors use unique identifiers -->
  <behavior type='ECBehaviorConvoCoordSystem' id='second'>
    ...
  </behavior>
</elementClass>

Live Examples

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