getting "enter" to use DTPM rules?

Can you help me figure this out?

The lab is a room. 

bed is an enterable supporter in the lab.
chair is an enterable supporter in the lab.

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

Given the above code, “enter” will make you enter the bed (ignoring the DTPM), and “sit” will make you enter the chair. I get how the enter works - it uses the “find what to enter” rule which simply enters the first enterable thing in the room (“if something enterable (called the box) is in the location”), but how does the “sit” work? And is there a way to get the enter command (without a noun) to follow the DTPM rules? Is there any particular reason it doesn’t do this already?

FWIW, you can turn the enter rule off with The find what to enter rule is not listed in the for supplying a missing noun rulebook. .

Thanks…

I’m not sure what you’re asking. “Sit” follows the DTPM rules.

“Enter” is different because the standard rules contain the line:

Understand “enter” as entering.

Entering takes a noun, so this form triggers the “supplying a missing noun” activity, and the find what to enter rule is in that rulebook.

So, what you can do is add a for supplying a missing noun rule that takes precedence over the find what to enter rule under given circumstances:

The Lab is a room.

A bed is an enterable supporter in the Lab.
A chair is an enterable supporter in the Lab.

Does the player mean entering the bed: it is very unlikely.
Does the player mean entering the chair: it is very likely.

For supplying a missing noun while entering in the Lab: now the noun is the chair.

Oh, now I get it. Thanks zarf, spot on as always, this is exactly what I didn’t get:

The lab is a room. 

Retting is an action applying to one thing. Understand "ret [something]" as retting.

Carry out retting: 
	say "Boy, you retted that [noun].";

The pad is a thing in the lab. The nob is a thing in the lab.

Does the player mean retting the pad: it is very likely.

Understand "ret" as retting.

Perhaps not entirely intuitively, that last line means that just typing “ret” by itself will not work - because now you have to supply a noun! If you remove it, the DTPM will kick in.

OK, bonus question: Is there a way to somehow write a “Rule for supplying a missing noun while an actor retting” so it will “abide by the does the player mean rule” - or something like that? Or can you get the likelyhood of meaning a particular thing programmatically?

At this point I am honestly not really trying to achieve anything in particular, except perhaps enlightenment.

Och tack, Felix!

Parsing is by far the hardest part of writing in I7. Figuring out when you need Understand, DTPM, supplying a missing noun, or action redirections can be hellish even for experienced programmers.

Some principles I use:

Add this rule whenever you’re curious what DTPM is doing:

First does the player mean: showme the current action.

When using DTPM, you have to think of every possible action that could lead to the end result. With things like conversation and combat, where a very large number of actions count as more or less the same thing at various times, it helps to define kinds of action to group them together.

Supplying a missing noun can sometimes be the way to go, but I’ve found that it can sometimes be more trouble than it’s worth. In certain cases, it makes more sense to define a separate action with nouns left out, which can then be redirected to a more specific action. One thing to beware of when supplying a missing noun (and processing DTPM) is that some of the nouns might be set to “nothing” when your rule fires. If you use the “something” token in the rule condition, it won’t fire when that noun is nothing. It’s even worse when you use “Understand” lines for nouns - usually the action isn’t even set at that point. Action redirection gives you an advantage in these cases, because by the time you have to deal with the player’s intent, all information that could be extracted from the command has already been placed in the action’s variables.

Rule order can make a difference. Use the “rules” debugging command, or trawl through the Index for the relevant rulebooks to see how rules are actually ordered.

The Index is also useful for figuring out how grammar works. In the “actions” tab, click “actions A-Z” to see a full list of grammar lines and verb synonyms.