Asking about "Asking about"

I want to respond when the player asks my NPC Ganon about a job posting.
If the player carries the job posting, then he gets a different response than if he doesn’t.

Instead of asking Ganon about job posting:

gives nothing as the second noun.
It seems that asking someone about something is valid only if that something is a topic.

Instead of asking Ganon about something:
	if the topic understood is "job posting":
		follow the newjob rule;
	otherwise:
		say "[description of newjobs]";

What I want to do seems very similar to the doc example

Instead of asking the Captain for the key:
...

I then tried

Instead of asking Ganon for the job posting:

but that didn’t work either.

Do I really need to create a table of one item; and if I do, how to a call the newjob rule?

You can just say:

Instead of asking Ganon about “job posting”:

Though 1) you should probably allow synonyms, so that either job or posting also works, and 2) doing all of your conversations as one-off top-specific instead rules can set you up for a world of pain later on (I know, having done exactly this in my first game) so the table-based approach is probably worth adopting as a general matter unless this is the only bit of conversation in the game.

1 Like

To facilitate synonyms, don’t use topics, use Eric Eve’s Conversation Framework. In fact, don’t ever use topics for anything if you can avoid it.

2 Likes

You definitely want Eric Eve’s extensions for this. If I recall correctly, they add “quizzing about an object” as a new action which uses the same commands as “asking about” but works on objects instead of topics. They also add “subject” as a kind of object, which you can use in place of topics for asking about abstract things.

2 Likes

The development version of Inform also adds a whole dialogue kit as well as “concepts” that can be talked about. I haven’t tested it yet though.

Seconded; specifically ‘Conversation Responses’ makes it very easy to write rules and generally makes basic ask/tell work how you want it to.

Conversation Responses allows response rules for various conversational commands to be written in the following forms:

Response of Bob when asked about Bob:
Response of Bob when asked about “life”:
Response of Bob when told about “[money]”:
Response of Bob when asked about a container:
Response of Bob when asked about something fixed in place:
Response of Bob when told about Jim:
Response of Bob when shown the wallet:
Response of Bob when given the wallet:
Response of Bob when asked for the wallet:
Response of Bob when asked for “sympathy”:
Response of Bob when anwered that “probably”:
Response of Bob when saying yes:
Response of Bob when saying no:
Response of Bob when saying sorry:

1 Like

Heh, that sounds drastic. What exactly is “less than ideal” with topics?

String manipulations tend to be fragile and prone to bugs. If you can use objects in a situation, you can take advantage of the well-tested and reasonably robust parsing mechanisms.

Add: not to mention strings don’t give you the benefit of the compiler finding bad references.

Topics are not strings. They are an alternative parsing mechanism which supports synonyms, alternatives, and phrases.

(You can tell topics aren’t strings because you can’t print them! They’re also case-insensitive, which solves the first obvious problem of raw-string parsing.)

Topics are not equivalent in power to object parsing, but you have to get pretty ornate with your object parsing to do something topics won’t do. (Roughly, topics are missing the ability to “understand when condition” and “understand property as describing”.)

The big nuisance with topics, to my mind, is that they’re not a first-class type. Using them as variables, topics, one-off references, or anything other than a table column is a pain in the ass. I find this limiting. Possibly just because I don’t use tables much.

I also find it philosophically annoying that topics are not built on top of objects, nor vice versa. They’re a completely different species. This makes them hard to understand (as per this thread!) and also a source of friction; you can’t “scale up” from a topic to an object if a particular case requires it.

If you use them in a table column, this isn’t a problem: every topic you use has its row to be filled in.

1 Like

Yes, I agree. I do have most of my conversations table based, but the “job posting” is a thing and a rule is triggered depending on if the player is carrying it or not.
I don’t quite know how to get a table text to trigger a rule.

I will cetainly look into Eric Eve’s extension.
Re your Response of Bob list, can you give an example of how a response can trigger a rule.

When the player asks Ganon about job posting (which is a thing with its own synonyms), how do I trigger the newJob rule?

I included Eric Eve’s Conversation Framework, but it seems to only work for INFORMING, and not ASKING. Eve’s docs give the example

After informing Fred about the golden goose:
say "'I've just seen a golden goose - out in the yard!' you exclaim.

'You've been out in the sun too long,' he opines."

It seems to work if th player INFORMS Ganon, but not if the player ASKS Ganon. Here is my code to handle that syntax:

After asking Ganon about the job posting:
	if player carries the job posting:
		follow the newjob rule;
	otherwise:
		say "[description of newjobs]";

However, the player will not (likely) INFORM Ganon about the posting but ASK about it. The Asking rule above gives a parser error.

What am I missing?

Responses are rules and you can make stuff happen in conversation besides printing out dialog.

