Howdy, Stranger!

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

Creating a Hook that is a Link to Hide/Show? (Harlowe)

So I'm encountering another issue in Harlowe:

Essentially, I am trying to create a passage link that is a hook that I can show or hide depending on if a variable is stored within my history.

This is what I typed up:
(if: history contains $whatdoyoumeanbyclinic (hide:ClinicAsk))

[[[What do you mean by Clinic?]]]<ClinicAsk|

But but this somehow creates a passage with the title "[What do you mean by Clinic?"

It appears to be a bug and I'm not sure how to fix this?

Comments

  • The way to fix this problem is to put a space between the first and second brackets.

    There's also a few problems with your if line
    to access the story history you need to call a macro (history:)
    The action to perform when the condition is true should be in a separate hook
    There's no hide macro. Instead replace the contents of the ClinicAsk hook with an empty hook
    To reference a named hook you need to put a ? before the name
    The line needs to come after the line that defines the hook in order to work

    The following works
    [ [[What do you mean by Clinic?]]]<ClinicAsk|
    
    (if: (history:) contains $whatdoyoumeanbyclinic)[(replace: ?ClinicAsk)[]]
    
  • If you want to conditionally show a markup link you could just warp it in an (if:) macro like so:
    (if: (history:) contains $whatdoyoumeanbyclinic)[ [[What do you mean by Clinic?]]]
    
    ... note the space character between the start of the (if:) macro's associated hook and the start of the markup link.
  • edited October 2015
    Also, a style comment: If you want to save a few seconds' time, I'd rename
    $whatdoyoumeanbyclinic
    
    to something shorter, like
    $meanByClinic
    
    or something. It also makes the code a lot easier to read later on.
Sign In or Register to comment.