User Tools

Site Tools


dragengine:modules:dragonscript:behavior_attachable_anchorelement

ECABehaviorAnchorElement

Attachable behavior element behavior adding anchor element support.

Anchoring elements allows to locate elements in a GameWorld using a unique name set by the mapper. This is useful for game commands send by conversations scripts.

Since version 1.35 you can also use a group name. Using the group name the element is added to the named anchor group. This allows retrieving all elements sharing similar traits, for example triggers, typed pickups and so forth. The element can be anchored using unique name and group name at the same time.

This behavior is similar to ECBehaviorAnchorElement but can be attached if required. This is especially useful in editing worlds to add an anchor to any element without needing to add \ref ECBehaviorAnchorElement to the element class itself.

Upon adding behavior to element the element class properties mentioned below are evaluated if present

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have no prefix.

anchorID

Sets the anchor name or empty string to not anchor.

  • Full name: “anchorID”
  • Type: string
  • Default Value: empty string

anchorGroupID

Sets the anchor group name or empty string to not anchor.

  • Full name: “anchorGroupID”
  • Type: string
  • Default Value: empty string

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 not require persistency.

API Documentation

ECABehaviorAnchorElement.

Since DragonScript Module Version 1.31

Use Cases

  • Reference elements in world editor using unique the anchor name.
  • Allow game scripts to locate an element in the game world using the anchor name.

Live Examples

You could leave a comment if you were logged in.
dragengine/modules/dragonscript/behavior_attachable_anchorelement.txt · Last modified: by dragonlord