0 votes
by (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:





I want it to be



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
by (67.7k 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.

by (130 points)
Thank you that works!

I went through the documentation so many times don't know how I missed this.
by (6.2k 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.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.