I’m new to Inform 7 but have been experimenting quite a bit in the last few days and have made some progress.
However, I’ve run up against an annoying problem which feels like it should be fairly simple to solve, but I have not managed so far…
[code]Lab is a room.
In lab is a container called mug.
A pool is fixed in place in the lab.
The floor is fixed in place in the lab.
The player carries a plate. The plate is a supporter.
Filling it from is an action applying to two things. Understand “fill [something] from [something]” as filling it from.
Does the player mean filling the plate from the pool:it is very unlikely.
Does the player mean filling the noun from the noun:it is very unlikely.
Does the player mean filling the mug from the pool:it is very likely.
This produces the following result:
I would have thought the “Does the player mean” rules would have made the parser prefer the mug before the plate, but it seems the fact that player is carrying only one thing (the plate) overrides all attempts to get it to choose something else.
Carrying more than one object gives “What do you want to fill?” instead, which is what I would want in the first case also.
Defaulting to an object just because it is the one and only object the player carries seems a bit weird when there are other candidate objects in the room (maybe it’s a bug?)
As a workaround I tried this:
Liquid source is a kind of thing. The pool is a liquid source. Filling it from is an action applying to two things. Understand "fill [container] from [liquid source]" as filling it from.
Which is all well and good, but apparently that affects how the player’s command is parsed, so now this happens instead:
>fill plate from pool
You can't see any such thing.
…which isn’t true since both plate and pool are visible…and since it seems to happen during parsing it can’t be affected by any Before or Check rules, if I understand things correctly.
Any ideas or pointers? I’ve been through the manual and searched the web, but all I can find is that disambiguation is pretty tricky territory…