#dialog #systems #quest #micro #structures #game #quests

micro_quest

Structures and systems for managing game dialog & quests

1 unstable release

0.1.0 Apr 26, 2023

#1565 in Game dev

Apache-2.0

11KB
194 lines

Micro Quest

Data and systems for structuring quests and dialogue, with an optional Bevy integration.

Usage

Installation

Include in your Cargo.toml:

[dependencies]
micro-quest = { version = "0.1", features = ["bevy"] }

In Code

This crate provides the structures required to work with .quest toml files, as created by Micro Forge, a game asset editor.

With the bevy feature enabled, you get a QuestLog as a resource, and a loader for .quest files. There is also an AssetServerQuestLocator that will use the asset server to locate quests (It will attempt to respect named sub assets while resolving the ID to an asset path).

/* If you're using bevy, add the plugin to configure resources and loaders */
fn main() {
	App::new()
	    .add_plugins(DefaultPlugins)
		.add_plugin(micro_quest::MicroQuestPlugin);
}

fn some_system(quest_log: Res<QuestLog>, assets: AssetServerQuestLocator) {
    // Assuming that the quest has been added to the log at some other point
   log::info!("My First Quest: {:?}", quest_log.get_quest_state("quests/QuestList#MyFirstQuest", assets));
}

Dependencies

~0–40MB
~596K SLoC