tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
185 stars 42 forks source link

[Docs] Example code in "Previous()" doesn't work #78

Closed cygni-a closed 4 years ago

cygni-a commented 4 years ago

Previous() in documentation

→ Commonly used as part of a link to return to the most recent non-active passage
[[Return|previous()]]

This example code sends the player to a passage called previous() instead of the most recent non-active passage.

As a possible replacement, the section could refer to the <<return>> macro and/or use the code below:

<<link "Return" `previous()`>> <</link>>
greyelf commented 4 years ago

@cygni-a The "Created missing passages that are referenced in Markup Links" feature of the Twine 2.x application's Passage Editor doesn't distinguish between a Standard Markup link like [[Link Text|Target Passage Name]] and a Non-standard Markup link like your [[Return|previous()]] example, so that feature mistakenly creates a Passage named previous().

If you manually delete the Passage named previous() from your project then the [[Return|previous()]] example will work correctly.

cygni-a commented 4 years ago

@greyelf You're right! Thank you for explaining that.

In that case, I change my suggestion to have the example code include a note with the caveat that one has to delete the Passage previous() and ignore the broken link that causes to appear. And/or include the proposed <<link>> code anyway as an alternate example that doesn't result in a broken link in the editor.

Uzume commented 4 years ago

Or better yet--get Twine to document or fix its quirky behavior since that is where the issue is not SugarCube. If you use a different tool (not Twine, e.g., tweego, etc.) you never see this issue. Yet one more reason to not like Twine (it does not really understand and process the wiki markup or TwineScript--that is what the story format does--but it still tries to act based on it in some ways).

tmedwards commented 4 years ago

This is more of a, longstanding, Twine 2 issue and really does need to be addressed there.

That said, I do have a few other "daft Twine 2 behavior ahead" warnings elsewhere, so adding something to that effect here wouldn't be out of place.