Howdy, Stranger!

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

Hey folks! Trying to retrieve the name of the current passage for a macro in Harlow

edited January 2016 in Help! with 2.0
So I am using Twine version 2 with the Harlowe theme and while I'm very grateful for the docs I feel very confused about how to get certain things done.

I have, for the sake of a few macros that run in every passage thanks to the header and footer passages, the need to embed into a variable the name of the current passage. But, I've so far had to "hard code" it into every passage by copying the passage title such as "currentpassage1" into
(set: $currentpassage to "currentpassage1")

Anybody have any ideas of how I could do this slightly more elegantly and which doesn't include me going into every single one of my passages and copy-pasting this. I have 100+ passages and this is getting obnoxious.

Comments

  • The (passage:) macro returns a datamap containing info about either the current or a named passage. So to get the name of the current passage you can use:
    (passage:)'s name
    

    so your code would be
    (set: $currentpassage to (passage:)'s name)
    
  • AH!!! It seems I have not gotten the hang of using apostrophes in macros T_T

    Thank you so much for how quickly you responded!!!
Sign In or Register to comment.