bevy_map_dialogue
Dialogue tree system for the bevy_map_editor ecosystem.
Part of bevy_map_editor.
Features
- Branching dialogue trees
- Multiple node types (Text, Choice, Condition, Action, End)
- Player choices with optional conditions
- Visual node editor in bevy_map_editor
- Event-based dialogue flow
Node Types
| Type | Description |
|---|---|
Text |
NPC speaks, then continues to next node |
Choice |
Player selects from options |
Condition |
Branch based on game state |
Action |
Trigger game actions (give item, start quest) |
End |
Dialogue terminates |
Types
| Type | Description |
|---|---|
DialogueTree |
Complete dialogue with all nodes |
DialogueNode |
Single node in the tree |
DialogueChoice |
Player choice option |
DialogueRunner |
Resource tracking active dialogue |
DialogueHandle |
Component holding dialogue asset |
Events
| Event | Description |
|---|---|
StartDialogueEvent |
Begin a dialogue |
DialogueChoiceEvent |
Player made a choice |
DialogueEndEvent |
Dialogue finished |
Usage
Creating Dialogues (Code)
use ;
let mut tree = new;
// Add a choice node
let mut start = new_choice;
start.choices = vec!;
tree.add_node;
Creating Dialogues (Editor)
The Dialogue Editor panel provides:
- Visual node graph
- Drag-and-drop node creation
- Connection drawing between nodes
- Property editing in inspector
Starting a Dialogue
use *;
use *;
Reading Dialogue State
use *;
Auto-Loading from Maps
use DialogueTreeHandle;
commands.spawn;
Plugin
Add DialoguePlugin for dialogue handling:
use *;
app.add_plugins;
Note: MapRuntimePlugin includes this automatically.
License
MIT OR Apache-2.0