Can anyone suggest an elegant way to restart the story in Harlowe?
I am writing a CYOA style story. When the reader reaches an ending, I want to provide a link that will restart the story. Initially I thought to create a link at the bottom of each ending passage like this:
First Passage. However, doing so clutters my Twine file with a ton of extraneous lines and makes it really confusing to navigate and edit.
Is there a better way to do this?
Comments
How so?
Two things to note with restarting a story by moving the Reader forward to your first passage.
1. If you don't re-initializes all your $variables to default values then they will contain whatever values they had from before. I suggest creating a passage (perhaps named Initialize) where you assign all your $variables a default value and then to include this passage into your story's first passage using a (display:) macro.
1a. Initialize passage: (your variables will probably have different names. *smile*)
note: I am wrapping the (set:) macros in a {} to remove any extra line-breaks. 1b. Main passage: (your story's first passage may be named something different)
2. Because you are moving the Reader forward to your story's first passage the story's Passage History will not be reset so the Reader will still be able to use the Undo button to move backwards from the first passage to the ending passage.
How about simply get them to re-load the original html file by using a (gotoURL:) macro directing them to the original html file?
Assuming you name your published file as StoryTitle.html, you can use the following link:
(change "StoryTitle" to whatever the name of your final published html file will be)
This link will reset all the variables and start the game over from scratch. However, it doesn't work while you are doing the "test and play" within Twine. It only works on your published file.
This story does not use any variables, but I understand what you mean by using an "initialize" passage. I'm certain I'll be using variables in future works, so this very relevant.
I thought of using linking the reader to the URL of the .html file, as well. However, the story has cover page that would be reloaded in that case.
That will display a link with the text "Restart" that will take the player back to the "Start" passage with a clean slate.
Is there something similar with Harlowe?