Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorActorMoverUnstuck Class Reference

Behavior adding support to unstuck actors moved by ECBehaviorActorMover. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorActorMoverUnstuck:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Instance
 Behavior instance. More...
 

Public Member Functions

void dispose ()
 Dispose of behavior. More...
 
ECBehaviorActorMover getActorMover ()
 Actor mover behavior. More...
 
ECPFloat getInterval ()
 Update interval. More...
 
ECPFloat getThreshold ()
 Distance threshold. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorActorMoverUnstuck new (BehaviorElementClass eclass, ECBehaviorActorMover actorMover)
 Create behavior element class. More...
 
ECBehaviorActorMoverUnstuck new (BehaviorElementClass eclass, ECBehaviorActorMover actorMover, String prefix)
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorActorMoverUnstuck getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

ECBehaviorActorMover pActorMover
 
ECPFloat pInterval
 
ECPFloat pThreshold
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior adding support to unstuck actors moved by ECBehaviorActorMover.

Version
1.19

This behavior helps in situations where an actor moving along a path ends up in a stuck position. This can happen due to other behaviors like ECBehaviorAvoidCollision trying to avoid obstacles as well as due to game events pushing the actor into unfavorable positions.

This behavior attaches to ECBehaviorActorMover to track if actor is moving. If the actor is moving the position of the actor is examined after an interval. If the position does not change by a threshold amount relative to the last tracked position the actor is considered stuck and ECBehaviorActorMover.updatePath() is called to calculate a new path.

The default interval is 3 seconds. The threshold is factor multiplied by the distance the actor would travel unobstructed using the movement speed set in ECBehaviorActorMover. The default threshold is 0.2 (20% of expected movement distance).

These parameters can be adjusted to match the actors.

This behavior can be temporarily disabled at runtime if required. By default the behavior is enabled.

To use this behavior add it to the element class after ECBehaviorActorMover.

Requires these behaviors to be present:

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorActorMoverUnstuck.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getActorMover()

ECBehaviorActorMover Dragengine.Scenery.ECBehaviorActorMoverUnstuck.getActorMover ( )

Actor mover behavior.

◆ getBehaviorIn()

static ECBehaviorActorMoverUnstuck Dragengine.Scenery.ECBehaviorActorMoverUnstuck.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorActorMoverUnstuck.

◆ getInterval()

ECPFloat Dragengine.Scenery.ECBehaviorActorMoverUnstuck.getInterval ( )

Update interval.

◆ getThreshold()

ECPFloat Dragengine.Scenery.ECBehaviorActorMoverUnstuck.getThreshold ( )

Distance threshold.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorActorMoverUnstuck.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/2]

ECBehaviorActorMoverUnstuck Dragengine.Scenery.ECBehaviorActorMoverUnstuck.new ( BehaviorElementClass  eclass,
ECBehaviorActorMover  actorMover 
)

Create behavior element class.

◆ new() [2/2]

ECBehaviorActorMoverUnstuck Dragengine.Scenery.ECBehaviorActorMoverUnstuck.new ( BehaviorElementClass  eclass,
ECBehaviorActorMover  actorMover,
String  prefix 
)

Member Data Documentation

◆ pActorMover

ECBehaviorActorMover Dragengine.Scenery.ECBehaviorActorMoverUnstuck.pActorMover

◆ pInterval

ECPFloat Dragengine.Scenery.ECBehaviorActorMoverUnstuck.pInterval

◆ pThreshold

ECPFloat Dragengine.Scenery.ECBehaviorActorMoverUnstuck.pThreshold

The documentation for this class was generated from the following file: