I added some necessary variables in order to compile the code you provided above:
The Lab is a room.
NPC is a person in the Lab.
User is a person in the Lab.
TalkingPartner is a person which varies.
TalkOptions is a number which varies.
TalkResponse is a number which varies.
(I don’t know whether that’s how it’s in your code, that’s just what I added to have a compilable version in principle.)
I got the same error as in your screenshot.
The problem still seems to be in the line:
if topic understood matches U:
That line tries to compare the “topic understood”, which is internally a so-called “snippet” (basically Inform’s term for something which the player typed in), to a string/text (since
U is an entry in the TalkAnswers list, like “b”).
Normally, the syntax “
(snippet) matches (...)” expects a so-called “topic” in the second place (yes, the nomenclature is confusing here, unfortunately), not a string/text. This expectation isn’t fulfilled here, and that seems to be the source of the error – although I think the compiler normally catches that and gives a better error message, so that’s strange.
Anyway, if we replace that line with this one:
if topic understood exactly matches the text U:
… then Inform will know that we intend a comparison between a snippet and a text, and the code compiles.
However, there are still some issues remaining. For example, when the player types “d” during the conversation, then Inform will interpret that as the abbreviation for “down”, resulting in the response “You can’t go that way.”; same with “e” for “east”. And I ran into run-time problems due to looking up entries in table rows which don’t exist. I didn’t look at the rest of the code closely, just enough to find the problem discussed above.
I think it could be helpful to take a look at Michael Martin’s extensions “Reactable Quips” and “Quip-Based Conversation”. You could use those directly to get a menu-based conversation where the player types a number to select a conversation option, or if you want to roll your own system, you could take them as an example how to implement it.