Disambiguating between scenery and non-scenery (and carried and non-carried)

Is it possible to make it so that, when the player types “x painting,” the game will ask for disambiguation between the scenery painting and the non-scenery painting? Right now, it doesn’t ask. It automatically picks the non-scenery painting.

Art Gallery is a room. The description is "A gallery full of paintings."

A flower painting is scenery in Art Gallery.

The player carries a fruit painting.

Test me with "x painting".

Edit: I discovered from this post that I could make the scenery behave like scenery without calling it scenery by making it fixed in place and adding a line similiar to this:

But when I do this, Inform picks the carried object instead of disambiguating.

I’m not going to say there’s no way to this, because enough I6 hammering will always do the job.

But the short answer is no. The parser has a lot of ways to signal “choose this one during the disambig phase”. DTPM rules, the scenery attribute, where the object is, whether the player wrote MY PAINTING, etc. (The DTPM signal has the highest weight, because that’s where the author puts their thumb on the scales.)

But there’s no built-in way to say “make no decision and proceed to ask the player”, because that would require ignoring all the signals. There’s no facility for that.

1 Like

This sort of thing is the point of Jon Ingold’s “Disambiguation Control” extension, isn’t it?

(Note that it looks like the most current version of that is for 9.3/6M62.)

Quite possibly! (I am not up on extensions.)

You’re probably aware that Inform really likes to pick things the player is carrying, in general.

If you enter the command TRACE 4 at the parser then run your test, you will see at the bottom of the output the scores Inform assigned to each thing when evaluating what to pick for this action. The carried painting is winning by a tiny 30 points.

I know your original question was about forcing disambiguation, but I feel like in the majority of cases, if you look deep in your soul (or just at the game state) in a particular situation, you know which thing you’d rather Inform picked for that action at that time, and can tilt the scales with Does the player mean rules.

In this case, the player’s already got the fruit painting. If they just type X PAINTING, I’d say it’s fair to favour them seeing the painting they don’t already have, so I’d favour the flower painting. Especially because if that wasn’t what they meant, they can immediately type X FRUIT to get what they want.

So, if you add

Does the player mean examining fruit painting:
	it is unlikely;

then run the game, enter TRACE 4, run the test again - you can see how it adjusts the scores.

If we got to a situation where the player is dealing with two FRUIT paintings, and has no other adjective they could use to distinguish them, we’d face more significant troubles.

-Wade

Thank you, everyone!

I’ll look at it–thanks!

In the actual situation I’m dealing with, there is a scenery object that represents several things. I’m struggling to think of a good adjective that could be used to describe all the scenery things, but not the non-scenery thing. (They are not paintings–that’s just an example.)

Maybe it would be best to favor the scenery object anyway. It’s easy (as you said) for the player to type “x fruit” if the parser guesses wrong. But it might be harder for the player to try to figure out how to refer to the collection of scenery paintings if the parser mistakenly guesses the carried painting.

1 Like

Maybe Disambiguation Control will help you. I’ve never been able to use it as it’s incompatible with Unified Glulx Input, which is the backbone of my game.

I was going to say, though, the usual way to ‘force’ disambiguation is, broadly, to force Inform to compare things with equal scores in one domain to other things in other domains.

For instance, in your original example and with my DTPM rule, if you add one more painting to the wall, a sky painting, then do x painting, it now asks ‘Which do you mean?’ and offers all three as options.

Art Gallery is a room. The description is "A gallery full of paintings."

A sky painting is scenery in Art Gallery.
A flower painting is scenery in Art Gallery.

The player carries a fruit painting.

Does the player mean examining fruit painting:
	it is unlikely;

Test me with "x painting".

So the DTPM rule, in that context, is forcing disambiguation. Maybe you can use tricks like that, but I appreciate I don’t know your whole scenario.

-Wade

Thanks! I will keep this in mind.