Yet another conundrum...

This may sound like a dumb question, because my game has a number of NPCs and situations where the player would ask someone about something, usually a topic listed in a table. I am trying to write a rule where the crucial thing is that the player needs to tell someone about a specific thing–or things. I want more than one subject to lead to the desired(by the player) result. Here is the gist of what I am attempting(not from my game but it’s a lot like what I am trying)–

Instead of telling Bob about something: if the second noun is Julie or Amber: say "You tell him of all the harsh realizations that you have come to, the trials that you have endured, the torture, and finally the excruciating pain that you withstood at the hands of the dominatrix Amber. You tell him of your escape and discovery of the pit from which you rescued Julie. And how Amber could be anywhere, with her minions, looking, watching, waiting...[line break]Immediately, Bob understands, and pulls off his blue jacket, and after conferring with his cohort, he gives you the jacket and that of his friend, plus his friend's fedora. He says, giving you the jacket and her the coat and hat, 'Here, why don't you wear my jacket, and she the coat and hat--you two would at least look something like us, as we are often seen together in public blah blah blah."; now the player has the blue jacket; now Julie has the torn brown sport coat; now Julie has the fedora; otherwise: say "Bob looks at you as if trying to make a connection."

Bob would do the ‘otherwise’ if I told him about anything other than Julie or Amber, but the first reaction I describe above would result from telling Bob about either woman–he would give us their coats and hat as a disguise.

Only this is not how it happened in the play-testing. I have tried using only Julie, I have tried using double-quotes(“Amber” or “Julie”–assuming that ‘the second noun’ must be text), etc etc. Now, the ‘otherwise’ will work, even as a response to Julie. I have tried using ‘if the text understood is…’.

What am I getting wrong?
Thanks

Telling it about is an action that applies to one thing and one topic–which means that the second element is a free text field rather than something that has to be understood as a noun. That is, you can say “TELL BOB ABOUT SNOODLES” even if there’s no such thing as “snoodles” in the game.

When you have an action that applies to a topic, the topic isn’t a “noun” or a “second noun,” but “the topic understood.” Also when you try to match the topic understood against a string, you have to use “matches” rather than “is.” And in Inform, you can’t say things like “If the second noun is Julie or Amber”; you have to use complete sentences on either side of the “or” like “If the second noun is Julie or the second noun is Amber”; except when you’re using a topic, you can use a slash between alternate words, so you can write “Julie/Amber”.

So if you’re using the built-in telling it about action, this should work.

Instead of telling Bob about something: if the topic understood matches "Julie/Amber": say "You tell him of all the harsh realizations that you have come to, the trials that you have endured, the torture, and finally the excruciating pain that you withstood at the hands of the dominatrix Amber. You tell him of your escape and discovery of the pit from which you rescued Julie. And how Amber could be anywhere, with her minions, looking, watching, waiting...[line break]Immediately, Bob understands, and pulls off his blue jacket, and after conferring with his cohort, he gives you the jacket and that of his friend, plus his friend's fedora. He says, giving you the jacket and her the coat and hat, 'Here, why don't you wear my jacket, and she the coat and hat--you two would at least look something like us, as we are often seen together in public blah blah blah."; now the player has the blue jacket; now Julie has the torn brown sport coat; now Julie has the fedora; otherwise: say "Bob looks at you as if trying to make a connection."

(Assuming that I’ve got the indentation right.)

Now, one thing about this is that it will only accept the exact string “Julie” or “Amber.” If “dominatrix” is another way to refer to Amber, this won’t accept “TELL BOB ABOUT DOMINATRIX.” What you can do here is to use an extension like Eric Eve’s Conversation Framework, which defines an “informing it about” action which actually does work on two nouns–so it will accept not just “TELL BOB ABOUT AMBER” but also about every other synonym for Amber. (If you’re doing that, you have to go back to “If the second noun is Julie or the second noun is Amber”.)

Thanks again Matt—

Your indentation was correct, I’m not sure how I got it wrong in my entry above(it did weird things when I hit ‘tab’ as I was entering it). I did try ‘topic understood’–but didn’t know about ‘matches’. Could I use something like “Julie/girlfriend/Amber/dominatrix”(not the actual names)?

Thanks so much.

You could, but then there are variants like “my girlfriend” or “the dominatrix” or “Amber the dominatrix”, which are difficult for topic-parsing but easy for object-parsing. Another option is to use “includes” instead of “matches”, which checks if the text appears anywhere inside the topic (ignoring any extraneous words).

That might be a browser thing–I use Firefox and the tab key switches the cursor from one text entry field to the next. The tab-stops work when you copy-paste from Inform, but when I have to type code into the forum I always copy a tab character from somewhere else and paste it in whenever I need to indent… which is about as annoying as it sounds.

If you copy-paste text into the IDE with four spaces instead of a tab, Inform should correct it automatically. So for the forum I just type four spaces instead of copying a \t.

That doesn’t seem to work on the Mac IDE. Which IDE do you use?

Alas! It does on the Windows one, testing Gnome now.

I use a Toshiba laptop with Windows 7 and now use Firefox–which probably explains it(it exiled the cursor and jolted the screen). Usually, I copy and paste my code when I want to show it on this forum, but here I wanted to create something alike but different(didn’t want to expose too much of the plot–I was very near the end of the story), so I typed it in off the top of my head.

I want to thank you all for helping me with my code for this story. I am now going through it to better organize and streamline it, removing any obtuseness(code which may have been written more concisely). I intend to read through the manual again, to pick up anything that may enhance the code. I plan on writing other works and want to become proficient.

How did you all ‘do’ it? If I may ask…??

There’s no secret. Just read the documentation closely, refer when needed to the Standard Rules, and you’ll internalize this stuff with time.

By the way, if Julie and Amber are already defined in your game world, I think you can just write this:

Instead of telling Bob about something: if the topic understood matches "[Julie]" or the topic understood matches "[Amber]":
Then you can just make “dominatrix” etc. synonyms using an “Understand…” sentence.

Thanks CKY,

I think I read closely up to about chapter 20, but by then(about day 3) I was really itching to start writing, and at first it was a real struggle, especially where it came to syntax and punctuation, etc. I was getting problem messages all over the place. Now, after about 5 months/79000 words, when I get a problem message, it’s usually due to a missed semicolon, so I think I’m doing well. There isn’t a lot of conversation in my game, so I don’t mess a lot with “[text]”.