Giter Club home page Giter Club logo

yml_dialog's Introduction

YML based Dialog Structure

v0.2.2 MIT/Apache 2.0

complete_example

If you want to compile the code at home, download assets here: disroot's cloud, clone the repo, extract the assets in the root of the repo and run cargo run --example complete_example.

RoadMap

  • fully functional API to implement a dialog system into a (bevy game or any) app

Contribute

Release's format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

This project also follows to A successful Git branching model.

We have to respect all the rust API convention. For the lore, follow all Bevy plugins guidelines.

Run cargo clippy, cargo doc before commit.

License

This project is free, open source and permissively licensed!

All code in this repository is dual-licensed under either:

See the very good reasons for including both here.

Inspiration

I began coding this as a tree strucutre dialog but a graph based is much more suited for a dialog. Maybe after this migration this crate is not needed anymore and will just do a devlog. (and free this name :)

Naming

Accordingly to this discussion, this is not a trivial question.

  • yml-dialog
  • dialog-structure
  • md-to-dialog-tree
  • fto-dialog
  • bevy_dialog
  • bevy_dialog_system
  • bevy_fto_dialog / bevy_fob_dialog

yml_dialog's People

Contributors

wabtey avatar

Stargazers

 avatar

yml_dialog's Issues

`complete_example`: Switch Interlocutor Glitch

To Reproduce

In the complete_example

  1. Continue the dialog with one of the frog until you can choose an answer.
  2. Switch to another frog.
  3. Come back to the previous Frog you were talking with.

The NPCPanel will still contain the text of the second frog you switch (state 2).
This may seems like the first frog is saying the text of the second frog.

How to fix it

In update_dialog_panel,
if the interlocutor is changed and the current_node is a Choice then reset the NPCPanel

fn update_dialog_panel(
    ...
) {
    if !current_interlocutor.is_none()
        && (current_interlocutor.is_changed() || !dialog_changed_query.is_empty())
    {
       ...
        match &dialog.current_node {
            ...
            Some(current_node) => {
                ...

                match &dialogs.first() {
                    ...
                    Some(DialogType::Choice {
                        text: _,
                        condition: _,
                    }) => {
                        ...
                        // update the player_panel
                        *player_panel = PlayerPanel::Choices(choices);

                        // ----------------------------------- NEW -----------------------------------

                        // Remove all text which aren't said by the current interlocutor
                        if current_interlocutor.is_changed() {
                            npc_panel.texts.clear();
                        }
                        
                        // ----------------------------------- NEW -----------------------------------
                    }
                }
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.