Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use every link as a "returning link" #7

Closed
Keyslam opened this issue Nov 27, 2017 · 1 comment
Closed

Use every link as a "returning link" #7

Keyslam opened this issue Nov 27, 2017 · 1 comment

Comments

@Keyslam
Copy link
Owner

Keyslam commented Nov 27, 2017

Originally link would have a argument to function as a "returning link", in the way that dialogue would snap back to the current node (and position) when the branch finished.

Instead we should handle every link as a returning link, and add a component that notes the end of the dialogue.

This will allow for easier to use and more advanced dialogue.

The node stack will require to keep track of the current components to make this feasible with recurring / looping nodes.

@pablomayobre
Copy link
Contributor

pablomayobre commented Nov 27, 2017

On this note, currently nodes store position information, so doing something like:

d = Babble.dialogue()
  :startNode("first")
    :print("one")
    :link(function () return "second" end)
    :print("three")
  :endNode()

  :startNode("second")
    :print("two")
    :link(function ()
      if not done then
        done = true
        return "first"
      end
    end)
  :endNode()

Would print:

one
two
three

Instead of the expected

one
two
one
two
three --This would only be printed if links are returning links

EDIT: This is probably related to #1

pablomayobre added a commit to pablomayobre/Babble that referenced this issue Nov 27, 2017
Dialogue now creates NodeInstances when moving to a Node,
NodeInstances hold position information and handle updates.
The Dialogue holds a stack of NodeInstances, the dialogue can push, pop or switch at any time.

Fixes Keyslam#1, Fixes Keyslam#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants