User Tools

Site Tools


dragengine:modules:dragonscript:behavior_navigator

ECBehaviorNavigator

Behavior element behavior adding navigator support for actors.

Adds Navigator resource to actor. Actors use Navigator to find path around the game world using navigation spaces. Usually actors have one navigator but it is possible to have multiple navigators. Using different navigators path can be found and processed on different navigation space levels.

By default the navigator has no cost types assigned. Actors set up the cost type in their actions.

See also:

Instance Counts

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

Element Class Properties

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

layer

Set layer. Only navigation spaces, navigation blockers and navgiators on the same layer affect each other.

  • Full name: navigator.layer or navigator({id}).layer
  • Type: integer
  • Default Value: 0
  • Example (*.deeclass)
    <integer name='navigator.layer'>1</integer>

spaceType

Set navigation space type to use.

  • Full name: navigator.spaceType or navigator({id}).spaceType
  • Type: enumeration
  • Allowed Values:

    ValueDescription
    gridNavigation Grid.
    meshNavigation Mesh.
    volumeNavigation Volume.
  • Default Value: mesh
  • Example (*.deeclass)
    <string name='navigator.spaceType'>grid</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 required element class to be persistable (setPersistable).

API Documentation

ECBehaviorNavigator.

Since DragonScript Module Version 1.0

Use Cases

  • Allow actor to find path across navigation spaces.

Element Class Example

This example defines an element which supports navigation.

class MyElement extends BehaviorElementClass
  public var ECBehaviorNavigator navigator
  func new()
    navigator = ECBehaviorNavigator.new(this)
  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='ECBehaviorNavigator'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <integer name='.layer'>1</integer>
  </behavior>
 
  <!-- for adding multiple behaviors use unique identifiers -->
  <behavior type='ECBehaviorNavigator' id='second'/>
</elementClass>

Live Examples

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