0 votes
by (120 points)

Hi guys,

I'm using Twine 2.0 and Harlowe 2.0.1

I'm about 1/3rd of the way through my game, and I'm now at a bit of a loss for how to proceed. My game mimics a computer system, and the main story of the game is this mysterious instant chat you are involved in. I have created the shape and style of my instant chat box, and I've used it a few times now to show active, inactive, and archived chats. What I want to do now is have the user follow the instant chat, with multiple choices for replies. Whichever reply they click will then need to show up in the chat, and trigger the corresponding message, followed by another set of multiple choice replies. 

What I've got so far is a bit of a mess. 

<div class="boxed5">
[]<chat|
</div>
<div class="boxed6">
$name:[ [Hello?]<opt1| or [Who is this?]<opt2| ](allopt1|
</div>

So I have my chat box, which everything will be appended to, followed by the reply box, where the options need to appear (two at a time). 

(set: $tick to 0)\
(live: 1s)[
	(set: $tick to it + 1)
	(if: $tick is 2)[
		(append: ?chat)[(colour: #ffddcc)[Jupiter: Hello]]
		]
	(if: $tick is 3)[
		(show: ?allopt1)
	]
	(click: ?opt1)[(replace: ?allopt1)[$opt3 or $opt4]]
	(click: ?opt2)[(replace: ?allopt1)[$opt5 or $opt6]]
	]

This is what I just put down as a starting place. I set the 'opt' variables in the startup-config passage. This is my first Twine game and, while I have a basic understanding of what I'm doing, I feel this is going to give me a headache very soon.

So I wanted to ask if anyone has any advice or tips before I proceed any further? What is the best way of supplying regular, clickable, multiple choices inside one hook, which changes the content of another hook, and then refreshes with more new choices? Is this going to end up being a very messy and mind-boggling passage?

Sorry if I haven't explained this very well. 

To summarise, I want to mimic an instant chat feature. The player needs to have reply options, which show up in the chat, and the trigger their next lot of reply options. 

Thanks! 

2 Answers

0 votes
by (250 points)
Isn't this easily accomplished just by using a tree of different passages?

So in your first passage, you have your Instant Messenger box displayed and a list of options below about what to reply: "Hey there", "brb", "What's going on?"

If they click "Hey there", it takes them to a new passage with new dialogue options, and in this new passage you have "$name: Hey there" written on the Instant Messenger box above the dialogue options.

This seems so obvious though that I must be misunderstanding what you're trying to accomplish.
0 votes
by (220 points)

@Focksbot has a good point!

If your concern is that the replies/options need to show up within the chatbox and not redirect the user to a different page, you can use the (display:) macro.

In that case, you would write the automatic response and the next available response options as links to more passages, and then encode all the links as (display:) macros rather than regular links. That would allow the new dialogue & response options show up underneath the previous options.

The only question would be how many (display:) macros you could nest before you got an error, I believe.

by (159k points)

The only question would be how many (display:) macros you could nest before you got an error, I believe.

Not many, that's why I suggest using a named hook combined with a (replace:) macro targeting it to force the contents of the (display) to appear in the same location.

[]<chat|

(replace: ?chat)[(display: "The other passage 1")]
....
(replace: ?chat)[(display: "The other passage 2")]

... obviously the two (replace:) macros are not being executed within the same code.

by (120 points)

Sorry I don't quite understand this. If I can't nest a series of Display macros, then I'm down to your answer of using named hooks and the replace macro. I believe that is the basis of the system I am currently using. 

Please could you explain what I need to do differently? The trouble I'm having is where to write the responses, and how to call them in a way that draws in new responses. 

(click: ?opt1)[(replace: ?allopt1)[$opt3 or $opt4]]
	(click: ?opt2)[(replace: ?allopt1)[$opt5 or $opt6]]

This just feels really messy and like I'm going to lose track of it. All this currently accounts for is the first two options. Next I will have four possible options (the two that branch from opt1 and the two that branch from opt2) and then eight, and then sixteen, and so on. I feel like this will be a mess to keep track of in one passage, but I would really like all of these options to appear in the same passage, within the chat feature. 

Any further help would be appreciated. I still feel stumped here and I'm trying to understand how I can do this more efficiently 

Thank you

...