twee3-language-tools
twee3-language-tools copied to clipboard
Harlowe StoryMap missing arrow links between passages when changers are used
I noticed with Harlowe, if not using straight links to passages [[Text|Passage]]
and things like:
-
(goto:)
-
(click-goto:)
-
(link-goto:)
-
(link-reveal-goto:)
-
(mouseover-goto:)
-
(mouseout-goto:)
Then the StoryMap graph doesn't show these as links to between the passages in the information sidebar nor with an arrow.
Makes it a bit misleading when there's still a connection between the passages. Would be nice if these could be detected and added to the StoryMap as well.
Related/similar to #76 for SugarCube I think?
yes the workaround for SC is to have the twine passage link in a "comment", not sure if that is possible in Harlowe.
<!--[[Text|Passage]]-->
something like this.
Thanks @Tranberry, looks like the same trick works for Harlowe:
<!--[[Text->Passage]]-->
Would be nice to not have to double-manage and have it automatically picked up still though.
Looks like this may be one of the items on the long todo list in the story map source: https://github.com/cyrusfirheir/twee3-language-tools/blob/master/story-map/todo.md
Poking around, looks like this is the function below which does the detection of the simple links and would need to be updated for the various function patterns for the different flavors:
https://github.com/cyrusfirheir/twee3-language-tools/blob/00f33985ab4e1eb728f94dcd08a2327049d2af8d/src/story-map/socket.ts#L10-L18
Which is called just below in the same file to send this info from the backend to the frontend:
https://github.com/cyrusfirheir/twee3-language-tools/blob/00f33985ab4e1eb728f94dcd08a2327049d2af8d/src/story-map/socket.ts#L38-L56
This eventually creates the LinkedPassage type in the Story Map here via this function:
https://github.com/cyrusfirheir/twee3-language-tools/blob/00f33985ab4e1eb728f94dcd08a2327049d2af8d/story-map/src/util/passage-tools.ts#L32-L37
Not sure of all the various patterns across flavors myself, nor if there's a variable somewhere that stores whatever the editor is set to which could be used here to optimize it. Though, hopefully pointing this out helps someone know how to better fix this scenario. 😊
I think detecting SugarCube and Harlowe could be fairly similar like optional starting (
for Harlowe, some text for other variants, then the goto
then an optional :
for Harlowe, then the passage name at the end...
Doc links for these special formats:
- SugerCube
<<goto "passage">>
http://www.motoslave.net/sugarcube/2/docs/#macros-macro-goto (not familiar enough with SugarCube to know if there are other ways to trigger links beyond simple markup links and this macro) - Harlowe
(goto: "passage")
https://twine2.neocities.org/#macro_go-to (Harlowe has extra slightly different ones as mentioned in the opening of the bug too, but all fairly similar) - Chapbook
{link to: 'passage'}
https://klembot.github.io/chapbook/guide/modifiers-and-inserts/link-inserts.html (Chapbook has some special ones likeback link
andrestart link
)
+1
Without arrows for goto:
, improvements to the editor view become less useful/important.
It seems like goto:
is the predominant use case in Twine, because only employing simple links can be approximated in almost any tool, even Google Forms.
+1
Doesn't show arrows when using "link" macro in SugarCube either. Or "textbox" forwarding.