I wrote some code for hinting objects which seems like it should work. And it does, with a modification. But I’m confused why the original code does not, in fact, work.
A solution to 'Does the player mean' disambiguation (finicky) gives some idea of how to work around things in general with “does the player mean” and it helped me figure out code that works.
My objective here is to try to guess which object the player wants to hint. Objects in “done-room” are placed there once the game determines you are done with them, or they vanish–for instance, if you eat an item successfully, it would go there.
r1 is a room. r2 is eat of r1. done-room is a room.
the blue circle is a thing in r2.
the blue square is a thing in done-room.
the yellow circle is a thing.
the yellow square is a thing in r2.
does the player mean hinting an off-stage thing (called th) (this is the dpm1 rule):
say "1. [th].";
it is very unlikely.
does the player mean hinting a thing (called th) in done-room (this is the dpm2 rule):
say "2. [th].";
it is unlikely.
does the player mean hinting a thing (called th) (this is the dpm3 rule):
say "3. [th].";
if location of th is done-room, it is unlikely;
if th is off-stage, it is very unlikely;
[the dpm1 rule is listed first in the does the player mean rules.]
[the dpm2 rule is listed first in the does the player mean rules.]
[the dpm3 rule is listed first in the does the player mean rules.]
[the dpm3 rule is not listed in the does the player mean rules.]
[the dpm2 rule is not listed in the does the player mean rules.]
[the dpm1 rule is not listed in the does the player mean rules.]
test h with "h blue/h yellow/h circle/h square".
The code above successfully disambiguates.
- why does the dpm3 rule fire first? This happens with or without labeling rule names.
- If I delete dpm3, then whether I put dpm1 or dpm2 first, I get disambiguation problems. The does the player mean rules seem to only try dpm1 or dpm2.
- if I don’t delete dpm3, but I have dpm1 or dpm2 first, I still see “3. (item checked)”
- if I remove dpm2 and dpm1 from the rulebook, dpm3 successfully disambiguates.
The code works, but I don’t understand why the dpm3 works better than the dpm2/dpm1. They seem equivalent to me.
Thanks!