This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_lookedat [2025/05/02 14:53] – dragonlord | dragengine:modules:dragonscript:behavior_lookedat [2025/05/04 13:47] (current) – [lookedAt.check] dragonlord | ||
---|---|---|---|
Line 21: | Line 21: | ||
Element class properties have the prefix '' | Element class properties have the prefix '' | ||
+ | |||
+ | ====== Events ====== | ||
+ | |||
+ | This behavior supports adding listeners. These events can be received: | ||
+ | |||
+ | ===== actorStartsLookingAt ===== | ||
+ | |||
+ | Actors starts looking at object. | ||
+ | |||
+ | ===== actorStopsLookingAt ===== | ||
+ | |||
+ | Actors stops looking at object. | ||
====== Behavior Tree Actions ====== | ====== Behavior Tree Actions ====== | ||
Line 36: | Line 48: | ||
|count.greater|integer|Count of actors looking at element is greater than integer value| | |count.greater|integer|Count of actors looking at element is greater than integer value| | ||
|player|'' | |player|'' | ||
+ | |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled| | ||
This is an example of using this action: | This is an example of using this action: | ||
Line 70: | Line 83: | ||
</ | </ | ||
- | ====== | + | ====== |
- | This behavior does not required other behaviors to be present. | + | Same as [[# |
- | ====== | + | ====== |
- | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use. | + | Same as [[# |
- | ====== | + | ====== |
- | This behavior | + | This behavior |
- | ====== Events ====== | + | ===== lookedAt.start ===== |
- | + | ||
- | This behavior supports adding listeners. These events can be received: | + | |
- | + | ||
- | ===== actorStartsLookingAt | + | |
Actors starts looking at object. | Actors starts looking at object. | ||
- | ===== actorStopsLookingAt | + | ===== lookedAt.stop |
Actors stops looking at object. | Actors stops looking at object. | ||
+ | |||
+ | ====== Required Behaviors ====== | ||
+ | |||
+ | This behavior does not required other behaviors to be present. | ||
+ | |||
+ | ====== Optional Behaviors ====== | ||
+ | |||
+ | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
+ | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
+ | |||
+ | ====== Persistency ====== | ||
+ | |||
+ | This behavior does support element class to be persistable (setPersistable). | ||
====== API Documentation ====== | ====== API Documentation ====== | ||
Line 128: | Line 150: | ||
< | < | ||
< | < | ||
+ | <!-- optional: use behavior tree with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
+ | <!-- optional: use state machine with id instead of empty string --> | ||
+ | <string name=' | ||
+ | | ||
<!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
<string name=' | <string name=' |