0 votes
by (130 points)
Hi,

Is it possible to insert the text of one passage into a second one and have it change every time I update the first one?

My story has some passages that contain the same paragraphs, but every time I edit one, I need to remember to go an update all the other ones, which is tedious.

Thanks

1 Answer

+2 votes
by (159k points)

> insert the text of one passage into a second one

The following example consists of two passages (Parent and Child), and it demonstrates how use the <<include>> macro to display the contents of a child passage within a parent one.

The Parent passage.

The following text is contained within a child passage.

<<include "Child">>

More text in the parent passage...

The Child passage.

This text is from the ''Child'' passage.


> have it change every time I update the first one.

If by this you mean that the contents of the Child passage is dynamic determined, and that each time that the Reader visits the Parent passage you want it to also display the current state of the Child passage then the answer is Yes.

eg, A Child passage that uses variables to show different things.

<<if $variable is "value">>
You see a blue box on the floor.
<<else>>
You see a fancy clock on the wall.
<</if>>

If you mean something else then you need to explain what that is in more detail.

by (130 points)
Thanks I'll give it a try.
...