Supplying a missing noun for sitting

The ACTIONS testing command tells me that the command ‘sit’ carries out the entering action. But when I try:

[code]Dull Example Room is a room. A chair is an enterable supporter in Dull Example Room. The player holds a shiny penny.

Rule for supplying a missing noun when entering: now the noun is the chair.[/code]

Typing ‘sit’ attempts to sit on the shiny penny. Typing ‘enter’, however, works. How can I make the player sit on the chair when they just type ‘sit’?

Sorry to keep flooding the forum, and thanks for all the help!

okay, this should work, it’s from one of my works in progress and it works for me:

does the player mean entering the rocking chair: it is very likely.

Nice! That’s perfect. I wonder if I worded mine wrong, or if there’s another explanation.

Many thanks!

For reasons that are still not quite clear to me, you need to add a grammar line without the noun token to get the rule for supplying the missing noun to work.

Understand "sit" as entering.

The simplest way to do this is with a “does the player mean” rule.

The second-simplest way is to define a new action, map “sit” to it, and have the new action pick a likely target and “try entering …”.

The “supplying the missing noun” activity is more complicated than either of the above and has no advantages. Skip it. (Except perhaps for the built-in “listen” and “smell” actions, which are already constructed in the complicated way.)

I would disagree, but I’ve already done that! However, I will point out that the “supplying the missing noun” activity gives you more control over which noun gets chosen as opposed to a “does the player mean” rule.

This is due to the way Inform 7 recognises valid grammar lines. Basically, without that grammar line, Inform 7 thinks “sit” is not a valid grammar line and changes the grammar line to “sit on [something]”, which is a valid grammar line while automatically choosing what it thinks is the most appropriate noun via “does the player mean” rules and sometimes asking the player for more input. However, Inform 7 does get this wrong from time to time, which is why it is better to use the “supplying the missing noun” activity than a “does the player mean” rule.

Consider this.

[spoiler][code]“Test”

Rule for supplying a missing noun while locking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing noun while unlocking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing second noun while locking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Rule for supplying a missing second noun while unlocking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Understand “Lock” and “Lock [something]” as locking it with.

Understand “Unlock” and “Unlock [something]” as unlocking it with.

The Testing Room is A Room. A key is in the testing room. The key unlocks the standard door.

The standard door is a locked door. The Standard Door is south of The Testing Room. The Other Room is south of The Standard Door.

Test me with “unlock / lock / unlock door / lock door / unlock door with key / lock door with key / unlock door with key / s”.[/code][/spoiler]

Blanking out the 2 understand lines will cause Inform 7 to react very differently.

Hope this helps.