unexpected response

In my practice game, I have a swivel chair, which I have defined as a vehicle. When I am in the chair, and I try ‘smell’, I get the following response–

[code]You’ll have to get off your lazy duff, first.

You smell nothing unexpected.[/code]

The first line apparently is from my access rules for the chair, when I deny access. Then same happens when I try ‘listen’. In my review of the manual, I am ‘on’ 7.7 The Other Four Senses. I thought that since ‘smelling’ in this sense is an intransitive verb, for which there is no object, there would be no denial. But the preamble of the rule I am trying for this exercise is –

Instead of smelling the Writer's Office:

This is copying from the examples in that section. I wonder if I could just do what I always do by saying–

Instead of smelling: if the location is: -- Writer's Office:

…??

That didn’t work, either, though this time I got the correct ‘say’ value for that location, still it was printed after the access denied message.

This also happens when I am on another, non-vehicular chair. In fact, I checked my other games, and it happens in chairs in those games as well. Ugh.

This seems to work for me:

The swivel chair is a vehicle.

The Writer's Office is a room. The swivel chair is here. The player is here.

The bullpen is north of the Writer's Office. "Nice place. Mr. Jones keeps it that way."

Instead of smelling the Writer's Office:
	say "Stinks."
	
Instead of smelling the bullpen:
	say "Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office."

My output:

Writer's Office
You can see a swivel chair (empty) here.

>enter chair
You get into the swivel chair.

>smell
Stinks.

>n

bullpen (in the swivel chair)
Nice place. Mr. Jones keeps it that way.

>smell
Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office.

Hmmm… could you post your access rules?

My access rules for the swivel chair:

