Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorRideOn Class Reference

Behavior adding support to actors to ride on ECBehaviorRidable. More...

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

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
class  DefaultListener
 Default implementation of behavior instance listener. More...
class  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...
interface  Listener
 Listener for behavior instance events. More...
interface  ListenerFactory
 Factory creating listeners. More...

Public Member Functions

void addListenerFactory (Block blockFactory)
 Add listener factory using block.
void addListenerFactory (ListenerFactory factory)
 Add listener factory.
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance.
void dispose ()
 Dispose of behavior.
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory.
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior.
ECBehaviorProjectToGround getProjectToGround ()
 Project to ground behavior.
ECBehaviorRideOn new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, ECBehaviorProjectToGround projectToGround)
 Create behavior element class.
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.

Static Public Member Functions

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

Public Attributes

ECComposeBTSM pBTSMs
Array pListenerFactories
ECBehaviorLocomotion pLocomotion
ECBehaviorProjectToGround pProjectToGround

Additional Inherited Members

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

Detailed Description

Behavior adding support to actors to ride on ECBehaviorRidable.

Requires these behaviors to be present:

If ECBehaviorProjectToGround and ECBehaviorColliderAI are enabled sets the ridable to the ground element if element supports ECBehaviorRidable. Otherwise clears the ridable.

Sometimes it is necessary to prevent the ridable to change although it usually would. This can be for example if an actor interacts with an object like sitting on a chair. Projecting to ground usually has to be disabled in this case to prevent the actor climbing on the chair instead of sitting on it. In general this is not a problem since the actor is usually not riding on another element. If tough the actor does ride on another element disabling projecting to ground will clear the ridable. This in turn causes the element to no more move together with the ridable element causing issues. To prevent this problem the ridable can be locked using setLocked(). While locked changes due to ECBehaviorProjectToGround changes will not cause setRidable() to be called. While locked you can still manually call setRidable() to assign a ridable of your choice.

Behavior supports persistency.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_rideon

Member Function Documentation

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorRideOn.addListenerFactory ( Block blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorRideOn.addListenerFactory ( ListenerFactory factory)

Add listener factory.

Referenced by getBehaviorIn().

◆ createListeners()

void Dragengine.Scenery.ECBehaviorRideOn.createListeners ( Instance instance)

Create listeners from factories adding them to behavior instance.

References pLocomotion.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorRideOn.Instance.removeFromGameWorld().

◆ dispose()

void Dragengine.Scenery.ECBehaviorRideOn.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

References getProjectToGround(), and pProjectToGround.

Referenced by getBehaviorIn().

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorRideOn.forEachListenerFactory ( Block ablock)

Visit listener factories with block with argument ListenerFactory.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

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

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorRideOn.getBTSMs ( )

Compose behavior trees and state machines.

Version
1.26

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorRideOn.Instance.readFromFile().

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorRideOn.getLocomotion ( )

Locomotion behavior.

References getLocomotion().

Referenced by getBehaviorIn(), and getLocomotion().

◆ getProjectToGround()

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorRideOn.getProjectToGround ( )

Project to ground behavior.

References pLocomotion.

Referenced by dispose(), and getBehaviorIn().

◆ new()

ECBehaviorRideOn Dragengine.Scenery.ECBehaviorRideOn.new ( BehaviorElementClass eclass,
ECBehaviorLocomotion locomotion,
ECBehaviorProjectToGround projectToGround )

Create behavior element class.

Referenced by getBehaviorIn().

Member Data Documentation

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorRideOn.pBTSMs

Referenced by getBehaviorIn().

◆ pListenerFactories

Array Dragengine.Scenery.ECBehaviorRideOn.pListenerFactories

Referenced by getBehaviorIn().

◆ pLocomotion

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorRideOn.pLocomotion

◆ pProjectToGround

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorRideOn.pProjectToGround

Referenced by dispose(), and getBehaviorIn().


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