-
I’ve created a demo project which alters the touching and tasting actions to point to the location when no noun is supplied, and it puts the location in scope when carrying out those actions.
-
It also puts the location in scope when the player types EXAMINE, so that the room’s description can be printed if they type X PLAZA (or wherever they are)
If you look in the Standard Rules, you can see the current definition of touching and its grammar. They say,
Touching is an action applying to one thing.
and
Understand "touch [something]" as touching.
This means typing TOUCH with no noun isn’t tolerated by Inform. It’s going to grab at a noun and shove it in there, hence the grabbing at the letter in your game. If it can’t get one, then it’s going to say ‘You must supply a noun.’
If we allow the player to type just “TOUCH”, we can add a rule that decides what noun to put in there in difference circumstances. So in my demo I’ve added this:
Understand "touch" as touching.
(note the no [something])
and this:
Rule for supplying a missing noun when touching:
now the noun is the location;
And I did the same for the identically defined tasting action.
One more thing needed to make this work is putting the location in scope at such moments, because it’s not normally there. In the following rule, I name all the actions that that I want to have put the location in scope:
After deciding the scope of the player while examining or touching or tasting (this is the place the room in scope when applicable rule):
place the location in scope, but not its contents;[everything else should already be in scope if applicable]
Re: LISTEN, the rule is no longer ‘listening in the plaza’ (or smelling IN the plaza) because that would mean even if we listened to something else, it would give the plaza’s audio. The rule now says listening TO the plaza. This means the player can still target other things with LISTEN while in the plaza. You can change it back if you want the plaza’s sound to override any other listening in this location.
We’re getting a bit advanced here, but we’re done. Try the demo. Note the player is holding a lollipop. This is to prove that typing TOUCH on its own chooses the location and not the lollipop.
Summary
The Plaza is a room. Description of the plaza is "What a place! (replace this with actual cool description.)".
player carries a lollipop.
Understand "taste" as tasting.
Rule for supplying a missing noun when tasting:
now the noun is the location;
Understand "touch" as touching.
Rule for supplying a missing noun when touching:
now the noun is the location;
After deciding the scope of the player while examining or smelling or touching or tasting or listening to (this is the place the room in scope when applicable rule):
place the location in scope, but not its contents;[everything else should already be in scope if applicable]
Does the player mean doing anything to the location:[prioritizes verbs working on things over the room itself]
it is unlikely;
Instead of listening to the Plaza, say “It’s hard to pick up on anything more specific than the exuberant voices of the singers.”;
Instead of smelling the Plaza, say “You smell incense, cigarettes, and sweat.”;
Instead of touching the Plaza, say “You kneel and touch the dusty ground. The dirt sifts through your fingers and sticks to your sweaty palms. In some places, it has a reddish hue.”;
Instead of tasting the Plaza, say “Sure. You go ahead and lick the Plaza. It tastes like dirt and ashes. And a little bit metallic.”;
Test me with "listen/listen to me/smell/smell me/taste/touch/x plaza".
EDIT - Added more actions to the scope rule, otherwise e.g. LISTEN would succeed in listening to the location, but LISTEN (LOCATION) wouldn’t.
-Wade