[I7] Threaded Conversation - Getting a String to Fire AFTER Discussing

Hello! I’ve started using Threaded Conversation by Chris Conley, and I’m having a lot of success with it. I’ve learned that, using the documentation, I can use the “After (person) discussing (quip)” string to queue something else. I’d like to use it to inform the player of information that has transpired from the conversation, ex. you have been given an item, your relationship has increased with the person (relationship is an established value in my project), and so on. The only issue with this is that the string prints after the comment and above the reply, so in the middle of the conversation.

This is an example of the code to include the strings. The “You put the overcoat on” and “Your relationship increases” fire, but in between the “This is my comment” and “Here is my reply”. I understand this is because the comment and reply occur on different turns. Is there another way I can go about this so that the string fires AFTER the comment and reply as opposed to in between?

Default is an informative quip.
The comment is "'Hello.' you say. 'This is my comment.'".
The reply is "[line break]'Hello. Here is my reply.'".
It quip-supplies NamedPerson.
	
After NamedPerson discussing Default:
	now the player wears Overcoat;
	say "[line break]You put on the Overcoat.";
	increase the current relationship of NamedPerson by 5;
	say "[line break]Your relationship with NamedPerson has increased.";
	continue the action.

The comment and reply do happen on the same turn (and the same action); the reply occurs during the Report phase, which is strictly after the After phase, which is why you see that ordering.

To solve the issue with announcing the increase in relationship, I’d make that happen as a general rule instead – this also prevents having to remember to mention it each time. For example, to follow a similar style to score announcements:

Include Glulx Text Effects by Emily Short.

A person has a number called current relationship.
A person has a number called previous relationship.

When play begins:
	[this is to allow some NPCs to start with a non-zero relationship without announcing it]
	repeat with whomst running through all persons:
		now the previous relationship of whomst is the current relationship of whomst.

Every turn (this is the announce relationship changes rule):
	repeat with whomst running through all persons:
		let change be the current relationship of whomst minus the previous relationship of whomst;
		if change is not zero:
			say "[note style][bracket][Our] relationship with [whomst] [have] [if change is less than zero]decreased[otherwise]increased[end if][close bracket][roman type][line break]";
			now the previous relationship of whomst is the current relationship of whomst.

With this in place, you can remove the text announcing the relationship change (but keep the change itself), and it will be announced after the reply automatically.

(If you want, this can announce the actual numeric change, as the score announcement does – but I assume relationship changes are intentionally more vague.)

Regarding the line about putting on the overcoat, the simplest thing to do to order this with respect to the reply is to put the text into the reply itself – there’s no reason this can’t be a mixture of speech and other description of action. With these changes, then your after discussing rule simply becomes:

After NamedPerson discussing Default:
	now the player wears Overcoat;
	increase the current relationship of NamedPerson by 5;
	continue the action.
4 Likes

Actually, to help remember that you shouldn’t say anything directly, you could write this as a Carry Out rule rather than an After rule. If you do that then you don’t need to explicitly continue the action either.

Default is an informative quip.
The comment is "'Hello.' you say. 'This is my comment.'".
The reply is "'Hello. Here is my reply.'[line break]You put on the Overcoat."
It quip-supplies NamedPerson.
	
Carry out NamedPerson discussing Default:
	now the player wears Overcoat;
	increase the current relationship of NamedPerson by 5.
1 Like