Howdy, Stranger!

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

Hello, can anyone help? What's wrong in such macro?

Hello, I am new, using Harlowe and I am trying such macro:

(set:$s1 to 0)

(link-reveal:"Click me")[(set:$s1 to 2)]

(if:$s1 is 2)[You find a new way]

The last sentence never print those text out. What's wrong with those Macro?

I try to change the last row into this:

(click:"check again")[(if:$s1 is 2)[You find a new way]]

and it display this sentence if I click the the one above last. Dose that mean the state of that (if:) won't change once it displayed? Usually, how do you guys do this?

This is one newbie from China. Well trying to write something interesting with this amazing tool. Thank you guys! :)

Comments

  • You can't display the last line in the same passage. Twine is not like programing, where it is actively updating. It will run everything when the passage is opened and will change things based on links you press, but that's it.

    You can't use (if:) to try and add something new to the passage if it is already displayed. Whether it is revealing another link or more text, it won't work. You either have to check again or you have to put it in another passage. I learned this the hard way.
  • All code is expressed when the passage is rendered so the (if:) macro is also evaluated before your (link-reveal:) macro runs. To stop this put the (if:) macro inside the (link-reveal:) hook as below.
    (link-reveal: "Click Me")[(set: $s1 to 2)[(if: $s1 is 2)[You find a new way]]]
    
Sign In or Register to comment.