I know that a header can be applied to all passages via the PassageHeader code, but can a header be applied to individual passages, simply to keep that passage’s buttons on screen if a lot of content makes scrolling necessary?
A header for all passages would not work for me, as each button to a location also has a time factor for distance travelled attached to it, so it would be always be correct if used as PassageHeader.
The alternate would be a rather complicated code that knows what passage the player is on, and could calculate the time from that. I think that solution is more like science fiction, or even fantasy.
You can’t conditionally apply a header or footer tagged Passage to the ‘current’ Passage being shown, you can however use the <<if>> family of macros to conditional display the contents of that header or footer tagged Passage…
eg. The following ‘header’ Passage will only display its content when a the ‘current’ Passage being shown has been assigned a forest Passage Tag.
<<if tags().includes("forest")>>Only show this message for 'forest' tagged passages.<</if>>
eg. The following ‘header’ Passage will not display its content if the ‘current’ Passage being shown has been assigned a noheader Passage Tag.
<<if ! tags().includes("noheader")>>Only show this message if the 'current' Passage has not been assigned a 'noheader' tag<</if>>
note: You don’t need to base the conditional expressions on the assignment of Passage Tags, any condition expression will do.
@Greyelf’s approach works but might be unnecessary. Instead of dealing with PassageHeader you can use the include macro and plug it into passages manually.
So create a passage titled: reusable and enter the content or buttons that you need.
Then, when you want it to show up in a passage, type
<<include "resuable">>
You don’t necessary have to use it at the top of the passage, but since you are imitating the header that is what you would do.
You can repeat this as often as you like, replacing reusable with any other title.
I know I’m trying to make an overly complicated game, at least from the creation point of view, but I really need to try it so I can see what is possible and what isn’t. I also know what I would like to see in a game, and try to include as much of that as I can.
Sometimes, what they call achievements ignorance is the best way to proceed.
I’d like to thank P.B Parjeter for that wonderful advice. I had a far larger story and the code he provided worked perfectly in my passage headers and footers. This is what I ultimately coded to look for the tags and have it eliminate the passage being displayed: <<if tags().includes("noheader")>>*Put abnormal header code here*<<else>>*Put normal header code here*<</if>>
Awesome tip P.B., thank you. I can now exclude headers and footers whenever I want.