Bob can be friendly.

Response of Bob when asked about Bob:
	say "'[one of]How are you today? You look worried!' you remark.[paragraph break]'I've lost my wallet,' he tells you[make lost wallet known][or]Are you okay - apart from your wallet?' you ask.[paragraph break]'Fine, but I'm so worried about my wallet!' he replies[stopping]. [if Bob is friendly]Bob looks at you, his new best friend, with a hopeful sense of expectation.[end if]";
	if Bob is not friendly:
		now Bob is friendly;

So this is just a guess based on your original post…

Response of Ganon when asked about the job posting:
	follow the newjob rule.

Response of Ganon when asked about something:
	say "[description of newjobs]";

NOTE: I usually just include Responses out of the framework since I don’t usually do conversation nodes. If I need a topic I’m going to make it a hidden object somewhere.

I believe you want After quizzing Fred about the job posting?

This is perfect. I have many questions that trigger rules instead of text replies. I like the simplicity of your solution though. As a contrast, I worked out how to use text in a table to trigger rules. Check this out:

"Action Table" by Clyde Falsoon

The Sandbox is a room. 

Ganon is a person in the sandbox.
A job posting is a thing carried by the player. 
Job posting can be accepted or not accepted. Job posting is not accepted.


Table of Emporium Services
Topic	Answer
"transactions/services" 	"services"
"job/posting" or "job posting"	 "newjob_action"

Description of services_answer is " 'Well, we have various services, both for adventuring and for banking. What specifically are you interested in?' ".

Instead of asking Ganon about a topic listed in the Table of Emporium Services:
	if answer entry is:
	-- "newjob_action": follow the newjob rule;
	-- "services": say "[description of services_answer]";
	-- otherwise:
		say "I don't know what you mean.";


This is the newjob rule:
	if job posting is accepted:
		say "You already have accepted that mission.";
	otherwise if player carries job posting:
		say "Ganon adds, 'I see you already have a flyer from the job posting board. [description of mission_overview] Are you interested? [paragraph break] ";
		if player consents:
			say "[description of mission_accepted][paragraph break] ";
			now job posting is accepted;
		otherwise:	
			say " 'Well, okay. Just put the job posting back on the job board in case others are interested.' ";
	otherwise:
		say "[description of newjob]";

Description of newjob is " '[if player carries job posting]I have a job for you.[else]I offer small jobs to willing adventurers. Check the job board in Town Centre every once in a while. Everyone uses it. You'll see what the town needs, and maybe make a few coins in the process. I use the board frequently myself.[end if]"

Description of mission_overview is "A band of adventurers went into Quasqueton--a bug ugly castle on the cliffs--two days ago, and they haven't returned yet. I would like to know what happened to them. I would be willing to pay a little for that.".

Description of mission_accepted is "Ganon nods. 'Good. Take the northwest road out of town and you'll find the Q just outside of town. If you're lucky, you'll likely find something that I might be interested in buying from you. Put a few coins in your pouch, eh?' ".


test job with "ask ganon about services/ask ganon about xyzzy/ask ganon about job posting/ n/ask ganon about job/y/drop job posting/ask ganon about job posting".
1 Like

I haven’t tried this, but won’t I need this quizzing rule for every item Fred gets asked about? A table will help better organize the answers, and maintain description vs rules.

Also, if the player chooses to enter “ask ganon about …”, I will need to write an understand statement ;

Understand quizzing as asking. Right?

I get an error when I cut and pasted the two response rules. It complains about punctuation.

I’m pretty sure the quizzing action is already set up to respond to “ask ganon about …” as long as “…” is a thing in the world. So no, you shouldn’t need Understand quizzing as asking (which I think isn’t even a valid sentence) or anything similar.

This seems to work the best:

Understand "job/paper" or "posting" as job posting. 
Instead of asking Ganon about the "[job posting]":
	follow the newjob rule.

I get an error if I try to ask about a ‘job posting’ (or any thing in general), but if I use the text token in brackets and quotes, then it understands all synonyms of that thing, and it is excluded from the Table as a topic.

For my particular case, I can put all dialogue into tables, and for all actions (rules), I can use a series of these kind of rules. :slightly_smiling_face:

EDIT: Here is the test. Notice that synonyms are used for job posting.

test job with "nw/take posting/read posting/e/ask ganon about job/ y/ 
drop posting/ask ganon about posting".

The second ASK is for this case: If the player asks Ganon after already accepting the mission, whether he/she has the posting or not, Ganon will respond that the player has already accepted the mission.

That’s because the “asking X about Y” action applies to a topic, while the “quizzing X about Y” action applies to a thing. Both of them match the player command >ASK X ABOUT Y, but they have different names in the source code so that Inform doesn’t get confused.