How to make conversation not case sensitive?

WOW! That worked. Thanks!

This behaviour occurs because the first rule “Instead of asking … about something” kicks in first, because it is listed first in the source, and it applies, because it is completely general. (In some contexts, more specific rules override more general rules, but this is not one of them.)

If you reverse the order of the rules in the source code, you’ll see that it works. But to rely on the source code order can lead to a brittle solution.

So, one way to get the desired results would be like this:

After asking the waitress about "diner/work/job":
	 say "I had to work to get this place.  I don't know why or how."
	
Report asking the waitress about something:
	say "[one of]'That's simply not important now.'[or]'That seems irrelevant.'[cycling]".

The block asking rule does nothing when asking the waitress about something.

The “After” rule will prevent the “Report” rule from running in the appropriate cases.
We additionally need to conditionally disable the aforementioned “block asking rule”, otherwise the reply “There is no reply” will be added in the “not important” case, when our own report rule runs.

3 Likes

I switched to this recommended After / Report / Block Asking DOes Nothing format, and the parser gives appropriate responses to some topics but then gives the throwaway response to other topics which should be defined.

Hm, can you give an example where it doesn’t work?

`[TALKING TO WAITRESS]

After asking Waitress about "diner/work/job":
	say "'I had to work to get this place. I don't know why or how.'"
	
After asking the unsaved Waitress about "hell":
        say "'Hell is where God's light isn't. Tell me when you find the church...'"

After asking Waitress about "church":
        say "'Exactly. What church? A place designed like this without a church?'"

After asking Waitress about "food/menu":
	say "'Nothing but grease and cholesterol.'".

[After asking Waitress about "toy/toys/toy store/toy shop/toystore/toyshop":
	say "'The old man in the toy store says he loves giving toys to children. I've never seen any children here.'"]

After asking Waitress about "child/kid/children/kids":
	say "'I can't remember the last time I saw a kid anywhere.'"
	
[After asking the unsaved Waitress about "old man/kindly old man/kind old man":
	say "''He seems friendly enough. Just like everyone else.'".]
	
[After asking Waitress about "apartment/apartment building":
        say "'I don't think I've ever seen anyone exit or enter. Even the windows seem foggy. Makes me wonder if someone else is trapped there, for all eternity.'".]
	
After asking the unsaved Waitress about "herself/woman/waitress/her":
	say "'I hardly know you. Not enough to tell you about my past.' She tries to give you a coy smile that just seems creepy.".

After asking Waitress about "nurse":
	say "'She looks at me funny whenever I enter the doctor's office. I don't know why.'".

[After asking the unsaved Waitress about "gun/toy gun":
	if the player carries the toy gun:
		say "'Don't you have better things to do than playing with toys?' she sighs.";
	otherwise:
		say "'Toy gun? What are you talking about?'"]

After asking the unsaved Waitress about "max/me/self/myself/player":
	say "'I don't know anything about you, do I?'"

[After asking the unsaved Waitress about "candy man/candy":
	say "'DO YOU LIKE CANDY AND NUTS!? If I could still sleep, he would occupy my nightmares.'"]

After asking the unsaved Waitress about "dressmaker/fancy lady/lady":
	say "'I could do with a nice dress, but that attitude is how I got here.'"
	
After asking the unsaved Waitress about "clothing clerk/clothing/clerk":
	say "'There's something off about that guy.'".
	
After asking Waitress about "library":
	say "'Its amazing what you can read if you have the time. Geheel ander talen. Its almost a boon...almost.'".

After asking the unsaved Waitress about "librarian":
	say "'She's a very nice lady.'".
	
[Instead of telling the unsaved waitress about "void/blue void/basement":
	if the blue void is in Eerie Basement:
		say "The waitress looks startled, 'Really? I've got to see this. I'll meet you there.'[paragraph break]The woman dashes out of the diner in a rush.";
		now the waitress is in Eerie Basement;
		now the savedness of the waitress is saved;
	otherwise:
		say "'What are you trying to say?'".
		
Instead of asking the unsaved waitress about "void/blue void/basement":
	if the blue void is in Eerie Basement:
		say "The waitress looks startled, 'Really? I've got to see this. I'll meet you there.'[paragraph break]The woman dashes out of the diner in a rush.";
		now the waitress is in Eerie Basement;
		now the savedness of the waitress is saved;
	otherwise:
		say "'What are you trying to say?'".]

Instead of showing the toy gun to the unsaved Waitress:
	say "'Don't you have better things to do than playing with toys?' she sighs."

Instead of talking to the unsaved Waitress:
	say "She looks offended, 'Cut the inane chatter.  If you have something important to ask me, ask me.'"

Report telling Waitress about something:
	say "[one of]'I simply don't know what you mean.'[or]'Is that so?'[cycling]".

Report asking Waitress about something:
	say "[one of]'That's simply not important now.'[or]'That seems irrelevant.'[cycling]".

The block asking rule does nothing when asking the Waitress about something.
The block telling rule does nothing when telling the Waitress about something.`

Anything that is commented out didn’t work correctly.

The slash which separates the vocabulary parts which Inform shall recognize is a bit tricky to use. The rules are laid out in 17.12. This/that and 17.13. New tokens.

Quoting from there:

note that the slash indicates a choice between words only, not between entire phrases. For instance, if we write:

Understand "red bird/robin" as "[robin]".

then the two alternative forms are “red bird” and “red robin”, not “red bird” and “robin”. By contrast,

Understand "red bird" or "robin" as "[robin]".

will understand either “red bird” or “robin” but not “red robin”. If we want to capture all three forms, we might define

Understand "red bird/robin" or "robin" as "[robin]".

Another example, if you want the parser to recognize all combinations of “the diner/the work/the job/diner/work/job”, you’d do it like this:

After asking the waitress about "the/-- diner/work/job":
	 say "I had to work to get this place.  I don't know why or how."

(The -- means that the preceding part is optional.)

4 Likes

Thanks all!

I think I’ve got all the dialog fixed. I may not be using best practices, but what I’ve got is a lot better than what I had. I’ll try to figure out how CHECK and CARRY OUT work so I can do better in the future.

2 Likes

I agree with this 100%. While I understand that the intent is to gradually acclimate authors to the rules system, this feature of the documentation seems to instill either a belief that this is the preferred method in most cases, or at the very least a habitual over-reliance in them. To what the others have said about this, I would add that extensive use of instead rules can make debugging more of a pain. There is one instead rulebook which covers all actions, whereas each action has its own set of check, carry out and report rules. In other words, if you are debugging with “rules all” tracing on, you will see all of your instead rules every time.

2 Likes

I found this post very helpful

Check, Carry out and Report

3 Likes

Here’s another good description, by @HanonO :

And another useful thread on the subject…

4 Likes