Debugging DPMR [Answered]

Does the player mean… rules don’t show up when rules is on.

They don’t seem to show up when trace is on.

How can you tell when and if any DPMRs are applied?

Another related debugging issue: One of the things that my command is matching has no reason I can find to match the words in the command. Is there some way to identify the line of code that matches a dictionary word to an object?

They seem to for me. This short test example:[code]Lab is a room. A red bat and a red ball are in the lab.

Does the player mean doing something with the red ball: it is very likely.[/code]
… yields this partial output with rules tracing on:

… and this when “rules all” is on:

Edited to add: Are you using any extensions or other code which could be interfering with rules tracing output?

Okay, I think I’ve figured out the second question. I have a situation like this:

[code]A fixture is a kind of thing. A drain is a kind of thing. A drain is a part of every fixture.

The Kitchen is a room.

The nook is a container in the Kitchen.

The steel sink is a fixture in the nook.

The player carries a glass.

Does the player mean inserting something into the sink: It is very likely.

test me with “put glass in steel”[/code]

When the most likely candidate (the sink) is in a container, the parser gets a little overexcited and looks for other matches. The word “steel” matches the full name of the drain, which is “the steel sink’s drain.” So I get a rather unexpected disambiguation question.

I still don’t understand why the DPMR isn’t working, though. Is this disambiguation question generated before the DPM rulebook ever runs?

I didn’t see your post before I wrote mine, Mike. It looks like the none of the DPMR are running at all. But I don’t know why. Can anyone explain it?

I tried changing the rule to “Does the player mean doing something”. That applies. But not “inserting something into something”. “Rules all” confirms that the rulebook is running but the rule just doesn’t apply. Is it just impossible to have a DPMR that depends on the second noun?

I’m not sure I understand it, but the problem seems to lie in the second caveat expressed at the bottom of the page in ch. 16.19. “Does the player mean…”

Edited to add the (hopefully) relevant quote for posterity:

Note the change in both behavior and rules tracing when you remove the word “something” from your DTPM rule: Does the player mean inserting into the sink: It is very likely.

That makes sense in a twisted sort of way. But I wouldn’t have expected that syntax to even be legal.

My actual WIP had a rule phrased in the reverse (since only one DPMR can make a decision, I try to make them as specific as possible). Something like this:

Does the player mean doing something other than examining or smelling with a drain: It is very unlikely.

Unfortunately, this rule doesn’t apply either. I guess because the drain is the second noun, and “with” only implies the noun.

So I tried this:

Does the player mean doing something other than examining or smelling when the current action involves a drain

But that doesn’t compile - it seems “the current action involves” only allows a specific object, not a description of objects.

I guess I’ll have to go back to defining an “involved” adjective…

[code]Definition: an object is involved if the current action involves it.

Does the player mean doing something other than examining or smelling when a drain is involved:
It is very unlikely.[/code]
That seems to work.