How can I make sure all the links to different passages are right under each other? (Twine 1.2.3)

0 votes
asked Oct 9 by newsboy (130 points)
(if: $inv contains ("Stick") and ("Stone"))[passage1]

(if: $history contains ("KilledOgre")[passage2]

(if: $inv contains ("Apple")[passage3]

 

Let's say you have stick and stone in your $inv.

But you did not "KilledOgre".

However, you also have an ("Apple") in your $inv.

 

You will get:

passage1

 

passage3

 

I want it to be

passage1

passage3

I assume the enter is there because passage2 is hidden between there, but I wish it to be not there at all unless you have ("killedogre"). Instead the next passage that is available should simply take it's place.

I have yet to find a way to be able to do this. It would make a ton of things easier in my game. I know ways around it by creating more passages but things would get really complicated if I wish to work out my idea as is.

 

Does anyone have a method for this?

1 Answer

+2 votes
answered Oct 9 by TheMadExile (15,950 points)

You could try the following:

{
(if: $inv contains ("Stick") and ("Stone"))[passage1<br>]
(if: $history contains ("KilledOgre"))[passage2<br>]
(if: $inv contains ("Apple"))[passage3<br>]
}

Which uses the collapsing whitespace markup to turn the hard line breaks into simple spaces.  Each hook ends in a <br> element to add a line break back in where you want them.

NOTE: Be careful, the latter two (if:) macros in your example were each missing one of their parenthesis.

commented Oct 9 by newsboy (130 points)
Thank you that works!

I went through the documentation so many times don't know how I missed this.
commented Oct 13 by Deadshot (1,730 points)

That works, or you could:

(if: $inv contains ("Stick") and ("Stone"))[passage1
](if: $history contains ("KilledOgre"))[passage2
](if: $inv contains ("Apple"))[passage3
]

this makes there only be a line break inside a hook, so if the if: statements are false, then it doesn't have a break.

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.
...