Create dialogue options

Twine 2.3.5 / Harlowe 3.1.0

How could I create dialogue options within a passage, where the conversation unfolds according to the player’s choices?

I found a solution, nesting the (replace:) macro inside a (link:) macro.

(link: “OPTION A”)[result of OPTION A (replace: “OPTION B”)[]]
(link: “OPTION B”)[result of OPTION B (replace: “OPTION A”)[]]

The brackets after the (replace:) macro are left empty, so that the text is replaced by nothing.

The only problem is that it leaves empty spaces where the text was, but it works!

And the really elegant solution that removes the unwanted blanks :

|links>[{
	(link: "First line of selectable text")[
		(replace: ?links)[First line of selectable text]
		(show: ?reply1)
	]
	<br>
	(link: "Second line of selectable text")[
		(replace: ?links)[Second line of selectable text]
		(show: ?reply2)
	]
	<br>
	(link: "Third line of selectable text")[
		(replace: ?links)[Third line of selectable text]
		(show: ?reply3)
	]
	<br>
	(link: "Forth line of selectable text")[
		(replace: ?links)[Forth line of selectable text]
		(show: ?reply4)
	]
}]

{
|reply1)[
	Text related to first line.
]
|reply2)[
	Text related to second line.
]
|reply3)[
	Text related to third line.
]
|reply4)[
	Text related to forth line.
]
}
1 Like