Table of Contents

,

Start Page » DragonScript Scripting Language » Behavior Elements: Quick and Easy Development » ECBehaviorStepAside

ECBehaviorStepAside

Behavior adding support to actors to step aside if told.

This behavior is useful for situations where actors can get in the way of the player or other actors. The behavior is a reactive behavior not acting by itself. It is triggered by ECBehaviorClearPath or other behaviors supporting it if the find a future collision.

This behavior has no effect if actor mover has a goal set.

This behavior can be disabled temporarily to prevent actors from stepping aside.

Behavior in action

Instance Counts

This behavior can be used only once on an element. The behavior always has identifier empty string.

Element Class Properties

Element class properties have the prefix stepAside..

enabled

Determines if the behavior is initially enabled.

radius

Avoid radius. Actor tries to move to a position with this distance away from the moving lane of the actor requesting to step aside.

Required Behaviors

Optional Behaviors

This behavior does not support optional behaviors.

Persistency

This behavior does support element class to be persistable (setPersistable). Saves enabled state.

API Documentation

ECBehaviorStepAside.

Since DragonScript Module Version 1.4

Use Cases

Element Class Example

class ExampleElementClass extends BehaviorElementClass
   public var ECBehaviorComponent component
   public var ECBehaviorCollider collider
   public var ECBehaviorColliderAI colliderAI
   public var ECBehaviorLocomotion locomotion
   public var ECBehaviorNavigator navigator
   public var ECBehaviorActorMover actorMover
   public var ECBehaviorStepAside stepAside
   
   public func new() super("ExampleElement")
     // create required behaviors
     component = ECBehaviorComponent.new(this)
     collider = ECBehaviorCollider.new(this, component)
     colliderAI = ECBehaviorColliderAI.new(this, collider)
     locomotion = ECBehaviorLocomotion.new(this, colliderAI)
     navigator = ECBehaviorNavigator.new(this)
     actorMover = ECBehaviorActorMover.new(this, locomotion, navigator, null)
     
     // create step aside behavior
     stepAside = ECBehaviorStepAside.new(this, actorMover)
   end
end