Hi folks! I've been wanting to get into using Twine for a while and have finally made a concerted effort to create something on it. I feel pretty confident with a lot of the functions, but I can't quite get my head around the (if: (history:) contains "Passage") option to display otherwise hidden text.
Specifically: I'm writing something involving a medical examiner, and I'd like to have an option present itself for him to 'make a verdict' but only after he's examined certain parts of a body (eg head, torso, right arm, left leg) - the order's not important, just as long as those options/pages have been explored/visited. How can I do this?
Thanks for any help!
Comments
If you're concerned about that, you can easily just compress the extra whitespace and do it like this.
(if: (history:) contains "Examine Head" and "Examine Torso" and "Examine Feet")[[[Make a Verdict]]]
This is only checking if "Examine Head" is in (history:) and is just checking if the "Examine Torso" and "Examine Feet" string literals are not equal to a false value.
Test code: If you visit the "Examine Head" passage and then run the check you will see the link but the Torso and Feet tests wont show related text. Try the following: note: the above is not efficient because it searches through the full passage history three times.
Dang it. I specifically tried testing to see if that was the case and I only just realized after going back and looking at it that I had the wrong check first. Now I feel dumb.
Hi folks, thanks a lot for your input! I've used InspectorCaracal's suggestion, and it works, although when Make a Verdict appears as a choice, it's underlined and won't link to the (now existing) passage... Do I maybe need to put some other code in somewhere else or something...?
When you say InspectorCaracal's suggestion do you mean: The [[Make a Verdict]] markup link in both of the above example creates a link with text of Make a Verdict that sends you to a passage named Make a Verdict, note that passage names are case sensitive. To test that your markup link is correct make a copy of the link without the (if:) macro and it should work.