I'm not sure how to do this, I've read through basic coding stuff (waiting to get to the more complicated things later) but I've come to an impasse.
I have a passage with two different options to move on. Both of them lead to the same passage. Is there any way to add extra information to that passage depending on which option was chosen?
For example, one option says "Hello?" and the other says "Hello, what's your name?" I want the response to be the same, but in the second option a name would be provided to the reader. Help?
Comments
First of all, always state what story format you're using. I'll have to assume you're using Harlowe since you posted in the Twine 2 section and it's the default.
Next, become familiar with the following two links:
http://twine2.neocities.org/
http://twinery.org/wiki/twine2:guide
Now, what you're seeking was known as a "setter link," but I didn't see how to create one at first glance in the new markup guide. I'm sure it's there.
Here's the standard way of using a link to set a variable:
Clicking the link will set the variable called "foo" (without quotes) to '1' (without single quotes).
Here's how it could be used, for example:
Then, in the second passage, you could use an if conditional branch to display additional text if the player asks the orphan's name, like so:
In the example, the orphan only replies with his name if asked.
Attached is an HTML file of the example that can be played and imported into Twine 2.
Hope that helps!
You can use a variable to track the reader's selection in one passage and then conditionally change what is shown in the new passage, how you do this is different for each story format.
1. The passage containing the options: 2. Response passage:
edit: you got two answers at the same time for the price of one. lol
Thank you both, it worked. Sharpe, I'll definitely take a look at those links at length.