micro_quest

Crates.iomicro_quest
lib.rsmicro_quest
version0.1.0
sourcesrc
created_at2023-04-26 14:15:38.354624
updated_at2023-04-26 14:15:38.354624
descriptionStructures and systems for managing game dialog & quests
homepage
repository
max_upload_size
id849422
size10,723
Louis Capitanchik (Commander-lol)

documentation

README

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));
}
Commit count: 0

cargo fmt