Twine OSX 2.1.3; Harlowe 2.0.1: (for: each ) macros straight don't work - 'unexpected identifier' error!

0 votes
asked Aug 31, 2017 by ArtemisPel (150 points)
edited Aug 31, 2017 by ArtemisPel

Merry Thursday, gentle humans.

Been making a thing in Twine 2/Harlowe for over a year now.

Recently dusted off the project and stumbled across the (for: ) macro:

Thought "this is so great, exactly the thing that I needed a year ago, too bad I did dozens of hours of work for a janky thing to use instead, LOL".

But I finally decided to upgrade and convert over some of my bizarre (live:) macro monstrosities.

Unfortunately it seems that the (for:) macro, which seemed like the sole thing worth the trouble of upgrading for, is still unrecognized for me in the latest Twine standalone 2.1.3, running the Harlowe story format (v 2.0.1). I'm on Mac OSX Sierra, 10.12.5.


(for: each _topic, ...(datavalues:$topics))[
		(set:$topicID to _topic's ID)
		*DEBUG: topicID: $topicID *

Note that the "(for:" part of the code is, in my Twine 2.1.3 app, highlighted in a striking vivid orange shade, which would seem to indicate that it is an unrecognized syntax.

Screenshots of resulting error when running the passage ('unexpected identifier' where for should be processed... also ...

Help would be greatly appreciated. Blessings to you all.

1 Answer

0 votes
answered Aug 31, 2017 by Chapel (51,430 points)
selected Sep 1, 2017 by ArtemisPel
Best answer
In your picture, it appears you're running a version of Harlowe with a white background. Did you edit the CSS? Harlowe 2.x has a black background with white text by default.

Can you double check your story format to make sure you're using Harlowe 2.0.1, not Harlowe 1.2.4? That's my guess, anyway; the code seems fine.
commented Sep 1, 2017 by ArtemisPel (150 points)
You called it - I had checked that my Twine's "default story format" was the new Harlowe, but I didn't realize I still had to open my story and use the "Change Story Format" menu.


Now all is well! Except that my story is light-on-black color again! I sure wish I could remember how I changed that before!


So happy to have a working (for:) macro!  


Thanks for pointing me in the right direction Chapel. You are a scholar, a gentleman, and a lizardperson (but you can only be two of these - so choose wisely)!
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.