2.5 KiB
2.5 KiB
Base Character Scene with Dialogue System Design Plan
Overview
Create a base character scene with:
- A sprite/shape (using Polygon2D for now)
- A dialogue entity that can be triggered programmatically
- Visual dialogue box with animation and character-by-character text reveal
- Test scene to demonstrate the behavior
Implementation Steps
1. Base Character Scene Design
- Create a new scene file
scenes/base_character.tscn - Add a Polygon2D node as the character sprite
- Add necessary child nodes for dialogue system integration
- Set up proper positioning and scaling
2. Dialogue UI System
- Create dialogue box UI with:
- Background rectangle (white)
- Text display area
- Animation for showing/hiding
- Implement character-by-character text reveal
- Handle timing and duration logic
3. Dialogue Action Integration
- Extend or modify DialogueAction to use new UI system
- Ensure compatibility with existing cutscene manager
- Add proper signal handling for animation completion
4. Test Scene
- Create test scene
scenes/test_dialogue.tscn - Add base character instance
- Automatically trigger dialogue on scene load
- Demonstrate the complete functionality
Technical Details
Base Character Scene Structure
Node2D (root)
├── Polygon2D (character sprite)
└── DialogueSystem (script for handling dialogue UI)
Dialogue System Components
- DialogueBox: Visual element that appears when dialogue is triggered
- TextRevealer: Handles character-by-character text display
- AnimationController: Manages show/hide animations
- Timer: Controls duration of dialogue display
DialogueAction Integration Points
start()method should trigger UI display- Text and duration parameters should be passed to UI system
- Completion signal should be properly emitted
File Structure
scenes/
├── base_character.tscn
└── test_dialogue.tscn
scripts/
├── dialogue_system.gd
└── base_character.gd
cutscene/
└── actions/
└── DialogueAction.gd (modified)
Implementation Approach
- First, create the base character scene with Polygon2D
- Implement the dialogue UI system in a separate script
- Modify DialogueAction to integrate with new UI system
- Create test scene that demonstrates functionality
- Ensure all components work together within existing cutscene framework
Animation Requirements
- Dialogue box should animate in (fade/slide)
- Text should reveal character-by-character with delay
- Dialogue box should animate out after duration ends