Howdy, Stranger!

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

Links that keep active after clicked in Harlowe

edited April 2015 in Help! with 2.0
Unless I am missing something big time (and in that case I apologise), this is less a question than a feature request. All links in Harlowe cease being links after clicked. Same thing with mouseovers: they only work once.

I need a link that stays being a link after you click, a link that is infinitely clickable and keeps doing whatever it does. For example, a + button that increases a variable and you can click as many times as you want.

Is there any way to do this in Twine 2 with Harlowe? If not, is this a feature that could be considered? The puzzles I am planning for my current story could be playable without this feature, but they would be harder and innecesarily punishing.

Thanks!

Comments

  • Have the link link back to the same passage it is in and remove transition effects from that passage. That way the link forms an infinite reload passage loop that goes unnoticed due to no passage transitions. Every time the passage reloads, the link becomes active again. Beside the link you can also print the current variable status, so if you've attached a variable increase to the link, every reload will also update the printed status.

    If you want transitions to that passage the first time the user enters, just split it up into 2 passages, with the first having normal transitions and where the link links to a duplicate passage with no transitions, and then the same link on that duplicate passage keeps looping to that passage.
  • There is indeed a way: see here and here.
  • Thanks a lot Claretta and Inspector Caracal. I'l test both suggestions as soon as I can and tell you about the results.
  • Well, I got a solution a lot simpler than I expected. It simply sets the variable and then it "resets" the hook by reloading the passage with a goto: to itself. The new value is printed, and the hook is a link again.

    Here is an example of a hook that is clickable infinite times:

    First passage "test1" that sets the initial values of variables:

    (set: $who to "???")(set: $where to "???")(set: $with to "???")

    (goto: "test2")
    Second passage "test2" with the actual text and code:
    Who killed Harlowe Thrombey?

    Who | Where | With

    [Gardener]<gardener| | [Garden]<garden| | [Shovel]<shovel|

    [Butler]<butler| | [Library]<library| | [Book]<book|

    It was the $who in the $where with the $with.

    [Check]<check|

    {
    (click: ?gardener)[
    (set: $who to "gardener")(goto: "test2")
    ]
    (click: ?butler)[
    (set: $who to "butler")(goto: "test2")
    ]
    (click: ?garden)[
    (set: $where to "garden")(goto: "test2")
    ]
    (click: ?library)[
    (set: $where to "library")(goto: "test2")
    ]
    (click: ?shovel)[
    (set: $with to "shovel")(goto: "test2")
    ]
    (click: ?book)[
    (set: $with to "book")(goto: "test2")
    ]

    (click: ?check)[
    (if: $who is "gardener" and $where is "library" and $with is "book")[
    (replace: ?check)[RIGHT]
    ]
    (else:)[
    (replace: ?check)[WRONG]
    ]
    ]
    }
    The only missing thing is the CSS to remove the transition between passages. The puzzle that I want to implement has exactly the same mechanic as this Clue! thing: let the player experiment the different options before building a final answer and checking it.

    Thanks, you put me in the right direction!
Sign In or Register to comment.