Actions from Mistakes

Me again.

I have instead rules for “ask someone about a topic” and “tell someone about a topic.” These work great and I understand that a topic is not a thing.

I initially created a mistake around “talk to somebody about a topic” because i couldn’t figure out how to create an appropriate action. I figured if the parser understands the action that creates the mistake then I ought to be able to code it it up for real.

In the example (which compiles), i have an action called “talking about” and an instead rule for trapping it. I can’t, for the life of me, figure out how to craft the instead rule so that it captures “talk to the attendant about the ferris wheel”. This executes the "say “action fired” as it should because there are no restricting conditions on it. I can’t reference the second noun because it is a topic not a thing.

So I don’t get it. thanks in advance,
d.

lab is a room.
An attendant is a kind of male person. the parking attendant is an attendant in the lab.
the paper and the wallet are things carried by the player.

talking about is an action applying to one thing and one topic. 
understand "talk to [someone] about [text]" as talking about.

understand "the Ferris wheel", "Ferris wheel", "Ferris", and "wheel" as "[ferris wheel]".
to say the ferris wheel response:  say "Isn[']t the Ferris wheel so romantic? I sure think so!".
instead of asking an attendant about "[ferris wheel]", say the ferris wheel response.
instead of telling an attendant about "[ferris wheel]", say the ferris wheel response.
instead of talking about when the noun is an attendant, say "The talking about action fired."

test me with "ask attendant about the ferris wheel / tell the attendant about the ferris wheel / talk to the attendant about the ferris wheel"

[Understand "talk to [someone] about [anything]" as a mistake ("To start a conversation, try to ASK [the noun] ABOUT something or TELL [the noun] ABOUT something.").]

I began to reply, then realised that since I almost never use the conventional conversation mechanics, I’m flakey on them :slight_smile:

However, I’ll say what I’ve thought so far.

The way to reference topics is with ‘the topic understood’.

So in your case, you could knee-jerkly intervene in your current instead rule before it delivers the fall-through output ‘The talking action fired.’ Here’s an example replacement rule:

instead of talking about when the noun is an attendant:
	if the topic understood matches the text "ferris" or the topic understood matches the text "wheel":
		say "The attendant says, 'This is a mighty purdy ferris wheeeeel! YEEE-HAW!'";
	otherwise:
		say "The talking about action fired.";

If the ferris wheel’s the only topic needing this kind of treatment, this rule might suffice. It does the whole thing.

Otherwise, it’s probably a good idea to create a table of conversation topics, with corresponding outputs. A system. However I’m not sure how you’d like asking, telling and talking about to interact. Will talking about be synonymous with one of the other actions, or is talking about it’s own conversational ploy? This might affect your approach.

If you search up the the phrase ‘Instead of asking an awake beauty about a topic listed in the Table of Conversation’ in the docs… you can probably see already from the phrase itself how this kind of thing could be bent to your situation. This line is part of the Pine 4 example project, which shows some good stuff for conversational programming.

-Wade

1 Like

When you have an action that involves two “parameters” – in this case, one thing and one topic for your new action – it’s important to structure the action’s name with an “it” involved, which gives you two places to put information in a described action. This is how the compiler figures out which value goes with which parameter.

As an example, the built-in asking it about action uses an “it”, which makes it possible to have rules like:

Instead of asking an attendant about "ferris wheel":

Here the “it” is replaced by an attendant.

In your case, you could set up a talking to it about action, but if it’s using a topic, then it’s not very different from the built-in telling it about action, as defined in the Standard Rules:

Telling it about is an action applying to one thing and one topic.
Understand "tell [someone] about [text]" as telling it about.

Unless you want telling and talking about to mean different things in your game universe, you might as well just replace the grammar for telling it about and use that action:

Understand the command "tell" as something new.
Understand "talk to [someone] about [text]" as telling it about.

The approach that you’re taking of defining topic tokens is wise… if you want to deal with topics. (It’s surprisingly painful.) The suggestion from severedhand to look into table-based topic handling is a good one.

Note that many authors choose to replace the built-in topic-based actions with object-based actions, which allows you to use “conversation topic” objects and/or regular game objects as topics. The advantage is that all of the noun-phrase recognition intelligence of the parser can be brought to bear on topics without having to handcraft tokens to try to catch every possible phrasing. See RB Ex 364 Peeled (second part) for a stub example of the technique.

If you’re planning to implement significant NPC conversation, there are several well-known extensions that can make life easier for you, as well.

3 Likes

This topic’s subject inspired me to this bit of ill-advised nonsense:

lab is a room.

to say boing: try jumping.

Understand "boing" as a mistake ("[boing]").

test me with "boing".

It “works” for some value of works.

(Don’t really do this, people.)

2 Likes