Enhance narrative systems with detailed implementation guides and data-driven structures
- Updated BPC_NarrativeStateSystem with a comprehensive manual implementation guide, including class setup, variable initialization, and function breakdowns. - Expanded BPC_ObjectiveSystem documentation to include a manual implementation guide and detailed function descriptions. - Added a manual implementation guide for BPC_DialoguePlaybackSystem, outlining class setup and function nodes. - Introduced a manual implementation guide for BPC_DialogueChoiceSystem, detailing choice presentation and selection processes. - Enhanced BPC_BranchingConsequenceSystem documentation with a manual implementation guide for consequence evaluation. - Updated BPC_TrialScenarioSystem with a manual implementation guide for scenario management. - Expanded BPC_LoreUnlockSystem documentation to include a manual implementation guide for lore entry management. - Added a manual implementation guide for BP_NarrativeTriggerVolume, detailing trigger volume setup and action execution. - Enhanced BPC_EndingAccumulator documentation with a manual implementation guide for ending evaluation. - Updated BPC_HitReactionSystem with a manual implementation guide for hit reaction management. - Added a manual implementation guide for BPC_RecoilSystem, detailing recoil application and recovery processes. - Introduced DT_ProjectTags.csv to define gameplay tags for various systems, enhancing data-driven design capabilities.
This commit is contained in:
@@ -104,4 +104,77 @@ Presents branching dialogue choices to the player and routes the selected respon
|
||||
| [`BPC_BranchingConsequenceSystem`](42_BPC_BranchingConsequenceSystem.md) | Dispatcher | Choice flag changes trigger consequence evaluation |
|
||||
|
||||
### Reuse Notes
|
||||
Choice filtering by RequiredFlagTag allows context-sensitive dialogue without branching logic in the system. Choices can be hidden (e.g., secret dialogue options only appear if player has a specific lore unlock). The system handles all choice patterns: timed, untimed, locked, hidden, and priority-sorted.
|
||||
Choice filtering by RequiredFlagTag allows context-sensitive dialogue without branching logic in the system. Choices can be hidden (e.g., secret dialogue options only appear if player has a specific lore unlock). The system handles all choice patterns: timed, untimed, locked, hidden, and priority-sorted.
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_DialogueChoiceSystem`
|
||||
2. Add to Player Character
|
||||
3. Define struct `S_DialogueChoice`: ChoiceText (Text), ResultFlagTag (GameplayTag), NextSequenceTag (GameplayTag), RequiredFlagTag (GameplayTag), Priority (Integer)
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set CurrentChoices = empty array
|
||||
├─ Set bChoiceActive = false
|
||||
├─ Set ChoiceTimeLimit = 0.0
|
||||
└─ Cache: BPC_NarrativeStateSystem, BPC_DialoguePlaybackSystem
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `PresentChoices(Choices: Array<S_DialogueChoice>, TimeLimit: Float)` → `void`
|
||||
```
|
||||
Step 1: Filtered = GetValidChoices(Choices) ← filter by narrative flags
|
||||
Step 2: If Filtered.Length == 0: auto-cancel (or select hidden default)
|
||||
Step 3: Sort Filtered by Priority (descending)
|
||||
Step 4: Set CurrentChoices = Filtered
|
||||
Step 5: Set bChoiceActive = true
|
||||
Step 6: Fire OnChoicesPresented(CurrentChoices) → WBP_DialogueChoiceDisplay shows UI
|
||||
Step 7: If TimeLimit > 0:
|
||||
Set ChoiceTimeLimit = TimeLimit, TimeRemaining = TimeLimit
|
||||
Start looping timer (0.1s):
|
||||
TimeRemaining -= 0.1 → update UI
|
||||
If TimeRemaining <= 0 → Call OnChoiceTimedOut
|
||||
```
|
||||
|
||||
#### `GetValidChoices(Choices)` → `Array<S_DialogueChoice>`
|
||||
```
|
||||
ForEach Choices:
|
||||
If Choice.RequiredFlagTag valid:
|
||||
Call BPC_NarrativeStateSystem.GetFlag(Choice.RequiredFlagTag)
|
||||
If flag is true → Add to results
|
||||
Else: Add to results (no requirement)
|
||||
Return results
|
||||
```
|
||||
|
||||
#### `SelectChoice(ChoiceIndex: Integer)` → `void`
|
||||
```
|
||||
Step 1: Validate ChoiceIndex < CurrentChoices.Length
|
||||
Step 2: Selected = CurrentChoices[ChoiceIndex]
|
||||
Step 3: Clear ChoiceTimer
|
||||
Step 4: Fire OnChoiceSelected(Selected, ChoiceIndex)
|
||||
Step 5: Call ProcessSelectedChoice(Selected)
|
||||
```
|
||||
|
||||
#### `ProcessSelectedChoice(Choice)` → `GameplayTag` (NextSequenceTag)
|
||||
```
|
||||
Step 1: If Choice.ResultFlagTag valid:
|
||||
BPC_NarrativeStateSystem.SetFlag(Choice.ResultFlagTag, true)
|
||||
Step 2: Set bChoiceActive = false
|
||||
Step 3: Fire OnChoiceCompleted(Choice.NextSequenceTag)
|
||||
Step 4: Return Choice.NextSequenceTag ← caller (DialoguePlayback) plays this sequence
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create BPC_DialogueChoiceSystem, add to Player Character
|
||||
- [ ] Define S_DialogueChoice struct
|
||||
- [ ] Implement PresentChoices with flag filtering + timer
|
||||
- [ ] Implement GetValidChoices with RequiredFlagTag check
|
||||
- [ ] Implement SelectChoice with timer clear
|
||||
- [ ] Implement ProcessSelectedChoice: set flag → return next sequence
|
||||
- [ ] Wire to WBP_DialogueChoiceDisplay via dispatcher
|
||||
- [ ] Test: dialogue choice appears → player selects → flag set → next dialogue plays
|
||||
Reference in New Issue
Block a user