I've been reading the Harlowe documentation and the forums, but I still haven't quite found what I need to make my game work.
The passage is a crime scene with three witnesses to interview. The each witness has their own passage that links back to the crime scene.
What I want to do is show a fourth option to leave the crime scene when all three witnesses have been spoken too.
I thought something like this would work:
[[Speak to Witness A|Witness A]]
[[Speak to Witness B|Witness B]]
[[Speak to Witness C|Witness C]]
(If: (History:) contains "Winess A" ; "Witness B" ; "Witness C")[[Leave crime scene|Next Passage]]
I assume the semicolons are wrong. I think I picked that up from some other Twine tutorial somewhere, and I'm sure it's inapplicable here.
I've found posts about the (History:) macro, but they all seem to just refer to display text, not a link to another passage.
I appreciate help with this! It's a very short game I've made and this is the missing piece!
Comments
I will post whatever solution I find...if I do find it.
However, instead of the semi-colons, try using "and" instead: Also, make sure your spelling of passage names is correct. In your example you had "Winess", which will, of course, cause the macro to fail.
(if: $neighbor and $fan and $rival is true (display: [[Leave the crime scene.->Finale]]))
When I test the game I get a message where the fourth line should be:
Expected ')'
Where should I have an end parenthesis, or is this code even more wrong than that?
Thanks.
(if: $Neighbor and $Fan and $Rival is true (display: "Leave"))
Do I need an "Else" statement too?
And slightly related, does Twine 2 have trouble refreshing changes for the test mode or play? I find that the editor is saving my changes, but they are not always there when I test. Sometimes it's using stuff I changed a while ago. It's extra frustrating when I'm trying to figure this stuff out.
Sorry if I'm a noob. My knowledge of this stuff is starting from scratch. I really appreciate the help.
Your macros must be in the (), and what they are affecting must be in the []. Harlowe is easier to understand if you just put this framework in whenever you're trying to do anything.
So this means the code you want is: There's also little need for the display macro unless you want to actually display variables. Just type stuff out normally. So you can see your first post was actually the closest to what you needed to do. You were just missing the "and" operator, as well as the final set of [].
(if: (history:) contains "Witness A" and "Witness B" and "Witness C")[[[Leave crime scene->Next Passage]]]
The above code will not work correctly because only the first conditional (history:) contains "Witness A" is checking for a passage within history, the other two conditionals "Witness B" and "Witness C" are just checking if the two literal values are not false.
For it to work as require it would need to be changed to the following:
note: the following is not efficient because it checks the story's full passage history three times. [quote]
(if: $neighbor and $fan and $rival is true)[[[Leave the crime scene.->Finale]]]
There is no need for the is ture part, the expression can be written as follows:
Claretta -- I had at one point listened to you and closed the parenthesis... and then I forgot it again. D'oh.
What I really wasn't getting was that the "[]" needed to be closed again too. There were the sets of 2 "[[]]" for the links, and then a set of single "[]" for what the macros were affecting
Greyelf -- thanks for the final tips. Really cleaned everything up.
It really clicks now. Once again, I appreciate the help. My first game is done! It was for the 300 word game jam, but I guess I've missed that now. Just happy I finished it.