Is thee any way to have every passage run the same line of code at the start, without copy/pasting it?

0 votes
asked Jan 1 by Copyright_Invalid (690 points)
I'm creating an interactive novel, and there are events where the player can die if their health gets too low. Only problem is, I hate having to repeatedly paste the lines of code onto each passage. It's messy, inefficient, and very distracting, so is there like a CSS or something I can use to apply it to every passage?

1 Answer

+1 vote
answered Jan 1 by Chapel (49,430 points)
selected Jan 1 by Copyright_Invalid
 
Best answer

Place the code in a passage by itself and add either the tag 'header' or 'footer' to have said code run before or after each passage respectively. 

Relevant docs

commented Jan 1 by Copyright_Invalid (690 points)
So, the header/footer tag applies it to each passage, on it's own?

I'm asking cuz I don't have a clue as to how tags work...
commented Jan 1 by Chapel (49,430 points)
Functionally, yes.
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.
...