Header Tagged Passage Variables Not Working?

Greetings all
I am using Twine and Harlowe 3.2.2 and I have a story with a passage tagged header displaying my header information which ideally would have the Chapter name displayed as the player plays through my story. I have $chapname in my header passage.

In the first story passage I have (set: $chapname to “Chapter 1 - Sons of Tares”) to set the Chapter name. In the first story passage for Chapter 2 I have (set: $chapname to “Chapter 2 - Descent”) placed.

When I play the story from the first passage the header just displays 0 for some reason? The Debug mode shows the correct string information for Chapter 1 and Chapter 2 depending where I start the game, but it doesn’t show up in the header in play mode.

Any help you could provide would be welcome.


Greetings again
After some more digging I found a solution. For anyone wanting to do something similar place [$chapname]<chapname| in the passage tagged header. Then in any passage where you want to display a new chapter headline place (set: $chapname to “Chapter 1 - Sons of Tares”)(replace: ?chapname)[$chapname] where Chapter 1 becomes Chapter 2 etc.

The replace macro in the passages combined with the named bit in the header did the trick.


The content of a header tagged Passage is processed before that of the ‘current’ Passage it is being pre-pended to, which is why the outcome of the (set: $chapname to "value") macro call in the ‘current’ Passage is not appearing within the ‘header’ area.
And the content of a footer tagged Passage is processed after that of the ‘current’ Passage.

1 Like