Howdy, Stranger!

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

else: macro won't run

This is probably some stupid small thing I'm missing and I honestly feel stupid for asking but I can't for the life of me find any place in my syntax that would cause this error. I have the following code:
(if: $gold >= $inncost)[
(set: $health = $maxhealth)
(set: $gold = $gold - $inncost)
You wake up the next morning refreshed and revitalized. The inn also has a complementary breakfast. You take the hell advantage of that, and leave stuffed and ready to take on the day.
](else:)[
The innkeeper takes one look at your pitiful wallet and throws you out onto the street. You think that the reaction is a bit extreme, but are grateful that she at least used the door rather than a window.
]

The if: hook runs fine if the condition is met, but the else: statement will never run. If the if: hook doesn't run then nothing runs. It's just a blank page.

The problem isn't the hook syntax. I looked at other posters having similar problems and they either don's use the hooks or put spaces between the hook and the macros. I triple checked that this wasn't the case and even if it is the code above is a copy-paste so you can double check as well. I'm so confused.

Sorry in advance if this gets solved in like 2 seconds. And thanks a bunch.

Comments

  • I create a new Harlowe 1.2.2 story and cut-n-pasted your example into the main passage, I then added the following (set:) macros to the start of that passage
    (set: $inncost to 100)
    (set: $gold to 99)
    
    ... and the "The innkeeper takes one look at your pitiful..." text was correctly displayed.

    If the example is exactly what is in your passage then I believe the problem may be somewhere else. Which version of Harlowe are you using?
  • I'm using Harlowe 1.2. At this point in the story $gold is set to 0 and $inncost is set to 10, but this is done on different passages. I know that they are set correctly, though, because the passages where they are set also display the value.

    Also, I flipped the entire thing (if: $gold < $inncost)[ The innkeeper... ](else:)... and it was still a problem with whatever came after else.
  • Is there a reason why you are using Harlowe 1.2 (and Twine 2.0.9 (ish)) instead of a more up to date version?

    I preformed the same test using the web release of Twine 2.0.9 and it appears that Harlowe 1.2 has an (else:) macro related bug which results in the problem you are having, this bug has been fixed in later versions of Harlowe.
  • greyelf wrote: »
    Is there a reason why you are using Harlowe 1.2 (and Twine 2.0.9 (ish)) instead of a more up to date version?

    I preformed the same test using the web release of Twine 2.0.9 and it appears that Harlowe 1.2 has an (else:) macro related bug which results in the problem you are having, this bug has been fixed in later versions of Harlowe.

    I'm using the one that came default when I downloaded Twine 2 (which, granted, was a while ago). I will download the new version when I get home today and see if that fixes it, but it seems like that is it.

  • Yep, using the newest version fixed it. Thanks a bunch!
Sign In or Register to comment.