0 votes
by (170 points)
Hey! I'd like for a part of my game to be a fake chat client where the player can choose from a few dialogue options during a longer scripted conversation. The idea is, once they select what to say, the other possible options disappear and the dialogue continues, until the next decision.

I'm probably missing something, but I can't think of any way to do it other than attaching a variable to every possible choice and checking if it was chosen? :I

Is there a simpler way to achieve it? I'd be grateful

1 Answer

+1 vote
by (8.9k points)

JustMango's answer on this page might be relevant.  Quoted here for your convenience:

justMANGO 

March 2016

I apologize to posting to a thread that's tagged as "answered" but I feel like there's something of value to add. So yea, I've been trying to pull a Jonah in Twine 2, and here's the easiest thing I can think of.

I use the following as the actual clickable links. This just displays passage within the previous passage, as OP suggested.

(link: "Clickable link text")[(display: "Target passage")]

To make use of Twine 2's nice connector arrows in the editor, I put the following immediately after the link/display commands.

[[ ->Target passage]]

There's a space before the arrow. In the text the space doesn't actually show up, but Twine recognizes there as being a link between the passages and will draw an arrow in the editor. 
The first problem with this approach is multiple choices. If you had "choice one" and "choice two" in your text, and the reader clicks "choice one", it will effectively replace the words "choice one" with the content of the target passage, and it will display it before the "choice two" text. Meaning, when readers get to the end of the target passage, "choice two" will still show up and will be clickable.

My getto solution to this is to place the following in the content of the target passage:

(replace: "choice two")[]

There's nothing between the square brackets. This effectively just gets rid of the words. Where I have multiple choices for readers to make, in each of the target passages, I write a replace command for each choice that is not the one that led to the particular target passage. The effect is that it eliminates the words and prevents the reader from being able to "remake" that choice again. 
I have no idea how this works with saves and loads. Sorry.

by (170 points)
That's pretty nifty, thanks!
by (660 points)

If you want the text to stay on-screen but just be unclickable, you could try something like this, the trick is to have one hook that isn't defined a clickable link so it can replace the text of the clickable links:

|Bribe1>[Bribe the guard]|Bribe2>[ or ]|Bribe3>[fight.]

(click: ?Bribe1)[Bribe accepted.(replace: ?Bribe2)[ or fight.](replace: ?Bribe3)[]

](click: ?Bribe3)[Let the battle begin!(replace: ?Bribe1)[](replace: ?Bribe2)[Bribe the guard or ]]

 

...