Tell NPC about one topic but with multiple words/phrases alternatives

This must be a simple one but I’m stumped.

I want to be able to tell an NPC about either “sandcastle” or “sandcastle competition” and return the same response and logic.

So far I have:

Instead of telling Donella Letha about “sandcastle” for first time:
If Donella is interested:
Say “I’m interested in helping”;
Now Donella is not interested;
Otherwise:
Say “We already did that gig daddy-o”.

How do I add “sandcastle competition” to this?

This is one of the few cases where Inform’s complicated topic/text distinction works in your favor!

When you’re comparing the text the player entered against some text in quotation marks, the text in quotes actually becomes a “topic”, which has some extra abilities. In particular, you can use “or” and slash marks for alternatives, and “--” to mean “nothing at all”.

Instead of telling Donella about "sandcastle competition/--":
1 Like

And if you want a list of alternatives that’s too long to fit in one line, you can make your own token:

The Office is a room. Donatella is a woman in the office.

Understand "sandcastle" or "sandcastle competition" as "[competition]".

Understand "contest" as "[competition]".

Instead of telling Donatella about "[competition]":
	say "I'm willing to help."
2 Likes

Perfect, thanks both!