YarnSpinner icon indicating copy to clipboard operation
YarnSpinner copied to clipboard

Allow nodes in different files to share names

Open shiny-rose opened this issue 8 years ago • 3 comments

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.

shiny-rose avatar Jun 16 '17 18:06 shiny-rose

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

rvv27 avatar Apr 01 '19 10:04 rvv27

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.

Tamschi avatar Apr 02 '19 07:04 Tamschi

(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!)

desplesda avatar Jul 09 '21 03:07 desplesda