Howdy, Stranger!

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

Better flow to links without whitespace

Hi. I am working in Harlowe with Twine 2.0.11. I am having trouble making my conversational links flow without leaving white space where visited links were. The best answer I came up with so far is to set a variable to true after a passage is visited, then show grayed out links for those passages, like this:

(if: $gretaname is true)[(textcolor: "gray")[**"What is your name?"**]](else:)greta name]

(if: $gretahome is true)[(textcolor: "gray")[**"Do you live around here?**]](else:)greta home]

(if: $gretadog is true)[(textcolor: "gray")[**"That's a cute little dog you've got there."**]](else:)greta dog]

Before I started graying out the visited links I just wrote something like:

(if: $gretaname is true)[] (else:) ["What is your name?"]

But that leaves whitespace where the link was.

I would like to have the clicked links disappear without leaving whitespace instead of graying them out.
But I can't figure it out because I might have a list of 5 different links and I want the reader to be able to click on them in any order.

Hope this makes sense. Thanks.

Comments

  • (if: $gretaname is true)[] (else:) ["What is your name?"]

    But that leaves whitespace where the link was.
    It is the line-break at the end of that line of code that is causing the white-space to appear when $gretaname is equal to true.

    There are a number of ways to control where line-breaks are shown, the following shows a link between two lines of text when the $var variable is false. If you change the $var variable to true then the link disappears and the second line of text appears directly below the first.
    (set: $var to false)
    
    Some text
    (if: not $var)[[[A link->Next Passage]]
    ]Some more text
    
  • edited March 2016
    Thanks, that seems on the right track and it is easier, but I still see some whitespace depending on the order of the links I click. I would like to be able to click them in any order.

    Passage name: ask_greta
    Ask her about...

    greta_name

    greta_dog

    greta_home

    (set: $gretaname to false)
    (set: $gretadog to false)
    (set: $gretahome to false)

    Passage name: greta_name
    "My name is Greta."

    (if: not $gretadog)greta_dog]

    (if: not $gretahome)greta_home]

    (set: $gretaname to true)

    Passage name: greta_dog
    "My dog's name is Bertie."

    (if: not $gretahome)greta_home]

    (if: not $gretaname)greta_name]

    (set: $gretadog to true)


    Passage name: greta_home
    "I live on Thimbleton street."

    (if: not $gretadog)greta_dog]

    (if: not $gretaname)greta_name]

    (set: $gretahome to true)
  • Please use the C button in the tool-bar above the comment field to wrap your code examples in a code tag, it makes them easier to read/find.

    As I said in my previous comment, each line-break you add to the passage contents will generally add white-space to the output.
    If you don't want that to happen then you need to either take care where you place those line-breaks or use markup to Collapse the whitespace.

    In the following versions of your question passages I have move the two line-breaks that appeared directly after the end ] of the first (if:) macro's hook to now appear within that hook, this results on that end now being directly before the second (if:) macro.

    A. greta_name passage:
    "My name is Greta."
    
    (if: not $gretadog)[[[Tell me about your dog.|greta_dog]]
    
    ](if: not $gretahome)[[[Where do you live?|greta_home]]]
    
    (set: $gretaname to true)
    
    B. greta_dog passage:
    "My dog's name is Bertie."
    
    (if: not $gretahome)[[[Where do you live?|greta_home]]
    
    ](if: not $gretaname)[[[What is your name?|greta_name]]]
    
    (set: $gretadog to true)
    
    C. greta_home passage
    "I live on Thimbleton street."
    
    (if: not $gretadog)[[[Tell me about your dog.|greta_dog]]
    
    ](if: not $gretaname)[[[What is your name?|greta_name]]]
    
    (set: $gretahome to true)
    
  • greyelf wrote: »
    Please use the C button in the tool-bar above the comment field to wrap your code examples in a code tag, it makes them easier to read/find.

    ... I have move the two line-breaks that appeared directly after the end ] of the first (if:) macro's hook to now appear within that hook, this results on that end now being directly before the second (if:) macro.

    Greyelf, will do on the C button.

    As for the rest… I will try moving the line breaks. I didn't realize it was that easy. How embarrisking ;-)

    Thanks so much.
Sign In or Register to comment.