This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_interactionspot [2020/11/23 16:30] – [Element Class Example] dragonlord | dragengine:modules:dragonscript:behavior_interactionspot [2025/03/12 20:27] (current) – dragonlord | ||
---|---|---|---|
Line 8: | Line 8: | ||
====== ECBehaviorInteractionSpot ====== | ====== ECBehaviorInteractionSpot ====== | ||
+ | |||
+ | <WRAP center 100%> | ||
+ | <WRAP center box 450px> | ||
+ | {{youtube> | ||
+ | <WRAP centeralign> | ||
+ | </ | ||
+ | </ | ||
Behavior element behavior adding support to define interaction spot for actors. | Behavior element behavior adding support to define interaction spot for actors. | ||
Line 23: | Line 30: | ||
====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
- | Element class properties have the prefix | + | Element class properties have the prefix |
===== position ===== | ===== position ===== | ||
Position relative to owner element the actor or player has to be placed at to interact with the owner element. | Position relative to owner element the actor or player has to be placed at to interact with the owner element. | ||
* Full name: “interactionSpot.position” or “interactionSpot(id).position” | * Full name: “interactionSpot.position” or “interactionSpot(id).position” | ||
- | * Type: 3-component vector. Format used with object properties (string): "x y z" | + | * Type: 3-component vector |
- | * Default Value: (0, 0, 0) | + | * Default Value: |
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
Line 35: | Line 42: | ||
Orientation in euler angles relative to owner element the actor or player has to be placed at to interact with the owner element. | Orientation in euler angles relative to owner element the actor or player has to be placed at to interact with the owner element. | ||
* Full name: “interactionSpot.orientation” or “interactionSpot(id).orientation” | * Full name: “interactionSpot.orientation” or “interactionSpot(id).orientation” | ||
- | * Type: 3-component vector. Format used with object properties (string): "x y z" | + | * Type: 3-component vector |
- | * Default Value: (0, 0, 0) | + | * Default Value: |
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
Line 42: | Line 49: | ||
Position to look at while actor or player is approaching the target position. Typically used together with [[behavior_conversationactor|ECBehaviorConversationActor]] to set the Head Look-At playback. Can be null (or empty string with object properties) to not use a look-at. | Position to look at while actor or player is approaching the target position. Typically used together with [[behavior_conversationactor|ECBehaviorConversationActor]] to set the Head Look-At playback. Can be null (or empty string with object properties) to not use a look-at. | ||
* Full name: “interactionSpot.lookAt” or “interactionSpot(id).lookAt” | * Full name: “interactionSpot.lookAt” or “interactionSpot(id).lookAt” | ||
- | * Type: 3-component vector. Format used with object properties (string): "x y z" | + | * Type: 3-component vector |
- | * Default Value: null | + | * Default Value: |
- | * Example (*.deeclass) <code xml>< | + | * Example (*.deeclass) <code xml>< |
+ | |||
+ | ====== Events ====== | ||
+ | |||
+ | ===== spotClaimed ===== | ||
+ | |||
+ | Occupier has claimed spot. | ||
+ | |||
+ | ===== spotReleased ===== | ||
+ | |||
+ | Occupier has release spot. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
+ | |||
This behavior does not required other behaviors to be present. | This behavior does not required other behaviors to be present. | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
+ | |||
This behavior does not support optional behaviors. | This behavior does not support optional behaviors. | ||
====== Persistency ====== | ====== Persistency ====== | ||
- | This behavior does support element class to be persistable (setPersistable). Saves [[behavior_occupier|ECBehaviorOccupier]] if present. | + | |
+ | This behavior does support element class to be persistable (setPersistable). | ||
====== API Documentation ====== | ====== API Documentation ====== | ||
- | [[https:// | + | # |
- | Since DragonScript Module Version | + | Since DragonScript Module Version |
====== Use Cases ====== | ====== Use Cases ====== | ||
+ | |||
* Ensure actor/ | * Ensure actor/ | ||
* Ensure only one actor/ | * Ensure only one actor/ | ||
Line 94: | Line 115: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | | ||
+ | < | ||
+ | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
+ | <vector name=' | ||
+ | </ | ||
+ | | ||
+ | <!-- for adding multiple behaviors use unique identifiers --> | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Live Examples ====== | ||
In the [[https:// | In the [[https:// | ||
Line 100: | Line 142: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ |