I was trying to do something clever: Use a phrase with a relation as part of a “does the player mean” rule to allow the parser to automatically select the “right” object from multiple objects in scope.
The scenario is about model rockets. Individual rocket parts are set up as kinds of objects, and an object of each rocket part kind is a part of every rocket, using nosecones as an example:
A nosecone is a kind of thing. A nosecone is part of every rocket.
Rockets are modeled as containers because you have to put various parts into them prior to launch.
A rocket is a kind of container. A rocket is usually open and openable.
The player starts out with more than one rocket:
The player is holding a rocket called the Yankee. The player is holding a rocket called the Alpha.
Now I want to be able to translate the command “put nosecone on Yankee” into a close action for the Yankee object, but I’m running into a parser issue, because “nosecone” refers to every nosecone in scope.
After thinking for a while, I tried:
Does the player mean putting a nosecone part of the second noun on the second noun: it is very likely.
which compiled but had no effect – “put nosecone on Yankee” still prompts about which nosecone.
I reviewed chapter 16.19, which mentions that the “putting it on” action has special rules and that the second noun is detected first. In this case, the second noun is unambiguous, so I was thinking it would work.
Several other variations that do compile but do not seem to work:
Does the player mean putting a nosecone part of the second noun on the second noun: it is very likely.
Does the player mean putting a nosecone on a rocket incorporating the nosecone: it is very likely.
Does the player mean putting a nosecone not part of the second noun on the second noun: it is very unlikely.
Does the player mean putting a nosecone on a rocket not incorporating the nosecone: it is very unlikely.
And, what finally brought me here, even the brute force approach doesn’t seem to work:
Does the player mean putting nosecone part of Yankee on Yankee: it is very likely.
Does the player mean putting nosecone part of Alpha on Alpha: it is very likely.
Any suggestions? Following is complete code, for ease of cross-checking:
[code]“Rockets” by Otis
Launch Site is a room.
A rocket is a kind of container. A rocket is usually open and openable.
A nosecone is a kind of thing. A nosecone is part of every rocket.
The player is holding a rocket called the Yankee. The player is holding a rocket called the Alpha.
[Does not work as desired]
[Does the player mean putting a nosecone part of the second noun on the second noun: it is very likely.]
[Does not work as desired]
[Does the player mean putting a nosecone on a rocket incorporating the nosecone: it is very likely.]
[Does not work as desired]
[Does the player mean putting a nosecone not part of the second noun on the second noun: it is very unlikely.]
[Does not work as desired]
[Does the player mean putting a nosecone on a rocket not incorporating the nosecone: it is very unlikely.]
[
[UNPRODUCTIVE BRUTE FORCE APPROACH]
Does the player mean putting nosecone part of Yankee on Yankee: it is very likely.
Does the player mean putting nosecone part of Alpha on Alpha: it is very likely.
]
Instead of putting a nosecone (called subject nosecone) on a rocket (called the subject rocket):
if the subject nosecone is not part of the subject rocket, instead say “That’s the wrong nosecone!”;
try closing the subject rocket instead.
After closing a rocket (called the subject):
say “Being very careful, you slide the nosecone to fit snugly onto the top of [the subject].”
[The following rule just demonstrates that the phrase ‘nosecone part of [rocket]’ can be recognized in some cases.]
When play begins, say “[random nosecone part of Yankee] -> [Yankee], [random nosecone part of Alpha] -> [Alpha].”
test me with “put nosecone on Yankee / put yankee’s nosecone on yankee / open yankee / put alpha’s nosecone on yankee”
[/code]