Howdy, Stranger!

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

Variables and links to new passages in Harlowe (newbie question!)

Hi,

I am a new to working with twine and want to include some variables.

I have this example:
Which value?

(link: "Select a")[(set: $var to 1)(goto: "show selected value")]
(link: "Select b")[(set: $var to 2)(goto: "show selected value")]


It does work but I miss the handy arrow that points me from the passage where I wrote the code above to the passage "show selected value". Can you explain to me why the arrow is not there and how I can make it appear?

Thanks a lot!

Comments

  • "Arrow?"

    link text[b][color=red]->[/color][/b]passage

    Is that the arrow you mean?
  • I mean the ones in the overview of your story: http://i.imgur.com/M8YiPO2.png

    I also tried this:
    [[dada->a]](set: $var to 1)
    [[didi->b]](set: $var to 2)
    

    The result is that var is always 2 even if I select 1. So I do get the arrows in the overview but screw up the variables.
  • Okay. Yeah, the "connector arrows" don't appear with the (link:) macro. Just a design decision, I guess.

    Your other attempt just sets the variables procedurally regardless of clicks. Your code tells Twine to set $var to 1, then your code tells it to set $var to 2. So, $var is set to 2. Working as intended.
  • Sharpe wrote: »
    Okay. Yeah, the "connector arrows" don't appear with the (link:) macro. Just a design decision, I guess.

    Oh, too bad :(
    Is there no way to have both at once? The connector arrows visible and the variables as I intend it?
  • Not that I am aware, no.
  • Alrighty, thanks for the help!
  • Hi,

    I am a new to working with twine and want to include some variables.

    I have this example:
    Which value?
    
    (link: "Select a")[(set: $var to 1)(goto: "show selected value")]
    (link: "Select b")[(set: $var to 2)(goto: "show selected value")]
    


    It does work but I miss the handy arrow that points me from the passage where I wrote the code above to the passage "show selected value". Can you explain to me why the arrow is not there and how I can make it appear?

    Thanks a lot!

    Something I do when I want to use the (link:) option and still have the connecting arrows between passages is to put a standard passage link within an (if:) statement that will never be true.

    For example, using what you posted above, I would add the following code to the bottom of that passage:
    (if:$invisibeLink is true)[ [[show selected value]] ]
    

    Since I never set $invisibleLink as true, the link itself will never show, but the arrow within the Twine interface will connect both passages. This gives me more control over how to see the connections between passages.

    Note: I put a space between the [ hook bracket and the passage link because sometimes Twine misreads it if all the brackets are joined together.
  • Oh, that is a nice work around. Thanks.
Sign In or Register to comment.