Disambiguating between scenery and objects

It seems that Inform always gives preference to objects when disambiguations. I find that that behaviour is seriously hindering me, and I can’t seem to override it.

The specific problem is that with this code:

[code]Field is a room. Some grain_scenery is in the field. The grain_scenery is privately-named. Understand “grain” as the grain_scenery. The printed name of the grain_scenery is “grain”.

A bag of grain is a kind of thing. The plural of bag of grain is bags of grain. There are 20 bags of grain.

Harvesting is an action applying to one visible thing. Understand “harvest [things]” as harvesting.

Check harvesting something (this is the block harvesting rule):
say “I can’t harvest that.”.

Does the player mean harvesting a bag of grain: it is very unlikely.
Does the player mean harvesting grain_scenery: it is very likely.

Instead of harvesting grain_scenery:
say “I harvest some grain.”;
now the player carries a random bag of grain.[/code]

…I get this output:

…where “grain” gets listed when I don’t want it to be lsited. But if I change that line of code and say “Some grain_scenery is scenery in the field”, I get:

…in which my attempt at disambiguation breaks down.

How can I work around this?

EDIT - While I’m on the subject, when harvesting I’d also like to get rid of “(the grain)”. How would I go about doing that?

It seems to work if you change ‘Understand “harvest [things]” as harvesting’ to ‘Understand “harvest [thing]” as harvesting.’ Then you lose the ability to harvest multiple things at once of course. This might have something to do with the action looking for multiple objects and finding an anonymous instance of a kind of which there could potentially be multiple instances, but this is all guesswork. It would be worth submitting a bug report though.

Rule for clarifying the parser's choice of grain_scenery while harvesting: do nothing.
(Manual chapter 17.28.)

Thank you. Unfortunately, I do need the ability to harvest more than one thing - or at least, give a suitable response to “harvest grain and potatoes”, which, if I just have “Understand “harvest [thing]” as harvesting.”, says “You can’t use multiple objects with that verb” - unsuitable.

Re my second question - thank you. I’ve been staring at the disambiguation problem so bloody long I couldn’t be trusted to find anything on the manual anymore. Frustration build-up when things stop going as they should, you know.

This might work for now: Don’t make the grain_scenery scenery, and add

For printing a locale paragraph about the grain_scenery: Set the locale priority of the grain_scenery to 0.

It’s a hand-rolled version of the (5E71) Standard Rules’ don’t mention scenery in room descriptions rule. You’d also have to assert that the grain_scenery is fixed in place.

Also, you probably want:

Instead of harvesting grain_scenery: if a bag of grain is off-stage: say "You harvest some grain."; now the player carries a random bag of grain that is off-stage; otherwise: say "The field is all harvested out."

as otherwise you’ll sometimes wind up moving a random bag of grain that you’re carrying to yourself, or worse yet, one that you’ve already dropped.

Thank you very much. :slight_smile: For both suggestions.

It sounds like you basically want a “dispenser,” with “harvest” as a variant of “take.” Example 362, “Pizza Prince,” in the documentation has a pizza buffet from which you can take a certain number of slices of pizza, and includes some cleaning-up of the implicit-take behavior.

Thank you, but I had an idea with how to achieve the effect I wished. My issue was with the disambiguation, which was not behaving as expected. Matt told me exactly what to do, and it worked wonders.

I have a lot of issues with the scenery thing also.

For example, I wanted NPCs to randomly take items dropped in a public room. NPCs would be running off with the sky or the doors or even the PC.

Basically I created an unattended object type.

Definition: an thing is unattended:
if it is a person, decide no;
if it is scenery, decide no;
if it is a backdrop, decide no;
if a person has it, decide no;
if it is in a container, decide no;

and so forth.