Howdy, Stranger!

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

First Game! Harlowe Help Needed

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 may be closer to finding my own answer on this!

    I will post whatever solution I find...if I do find it.
  • Can do it with in each witness passage, set a variable to true. In main passage, have an if statement conditional on all three variables being true that displays the fourth link.

    However, instead of the semi-colons, try using "and" instead:

    (if: (history:) contains "Witness A" and "Witness B" and "Witness C")
    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.
  • Okay... this is probably absolutely butchered, but I set the variables for the witness passages, and here is my line for the fourth link.

    (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.
  • I find the Harlowe parenthesis system difficult to understand compared to simple <<if>> macros, but I believe you're not properly closing off the (if: statement. Judging by the documentation, there should be a parenthesis after "true".

  • So I thought maybe I need to put the fourth line in its own passage so that (display:) would work better. And I think it has, but now I get a message that says "'TrueMacros' Undefined"

    (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.
  • You're still not closing your if macro as I described in my last post.
  • To be specific, Harlow has a macro format of ()[]

    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:

    (if: $neighbor and $fan and $rival is true)[[[Leave the crime scene.->Finale]]]
    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 [].
  • [quote]
    (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.

    (if: ((history:) contains "Witness A") and ((history:) contains "Witness B") and ((history:) contains "Witness C"))[[[Leave crime scene->Next Passage]]]
    [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:

    (if: $neighbor and $fan and $rival)[[[Leave the crime scene.->Finale]]]
  • Thanks!

    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.
  • Glad you got it done and I learned a bit about Harlowe at least. :P
Sign In or Register to comment.