Howdy, Stranger!

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

linking passages with if

Hi there - sorry if this is a total dumb question. Am using Harlowe, trying to link passages with an if

In passage 1 i set the variable
- set $gold to 5

I have text displayed in passage 1
You walk into a cave and see some gold pieces

I create two links in passage 1
passage 2
passage 4

On clicking the first link I land on passage 2 and increment
- set $gold to $gold + 1

I have a loop so I can continue to pick up gold pieces. But when i have eg 8 gold pieces I want to send the player to passage 3 automatically if that makes sense. So on hitting 8gp passage 3 displays:

You have 8 gold pieces. Time to go.

Figuring its something like
if: $gold is >7 goto passage 3, but really appreciate it if someone can help with the syntax :)

Comments

  • Please use the C button in the toolbar above the comment field to wrap your code examples in code tags, it makes them easier to read.

    The Harlowe Manual's description of the (if: ) macro includes an example of it's usage/syntax, as does the (go-to: ) macro.

    note: When you use operators like < (less than), > (greater than), <= (less than or equal to), and >= (greater than or equal to) you don't include the is operator/keyword.

    Combining the two macros together would look like:
    (if: $gold > 7)[(goto: "passage 3")]
    
  • sorry! super duper, thank you :)
Sign In or Register to comment.