Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

restarting a story in Harlowe

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

  • However, doing so clutters my Twine file with a ton of extraneous lines and makes it really confusing to navigate and edit.

    How so?
  • If you use a (click:) it won't make the lines but it will make the connections for you.
  • Oh! That kind of lines! I am no longer confused. dope<-Guinevak
  • Try:
    (link:"Start Over")[(goto:"First Passage")]
    
  • @Willy Elektrix
    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.
    {
    (set: $variableA to 100)
    (set: $variableB to "summer")
    (set: $variableC to false)
    }
    
    1b. Main passage: (your story's first passage may be named something different)
    (display: "Initialize")
    The text at the start of your story!
    

    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.
  • Another idea that just came to mind:

    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:
    (link:"Start Over")[(gotoURL:"StoryTitle.html")]
    

    (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.
  • Good advice. Thank you!

    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.
  • In SugarCube 1, to restart a game as if it were the first time playing it, one can do:
    [[Restart|Start][state.restart()]]
    

    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?
Sign In or Register to comment.