So given how new Twine 2.0 is, it seems the wiki/guide isn't yet very comprehensive. For the past two hours I've been going round and round in a loop trying to figure out some of the most basic commands, with zero success. And that's after reading the Harlowe documentation everyone keeps linking to. Maybe I'm just an idiot.
I feel like the best way to learn would be an uncompiled twine file so users can just dig in and see the code, then play/test to see the results of that code. Is something like that available yet? Or can someone post one?
Anyhow, what I've been trying to do is this:
1. Display two strings of clickable text.
2. When you click one choice, the other disappears, and new text appears advancing the story.
i.e.
"Which pill do you want to take?"
[The red pill] or [the blue pill]?
The user clicks [The red pill], and the words [the blue pill] disappears. Then some new text would appear on the next line, i.e.
"Your body starts convulsing uncontrollably! What action do you take?"
[Drink some water] or [call 911]?
I'd like a passage to be extended this way indefinitely, without players/readers ever being directed to a totally new passage/page. This is easy enough to do, right? Can someone explain how? And what is this type of linking/choosing "called"? I did forum searches, but I wasn't sure of the right terms.
Thanks in advance for any help.
Comments
The following code consists of three passages, the first asks the pills question using (link:) macros, and then based on which link the Reader chooses replaces the pills question with the contents of another passage using a hook, and the (replace:) / (display:) macros.
(note: the following uses TWEE notation, lines starting with two colons indicate a new passage, text on same line as the two colons is the new passage's title.) The following is a copy of the Start passage from above formatted to make reading easier:
This was very educational, loading this up and being able to see the results.
The example consists of three separate passages:
1. Start This passage contains two (link:) macros which when clicked run the code contained within the associated [] code block.
Both of the (link:) macros are wrapped within a hook named pills, the hook is the part that looks like: Each of the (link:) macros contains a (replace:) macro, these macros are going to replace the contents of the pills hook with whatever is contained within the (replace:) macro's associated code block: Contained within each (replace:) macro is a (display:) macro which is used to insert the contents of a different passage into the Start passage.
2. The red pill
This passage contains the text which is going to be inserted into the Start passage if the The red pill link is clicked. 3. The blue pill
This passage contains the text which is going to be inserted into the Start passage if the The blue pill link is clicked. I hope that helps