Howdy, Stranger!

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

Basic Syntax Problems

Twine Version: 2.1.1
Story Style: Harlow 2.0

So I'm just learning and picking up Twine, and I've been following VegetarianZombie's videos on Youtube. I'm on the If section, which I understand just fine but there seems to be a syntax error when using an if statement with passage links.

Code Below:
Passage 1
You dream of being weightless.

[[Open your eyes | Wake Up]]
[[Sleep]]

(set: $hourSleep to 8)

Passage 2
You roll over and refuse to awaken.

(if $hourSleep < 12) [[[Sleep]]]
[[Open your eyes | Wake Up]]

(set: $hourSleep to $hourSleep + 1)

Passage 3
(if: $hourSleep is 8) [Your eyes open suddenly.]

(if: $hourSleep > 8) [You startle awake after a solid $hourSleep hours of sleep.]

This gives me the following error:
68bd17de51e0301810ecee5ec9f2290d.png

Comments

  • Your issue is that you wrote the (if:) macro as (if) in Passage 2—i.e. you're missing the colon after the macro's name. For example:
    → The following:
    (if $hourSleep < 12) [[[Sleep]]]
    
    → Should instead be:
    (if: $hourSleep < 12) [[[Sleep]]]
    
  • OH! My goodness how could I miss something so simple? Thank you so much =)
Sign In or Register to comment.