Crates.io | micro_quest |
lib.rs | micro_quest |
version | 0.1.0 |
source | src |
created_at | 2023-04-26 14:15:38.354624 |
updated_at | 2023-04-26 14:15:38.354624 |
description | Structures and systems for managing game dialog & quests |
homepage | |
repository | |
max_upload_size | |
id | 849422 |
size | 10,723 |
Data and systems for structuring quests and dialogue, with an optional Bevy integration.
Include in your Cargo.toml
:
[dependencies]
micro-quest = { version = "0.1", features = ["bevy"] }
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));
}