Howdy, Stranger!

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

Help with Multiple Endings (Harlowe)

I am trying to connect a passage in a story to a choice players made in the first passage of the story. In the given example, the first passage gives the player a choice between four things. I want the last passage to be dependent on what your initial answer was (for example, if you answered A, your final passage is death, but if you answered B, you live).

Comments

  • You don't give an example of what the (link / macro) contents of the first passage looks like so I am going to assume it is something like the following:

    note: The 'Target Passage Name' may or may not be the same for each option.
    Some descriptive text that ends in a multiple choice question.
    
    [[Option 1->Target Passage Name]]
    [[Option 2->Target Passage Name]]
    [[Option 3->Target Passage Name]]
    [[Option 4->Target Passage Name]]
    

    1. You can change the links in the above to use a (link: ) macro combined with a (set: ) macro and a (go-to: ) macro, to use a story $variable to track which option was selected:
    Some descriptive text that ends in a multiple choice question.
    
    (link: "Option 1")[{
    	(set: $choice to 1)
    	(go-to: "Target Passage Name")
    }]
    (link: "Option 2")[{
    	(set: $choice to 2)
    	(go-to: "Target Passage Name")
    }]
    (link: "Option 3")[{
    	(set: $choice to 3)
    	(go-to: "Target Passage Name")
    }]
    (link: "Option 4")[{
    	(set: $choice to 4)
    	(go-to: "Target Passage Name")
    }]
    
    2. In your last passage you can use an (if: ) macro combined with a couple of (else-if: ) macros and an (else: ) macro to check the story $variable and display different things based on it's value:
    {
    (if: $choice is 1)[
    The first ending.
    ]
    (else-if: $choice is 2)[
    The second ending.
    ]
    (else-if: $choice is 3)[
    The third ending.
    ]
    (else:)[
    The forth ending.
    ]
    }
    
    note: the above examples use indentation, extra line-breaks and Collapsing whitespace markup to try and make them more readable and to remove unwanted line-breaks in the generated output, all these things can be safely removed in your own copy.
  • THANK YOU SO MUCH
Sign In or Register to comment.