The question is in the title. To explain it further, here’s a use case:
A sword is a kind of thing.
Sword1 is a sword. Sword2 is a sword. Sword3 is a sword.
The armory is a room.
Bob is in the armory. The player is in the armory.
Bob is carrying sword1. The player is carrying sword2. Sword3 is in the armory.
The problem is, if the player’s command is >look sword… the parser seems to always assume it means to look at the sword the player is already carrying. Now, with more fleshed out code, the descriptions and printed names of these things might be more fleshed out, but as you can see, I am trying to use assemblies of kinds, so sometimes the swords will still be described very similarly, or exactly the same.
Commands like >look Bob’s sword work, (possibly because of code I have elsewhere that give’s ownership to things?) but I have no idea how the player in this case would be able to target the sword that isn’t held by anyone by default in this use case. So, I tried adding some “does the player mean” stuff, but I can’t get it right. I can affect the behavior, but I can’t get it to where in any use case combination of swords on the ground or held by various characters that >look sword will always pull up a “which do you mean?”
In my opinion, it should always trigger a which do you mean if there are two of a kind of thing visible and the command doesn’t specify the exact description of the item. I am using numbered disambiguation, and other code to always make it so a person holding a thing get’s their name printed with it, so using assemblies this way should be fine as long as this numbered prompt always comes up… but it doesn’t.
Here is the last attempt at the does the player mean I was trying:
Does the player mean doing something with a thing held by the player: it is unlikely.
Does the player mean doing something with a thing held by a visible person that is not the player while a visible person that is not the player is holding a thing: it is possible.
Does the player mean doing something with a thing not held by a person while a visible person that is not the player is holding a thing: it is possible.
Edit:
My code above was the product of going nuts. The below still doesn’t work, but is probably less insane:
Does the player mean doing something with a thing held by the player: it is unlikely.
Does the player mean doing something with a thing not held by a person: it is possible.
Does the player mean doing something with a thing held by a person that is not the player: it is possible.