Drag[en]gine Script Module DragonScript
1.21
|
Behavior element behavior adding timer support to behavior tree support. More...
Classes | |
class | BehaviorTreeTimer |
Behavior tree Timer. More... | |
class | Instance |
Behavior instance. More... | |
Additional Inherited Members | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
void | dispose () |
Dispose of behavior. 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... | |
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... | |
Behavior element behavior adding timer support to behavior tree support.
Behavior adds behavior tree actions and conditions to an ECBehaviorBehaviorTree allowing behavior trees to start and wait for multiple independent timers. This behavior can be added multiple times to an element for each ECBehaviorBehaviorTree. Each instance creates an own set of behavior tree action and conditions and timers. Hence to use more than one behavior tree use code like this in your subclass constructor:
The following actions are added to the behavior tree:
Starts a timer. As parameter use "timeout" to set the seconds until the timer elapses or "timeout.lower" and "timeout.upper" to randomly select seconds between a lower and upper limit (inclusive). Optionally use parameter "timer" to select the timer. "timer" is a string identifier you can freely choose. If absent empty string is used as timer identifier. The timer is created if absent. This action immediately returns and does not require a rule identifier.
This is an example of using this action:
This is an example of using this action with random timeout:
Stops a timer. Optionally as parameter use "timer" to select the timer matching an identifier used in a previous action "timer.start". This action immediately returns and does not require a rule identifier.
This is an example of using this action:
Waits for a timer to elapse. Optionally as parameter use "timer" to select the timer matching an identifier used in a previous action "timer.start". The action keeps running until the timer elapsed. If the timer is absent the action immediately returns.
This is an example of using this action:
Determines if timer is running and has not elapsed yet. Optionally as parameter use "timer" to select the timer matching an identifier used in a previous action "timer.start".
This is an example of an action that can only run if the timer "myTimer" is running:
Determines if timer is not running or has elapsed. Optionally as parameter use "timer" to select the timer matching an identifier used in a previous action "timer.start".
This is an example of an action that can only run if the timer "myTimer" is running: