User Tools

Site Tools


dragengine:modules:dragonscript:behavior_lookedat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dragengine:modules:dragonscript:behavior_lookedat [2025/05/02 14:53] dragonlorddragengine:modules:dragonscript:behavior_lookedat [2025/05/04 13:47] (current) – [lookedAt.check] dragonlord
Line 21: Line 21:
  
 Element class properties have the prefix ''lookedAt.''. Element class properties have the prefix ''lookedAt.''.
 +
 +====== 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|''true'', ''false''|Player is looking at element| |player|''true'', ''false''|Player is looking at element|
 +|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:
 </code> </code>
  
-====== Required Behaviors ======+====== State Machine Actions ======
  
-This behavior does not required other behaviors to be present.+Same as [[#behavior_tree_actions|Behavior Tree Actions]].
  
-====== Optional Behaviors ======+====== State Machine Conditions ======
  
-  * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.+Same as [[#behavior_tree_conditions|Behavior Tree Conditions]].
  
-====== Persistency ======+====== State Machine Events ======
  
-This behavior does support element class to be persistable (setPersistable).+This behavior sends these state machine events.
  
-====== Events ====== +===== lookedAt.start =====
- +
-This behavior supports adding listenersThese 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]]: Add actions and conditions for behavior trees to use.
 +  * [[behavior_statemachine|ECBehaviorStateMachine]]: Add actions and conditions for state machine to use and events to send to the state machine.
 +
 +====== Persistency ======
 +
 +This behavior does support element class to be persistable (setPersistable).
  
 ====== API Documentation ====== ====== API Documentation ======
Line 128: Line 150:
 <elementClass name='MyClass' class='GenericBehaviorElement'> <elementClass name='MyClass' class='GenericBehaviorElement'>
   <behavior type='ECBehaviorLookedAt'>   <behavior type='ECBehaviorLookedAt'>
 +    <!-- optional: use behavior tree with id instead of empty string -->
 +    <string name='behaviorTree'>second</string>
 +    
 +    <!-- optional: use state machine with id instead of empty string -->
 +    <string name='stateMachine'>second</string>
 +    
     <!-- set element properties. omit property prefix if used inside behavior tag -->     <!-- set element properties. omit property prefix if used inside behavior tag -->
     <string name='.name'>value</string>     <string name='.name'>value</string>
dragengine/modules/dragonscript/behavior_lookedat.1746197622.txt.gz · Last modified: 2025/05/02 14:53 by dragonlord