To Decide - Kinds of Action - Description of Objects

I’m trying to create a To Decide Whether phrase that takes an object or kind of object as an argument and tells me whether or not it is involved in one of several kinds of action. The original context involves Conversation Responses, but this is an extension-free example of the problem:

[code]Lab is a room.

A toy is a kind of thing.
There is a toy called a baseball bat in Lab.
There is a toy called a cricket bat in Lab.
There is a fruit bat in Lab.

There is a padlock in Lab.

The item of interest is a thing that varies. The item of interest is the baseball bat.

Does the player mean doing something when utilizing a toy:
It is unlikely.

Does the player mean doing something when utilizing the item of interest:
It is very likely.

Listening to something is working seriously.
Examining something is working seriously.
Unlocking something with something is binary working seriously.

To decide whether utilizing (item - an object):
If working seriously and item is the noun, yes;
If binary working seriously and the item is the second noun, yes;

Test me with “listen to bat/swing bat/unlock padlock with bat”

My goal here is for “swing bat” to avoid listing the cricket bat in the disambiguation choices. Unfortunately the “utilizing a toy” rule produces a compiler error:

How can I make this work? Can you use a description of objects as an argument for a To Decide phrase? I couldn’t come up with a working syntax for that.

I don’t know that you can use kinds in that way, because the “to decide” function asks for an object, and Inform doesn’t know how to treat a generic kind as an object. You can create a backup clause, “to decide whether utilizing a toy”, and then the text compiles. You could change the function to decide on a utilized object, and then see if the utilized object is a toy or not, but I can’t tell if that would work in this circumstance or not. (Honestly, I couldn’t quite follow the various strands of code.)

I think it should be possible to do that kind of thing as of the last few builds of Inform.
Would this work?

To decide whether utilizing (name of kind of value K):

(Perhaps you’ve already tried that …)

It’s just frustrating, because kinds of action can’t be aggregated, and if I remember correctly, can’t take variable arguments - while at the same time To Decide phrases can’t take the range of descriptions that action descriptions can.

But those both look like good workable ideas.

Er, don’t you mean… Does the player mean doing something with a toy when utilizing the noun: …and… To decide whether utilizing (item - a toy): but to do it right isn’t as elegant as you had it.

EDIT: pardon, you don’t want the 2nd line. I just noticed the variable you’re passing to it.

Where’s my caffeine?

No, because sometimes it’s the second noun.

However, I realized that an adjective definition will take me a lot farther toward my goal than a To Decide phrase here:

Definition: an object (called item) is utilized: If working seriously and item is the noun, yes; If binary working seriously and the item is the second noun, yes; no.

Then I can say “a toy is utilized”.

I realized, unfortunately, that the conditions here are seriously messed up. I’m operating on a sleep deficit…

One more question: once upon a time, I thought there was a phrase that would let you check if something was used in an action, either as the noun or as the second noun. I can’t seem to find it. Would you have to define it yourself, or is this redundant?

Definition: An object is involved if it is the noun or it is the second noun

EDIT: ARGH! I hate “Does the player mean”! I have the correct rule in my WIP now, I can see that it is firing, and yet it is still failing to remove the unwanted item from disambiguation. I think it would take me a few more hours to come up with a brief example, but if anyone is willing to help, I will do it…

EDIT 2: I decided to remove the offending items from scope completely. It wasn’t that hard, since the verb syntax used “any known thing.” What I’m calling a “toy” here was actually a “question” - a sub-kind of “subject.” I just defined a question as unknown unless it’s the item of interest.

Chapter 12.20. “Stored actions” has if (stored action) involves (object):, but your adjective def is likely more elegant.

You might want to read the documentation for Jon INgold’s Disambiguation Control extension, just to see what problems it was designed to cure. I think yours might be one of them. Like, I think if two items come up equally likely, Inform prints them all, not just the top two.

But if you found a solution, go with it. :slight_smile:

My recollection of Disambiguation Control is that its behavior differs from the default mainly when no noun is supplied at all. Although it provides a “never” result, I wasn’t able to get it working as I expected when I tried it. I think maybe I just need to get my head around disambiguation situations a little better.

It certainly seems like once disambiguation is initiated, all possible candidates are offered, not just the likely ones, and the only way to completely eliminate something from the list is to remove it from scope. Am I wrong?