|
Drag[en]gine Script Module DragonScript 1.35
|
Behavior element behavior adding flags support to behavior trees and state machines. More...
Classes | |
| class | Factory |
| Behavior factory. More... | |
| class | Instance |
| Behavior instance. More... | |
Additional Inherited Members | |
| Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| void | assignInstanceIndex (int instanceIndex) |
| Assign instance index. | |
| void | dispose () |
| Dispose of behavior. | |
| 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. | |
| 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>". | |
Behavior element behavior adding flags support to behavior trees and state machines.
Behavior adds actions, conditions and events allowing behavior trees and state machines to set, clear and check flags. This behavior can be added only once to an element class.
The following actions are added:
Update flags. The following parameters are supported:
| Parameter | Value | Description |
|---|---|---|
| set | string | Set named flag |
| clear | string | Clear named flag |
This is an example of setting a flag:
This is an example of setting and clearing a flag in the same action:
Check for flag condition. Not existing flags are considered cleared. The following parameters are supported:
| Parameter | Value | Description |
|---|---|---|
| flag | string | Flag to check |
| set | true,false | Flag is set |
| wait | Wait until the flag is set or cleared | |
| reset | Toggle flag after checking with all conditions fulfilled |
This is an example of checking if a flag is set right now:
This is an example of checking if a flag is set and waiting until it is set:
This is an example of checking if a flag is set, waiting until the flag is set and then clear it:
Check for flag condition. Not existing flags are considered cleared. The following parameters are supported:
| Parameter | Value | Description |
|---|---|---|
| flags.flag | string | Flag to check |
| flags.set | true,false | Flag is set |
This is an example of an action that can only run if the flag "arrived at target" is set:
Send to state machines if flag has been set. The name of the flag that has been set is appended to the event name.
This is an example of an transition that can only run if the flag "arrived at target" has been set:
Send to state machines if flag has been cleared. The name of the flag that has been cleared is appended to the event name.
This is an example of an transition that can only run if the flag "arrived at target" has been cleared: