Start Page » DragonScript Scripting Language » Behavior Elements: Quick and Easy Development » 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:
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 have the prefix navigator.
or navigator({id}).
if id is not empty.
Set layer. Only navigation spaces, navigation blockers and navgiators on the same layer affect each other.
navigator.layer
or navigator({id}).layer
<integer name='navigator.layer'>1</integer>
Set navigation space type to use.
navigator.spaceType
or navigator({id}).spaceType
Allowed Values:
Value | Description |
---|---|
grid | Navigation Grid. |
mesh | Navigation Mesh. |
volume | Navigation Volume. |
mesh
<string name='navigator.spaceType'>grid</string>
This behavior has no events.
This behavior requires no other behaviors.
This behavior does not support optional behaviors.
This behavior does not required element class to be persistable (setPersistable).
Since DragonScript Module Version 1.0
This example defines an element which supports navigation.
class MyElement extends BehaviorElementClass public var ECBehaviorNavigator navigator func new() navigator = ECBehaviorNavigator.new(this) end end
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>