A rule for reaching outside of the swivel chair:[problem--for some reason, cannot try 'smelling' or 'listening' without hitting the denial message] if the noun is the desk: allow access; otherwise: if the desk encloses the noun: allow access; otherwise: if the desk encloses the second noun:[don't forget to include 'second noun', in reaching outside rules] allow access; otherwise: if the noun is a person: allow access; otherwise: say "You'll have to get off your lazy duff, first."; deny access.

For the smaller chair(the other one that I constructed):

A rule for reaching outside of the small chair: if the noun is John Diddling: allow access; otherwise: say "You'll have to get off your lazy butt."; deny access.

Could it be that, when there is no noun specified, it will trip the denial, but then the action continues as if the noun were the thing that you are in or on…??

Allow access if smelling? :slight_smile:

The swivel chair is a vehicle.

Rule for printing room description details of the swivel chair:
	do nothing instead.

A rule for reaching outside of the swivel chair:
	if the noun is John Diddling:
		allow access;
	if smelling:
		allow access;
	otherwise:
		say "You'll have to get off your lazy butt.";
		deny access.

The Writer's Office is a room. The swivel chair is here. The player is here.

The bullpen is north of the Writer's Office. "Nice place. Mr. Jones keeps it that way."

John Diddling is a man in the Writer's Office. "Stocky".

Instead of smelling the Writer's Office:
	say "Stinks."
	
Instead of smelling the bullpen:
	say "Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office."

My output:

[code]Writer’s Office
Stocky

You can also see a swivel chair here.

smell
Stinks.

get in chair
You get into the swivel chair.

smell
Stinks.

n

bullpen (in the swivel chair)
Nice place. Mr. Jones keeps it that way.

smell
Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office.

s

Writer’s Office (in the swivel chair)
Stocky

smell
Stinks.[/code]

So I need to specify the action, for non-transitive verbs??

Thanks. Can I do it this way(to avoid having to hunt down every enterable container/supporter in my previous games):

A rule for reaching outside of a supporter: if smelling: allow access; if listening: allow access.

Okay, it works if I include it in the rule specific to the swivel chair, but not if I try to make it a general rule(as I feared).

Of course, none of this is crucial(if I don’t correct it), but I think it may put off players a bit.

Seems to work.

Code:

[code]The swivel chair is a vehicle.

Box is an enterable supporter. It is in the Writer’s Office.

Rule for printing room description details of the swivel chair:
do nothing instead.

A rule for reaching outside of a supporter:
if the noun is John Diddling:
allow access;
if smelling:
allow access;
otherwise:
say “You’ll have to get off your lazy butt.”;
deny access.

The Writer’s Office is a room. The swivel chair is here. The player is here.

The bullpen is north of the Writer’s Office. “Nice place. Mr. Jones keeps it that way.”

John Diddling is a man in the Writer’s Office. “Stocky”.

Instead of smelling the Writer’s Office:
say “Stinks.”

Instead of smelling the bullpen:
say “Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office.”[/code]

My output:

[code]Writer’s Office
Stocky

You can also see a swivel chair and Box here.

get on box
You get onto Box.

smell
Stinks.

get off box
You get off Box.

Writer’s Office
Stocky

You can also see a swivel chair and Box here.

get on chair
You get into the swivel chair.

smell
Stinks.[/code]

The specific rule likely overrides the general rule. Maybe it’s a good time to see if you can generalize some of your specific rules?

Okay, I will probably have to eliminate the specific rules for each supporter, for the general rule to work, right?

Thanks

Eliminate or modify.

I mean, I’m still a relative newbie to inform. Zarf might still show up with an elegant solution.

Smelling and listening (to) are rather strange verbs. Their definition in the Standard Rules uses peculiar (and undocumented) syntax,
“Smelling is an action applying to nothing or to one thing”. It isn’t clear, to me at least, just what this means.

But if the player doesn’t provide a noun, one is provided by default anyway, so the verb is never really treated as intransitive. This default, slightly weirdly, is the “the touchability ceiling” (which is defined by a routine—it usually turns out to be the location, but your case is complicated.)

What’s going on is that Inform is applying your access rule to determine the touchability ceiling, and printing its message in the process. Then, having failed to reach outside the chair, it has decided that the touchability ceiling is the chair. So it processes the action “smell chair”, and prints the standard response for that too.

You get this double response even with the Standard Rules.

Crypt is a room. The sarcophagus is a closed container in Crypt. The player is in the sarcophagus.

ON POSTING: Looks like jrb came in with a better explanation of what’s going on with the touchability ceiling while I was typing! One thing that helps here is to type “actions” before typing the command that you’re testing–this shows the action that is actually getting processed.

The smelling action and listening actions are a bit of a weird special case. They take one noun so they aren’t really intransitive.* But the player can also type “smell” or “listen” by themselves, so those commands have to be understood too. The Standard Rules take care of this with a rule for supplying a missing noun:

[code]Rule for supplying a missing noun while an actor smelling (this is the ambient odour rule):
now the noun is the touchability ceiling of the player.

Rule for supplying a missing noun while an actor listening (this is the ambient sound rule):
now the noun is the touchability ceiling of the player.[/code]

So if you type “listen” or “smell” by itself, the action will be converted into an action on “the touchability ceiling of the player,” which is almost always the room the player is in. (If the player is in a closed container, that’s the touchability ceiling, I think.) That’s why the action is smelling the Writer’s Office. “Instead of smelling” doesn’t do anything different because it’s functionally the same as “Instead of smelling something”–the noun is still the Writer’s Office, so the reaching outside rules get checked for it.

The problem you’re having with specific and general rules concerns rule order, I think. If I try combining a rule for containers/supporters with a rule for the swivel chair, like this:

[code]A rule for reaching outside of a supporter:
if smelling:
allow access;
if listening:
allow access.

The swivel chair is a vehicle.

Rule for printing room description details of the swivel chair:
do nothing instead.

A rule for reaching outside of the swivel chair:
if the noun is John Diddling:
allow access;
if smelling:
allow access;
otherwise:
say “You’ll have to get off your lazy butt.”;
deny access.

The Writer’s Office is a room. The swivel chair is here. The player is here.

The bullpen is north of the Writer’s Office. “Nice place. Mr. Jones keeps it that way.”

John Diddling is a man in the Writer’s Office. “Stocky”.

Instead of smelling the Writer’s Office:
say “Stinks.”

Instead of smelling the bullpen:
say “Smells nice. Mr. Jones, the secretary, keeps it better than you keep your office.”[/code]

then, if I look up the reaching outside rules in the Rules tab of the index, it shows that the rule for reaching outside the swivel chair runs before the rule for reaching outside a supporter, because the swivel chair is more specific than “a supporter.” You can flip this around by changing your general rule:

A rule for reaching outside of a supporter when smelling or listening: allow access.

This now shows up as more specific than the rule for reaching outside the swivel chair, because a rule with a “when” clause counts as more specific than a rule without one. So if you try sitting in the chair and smelling, you’ll get your message. (In cases where you want one rule to run first and you can’t tweak it like this, you can just write “First rule for reaching outside…” and that will make it run first.)

*Actually in the latest version of Inform both these actions are defined as “applying to nothing or one thing.” This appears to be something that only Graham Nelson understands.

Pretty sure “applying to nothing” means you don’t have to specify anything when smelling. That’s why you can

smell

and get the smell of where you are rather than having to type

smell writer’s office

It’s not as straightforward as that. It’s always possible to associate commands with actions with fewer than the required number of nouns. The missing nouns can be added by “supplying a missing noun” rules. E.g.

Foo room is a room.
Fooing is an action applying to one thing. Understand "foo" as fooing.
Rule for supplying a missing noun when fooing: now the noun is the location.
 
Instead of fooing the location: try jumping. 

(In the case of listening, the “ambient sound rule” supplies the missing noun. Incidentally, this rule is mentioned in the documentation, Section 18.32, but is stated quite incorrectly there.)

The “applying to nothing or one thing” formulation lets you write instructions like “try fooing” in your source text without having to specify the noun. This wouldn’t compile otherwise (“too vague to describe a specific action”).

The listening to action has a further undocumented property, “abbreviable”, which lets you write “try listening” as shorthand for “try listening to”. (And also e.g. “Instead of listening” for “Instead of listening to”.)

I don’t know whether there’s any more to it than that; probably not I guess.

Thank you all for your help! Seems like I am learning something new about Inform7 all the time.

I prefer to avoid the supplying-a-missing-noun mechanism entirely. I always create separate actions for noun and nounless grammar (“fooing something” and “vague-fooing”). Then I write vague-fooing rules that select an object, if possible, followed by “instead try fooing X”.

I’m not saying it’s The Right Way, but it works fine and it lets me ignore one source of confusion.

Zarf, that’s what I usually do, thank you for the confirmation.