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

Allow nodes in different files to share names #85

Open
shiny-rose opened this issue Jun 16, 2017 · 3 comments
Open

Allow nodes in different files to share names #85

shiny-rose opened this issue Jun 16, 2017 · 3 comments
Assignees

Comments

@shiny-rose
Copy link

shiny-rose commented Jun 16, 2017

It would be very useful if we could use the same node names across multiple files. When calling StartDialogue or creating links, we could optionally namespace the node name with the file it's in. ("Optionally" being the key benefit, compared to namespacing everything manually to avoid collisions like we're doing now.)

This is how I think it could resolve node names:

  • If there's only one node with that name across all files, run that.
  • If the name includes a file name, run the node from that file. E.g. [[Sally.Intro]] runs the node named Intro in the file Sally.json
  • If there are multiple nodes with that name, run the one which is in the same file as the node we most recently ran. E.g. if we just ran Sally.Intro, we assume that links without file names refer to other nodes in Sally.json

This wouldn't break any existing stories because they presumably have all unique names which are taken care of by the first case.

@rvv27
Copy link

rvv27 commented Apr 1, 2019

shiny-rose's points are really shiny. I agree.

@Tamschi
Copy link
Contributor

Tamschi commented Apr 2, 2019

There's currently no restriction on node names (as far as I can tell from the documentation). I think the namespacing would have to err towards interpreting the entire string as node name in the same file if in doubt, which should also be documented (unless some currently invalid syntax can be found).

Is it currently possible to link to nodes that have | in their name?
The editor doesn't handle it well, but I don't know how that matches other parts of the system.

@desplesda desplesda added this to the v2.0 milestone May 28, 2020
@desplesda desplesda removed this from the v2.0 milestone Jul 9, 2021
@desplesda
Copy link
Collaborator

(I'm removing this issue from the v2.0 milestone because this has some interactions with how we might implement certain other features, but I'm leaving it open for now!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants