Expand description
bevy_map_dialogue - Dialogue tree types and runtime for bevy_map_editor
This crate provides types for creating branching dialogue trees with support for:
- Multiple node types (Text, Choice, Condition, Action, End)
- Player choices with optional conditions
- Speaker assignments
- Conditional branching
- Action triggers
§Usage
ⓘ
use bevy_map_dialogue::{DialogueTree, DialogueNode, DialogueNodeType, DialogueChoice};
let mut tree = DialogueTree::new("greeting");
tree.name = "Merchant Greeting".to_string();
// Add a choice node
let choice_node = DialogueNode {
node_type: DialogueNodeType::Choice,
speaker: "Merchant".to_string(),
text: "Welcome! What would you like?".to_string(),
choices: vec![
DialogueChoice { text: "Buy items".to_string(), next_node: Some("shop".to_string()), ..default() },
DialogueChoice { text: "Sell items".to_string(), next_node: Some("sell".to_string()), ..default() },
DialogueChoice { text: "Goodbye".to_string(), next_node: Some("end".to_string()), ..default() },
],
..default()
};
tree.add_node(choice_node);Structs§
- Dialogue
Choice - A player choice option in a dialogue
- Dialogue
Choice Event - Message sent when the player makes a choice
- Dialogue
EndEvent - Message sent when a dialogue ends
- Dialogue
Handle - Component that holds a handle to a dialogue tree asset
- Dialogue
Node - A single node in the dialogue tree
- Dialogue
Plugin - Plugin for dialogue support
- Dialogue
Runner - Current state of an active dialogue
- Dialogue
Tree - A complete dialogue tree with nodes and connections
- Start
Dialogue Event - Message to start a dialogue (sent via MessageWriter, read via MessageReader)
Enums§
- Dialogue
Node Type - Type of dialogue node