73 lines
2.6 KiB
Markdown
73 lines
2.6 KiB
Markdown
# DA_InteractionData — Data Asset
|
|
|
|
**Parent Class:** `UDataAsset`
|
|
**Dependencies:** `BPC_InteractionDetector`, `I_Interactable`
|
|
**Purpose:** Defines interaction properties for interactable world objects — prompt text, hold duration, required items, and context tags.
|
|
|
|
---
|
|
|
|
## Variables / Structure
|
|
|
|
| Field | Type | Description |
|
|
|-------|------|-------------|
|
|
| `InteractionTag` | `FGameplayTag` | Unique tag for this interaction type |
|
|
| `ActionLabel` | `FText` | "Open", "Pick Up", "Pull Lever", etc. |
|
|
| `ObjectName` | `FText` | Display name of the object |
|
|
| `bRequiresHold` | `bool` | Whether interaction requires hold input |
|
|
| `HoldDuration` | `float` | Seconds to hold (if bRequiresHold) |
|
|
| `ActionKeyIcon` | `UTexture2D*` | Platform-specific input icon |
|
|
| `ContextTags` | `TArray<FText>` | Display tags: "Safe", "Locked", "Dangerous" |
|
|
| `bConsumeOnInteract` | `bool` | Item is consumed after interaction |
|
|
| `InteractionCooldown` | `float` | Seconds before re-interaction allowed |
|
|
| `RequiredItemTag` | `FGameplayTag` | Item required in inventory to interact |
|
|
| `bBlockDuringCombat` | `bool` | Interaction blocked during combat |
|
|
| `InteractionRange` | `float` | Max distance for interaction (cm) |
|
|
| `PromptOffset` | `FVector2D` | Screen offset for prompt widget |
|
|
|
|
---
|
|
|
|
## Gameplay Tags
|
|
- Namespace: `Interaction.<Type>` (e.g., `Interaction.Open`, `Interaction.Pickup`)
|
|
- Required item tags in `Item.<Category>` namespace
|
|
|
|
---
|
|
|
|
## Validation Rules
|
|
- `ActionLabel` must not be empty
|
|
- `HoldDuration` > 0 if `bRequiresHold` is true
|
|
- `InteractionTag` must be unique across all interaction DAs
|
|
- `InteractionRange` must be > 0
|
|
|
|
---
|
|
|
|
## Example Data
|
|
|
|
**Example 1: Door**
|
|
| Field | Value |
|
|
|-------|-------|
|
|
| InteractionTag | `Interaction.Door.Open` |
|
|
| ActionLabel | "Open" |
|
|
| ObjectName | "Wooden Door" |
|
|
| bRequiresHold | false |
|
|
| InteractionRange | 200.0 |
|
|
|
|
**Example 2: Locked Chest**
|
|
| Field | Value |
|
|
|-------|-------|
|
|
| InteractionTag | `Interaction.Chest.Locked` |
|
|
| ActionLabel | "Unlock" |
|
|
| ObjectName | "Iron Chest" |
|
|
| bRequiresHold | true |
|
|
| HoldDuration | 1.5 |
|
|
| RequiredItemTag | `Item.Key.IronKey` |
|
|
|
|
---
|
|
|
|
## Consumed By
|
|
- [`BPC_InteractionDetector`](../03-interaction/16_BPC_InteractionDetector.md) — reads interaction data for prompt display
|
|
- [`BP_DoorActor`](../03-interaction/BP_DoorActor.md) — door-specific interaction config
|
|
- [`BP_PuzzleDeviceActor`](../03-interaction/) — puzzle interaction definitions
|
|
|
|
## Reuse Notes
|
|
- All interactable objects reference this DA via a `TSoftObjectPtr` on their component
|
|
- Context tags drive HUD prompt coloring and iconography |