I tried the following, using the currently running scene as a hook:
Does the player mean the short boy doing something when Bucket-
Manipulations is happening: it is unlikely.
...but that had no effect. The parser is still selecting the short boy
rather than the tall boy, without even asking the player to
disambiguate. And yes, the tall boy is in scope -- I checked. If the
player uses the full term "tall boy", the command proceeds as desired.
I found a workaround -- preventing the use of the word "boy" for the
short boy during that scene. But I'm curious about the internal
workings of "does the player mean," because doing it that way would be
smoother and more flexible.
Can someone suggest how I might use a "does the player mean" rule to
control orders to NPCs? Thanks in advance!
--Jim Aikin
Jim, I've played around with it a bit, and I think this is a bug. Even a
single condition ("Does the player mean the short boy doing something")
fails to have any effect whatsoever. I'm not sure whether this syntax is
intended to work, but the fact that it fails silently suggests that, at
the least, the error-checking needs to be refined.
By the way, when I test this with a simple example, I always get a
disambiguation message.
--Erik
Try "does the player mean asking the short boy to try doing
something". I haven't checked, but it might work.
-- Krister Fundin
I tried that one too; like the other syntax, it also compiles but without
apparent effect. None of the examples of "does the player mean" in the
manual illustrate its use with NPC actions, so it's quite possible that
this was never considered.
--Erik
Indeed. The hacky way to detect this situation would be to write a DPM
rule that just checks whether the noun is the small boy; you can use
I6 to check if scope_reason==TALKING_REASON, and if so, the boy is
being addressed (either with BOY, DO SOMETHING or another talking
command like ASK BOY ABOUT BUCKET).
That is, if the DPM rulebook were reliably fired in this situation!
But something's going wrong as demonstrated below:
<code>
Home is a room.
The small boy is a person in Home.
The big boy is a person in Home.
An apple is here.
Does the player mean: say "DPM".
</code>
Depending on the sequence of commands you use, the DPM rule will stop
being fired for ambiguous inputs:
<output>
>boy, take apple
DPM
DPMWho do you mean, the small boy or the big boy?
>x me
As good-looking as ever.
>boy, take apple
Who do you mean, the small boy or the big boy?
>ask boy about apple
Who do you mean, the small boy or the big boy?
>x me
As good-looking as ever.
>ask boy about apple
DPM
DPMWho do you mean, the small boy or the big boy?
>boy, take apple
DPM
DPMWho do you mean, the small boy or the big boy?
</output>
vw
Your example might even be a different bug. I'm going to report mine to
Graham, as exemplified by the following test case -- the "does the
player mean" rule clearly works as expected when the player's action is
being considered, but has no effect on the choice of an npc.
--JA
[code]
The Test Lab is a room. "Many devious tests are conducted here."
Flag1 is a truth state that varies. Flag1 is false.
Flag2 is a truth state that varies. Flag2 is false.
Morning is a recurring scene. Morning begins when flag1 is true. Morning
ends when flag1 is false.
Afternoon is a recurring scene. Afternoon begins when flag2 is true.
Afternoon ends when flag2 is false.
Dave is a man in the Lab. Understand "man" as Dave.
Bob is a man in the Lab. Understand "man" as Bob.
Persuasion rule for asking Dave to try doing something: persuasion succeeds.
Persuasion rule for asking Bob to try doing something: persuasion succeeds.
Does the player mean Dave doing something when Morning is happening: it
is very unlikely.
Does the player mean Bob doing something when Afternoon is happening: it
is very unlikely.
The ball is in the Lab.
Test men with "scenes / push red button / man, take the ball / push
black button / man, take the ball".
The dove is in the Lab. Understand "bird" as the dove.
The robin is in the Lab. Understand "bird" as the robin.
Does the player mean doing something to the dove when Morning is
happening: it is very unlikely.
Does the player mean doing something to the robin when Afternoon is
happening: it is very unlikely.
Test birds with "scenes / press red button / take bird / drop it / press
black button / take bird".
The player carries a red button and a black button.
Instead of pushing the red button:
say "As you press the red button, the Scene is Morning.";
now flag1 is true;
now flag2 is false.
Instead of pushing the black button:
say "As you press the black button, the Scene is Afternoon.";
now flag2 is true;
now flag1 is false.
[end code]