unexpected response
Page 2 of 2

Author:  howtophil [ Mon Feb 12, 2018 2:03 pm ]
Post subject:  Re: unexpected response

IFaddicted wrote:
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.

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?

Author:  IFaddicted [ Mon Feb 12, 2018 2:14 pm ]
Post subject:  Re: unexpected response

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


Author:  howtophil [ Mon Feb 12, 2018 2:15 pm ]
Post subject:  Re: unexpected response

Eliminate or modify.

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

Author:  jrb [ Mon Feb 12, 2018 2:53 pm ]
Post subject:  Re: unexpected response

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.

It is pitch dark, and you can't see a thing.

The sarcophagus isn't open.

You smell nothing unexpected.


Author:  matt w [ Mon Feb 12, 2018 8:45 pm ]
Post subject:  Re: unexpected response

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:

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.

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:

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;
       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."

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.

Author:  howtophil [ Tue Feb 13, 2018 2:43 am ]
Post subject:  Re: unexpected response

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

Author:  jrb [ Tue Feb 13, 2018 5:51 am ]
Post subject:  Re: unexpected response

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.

Foo room

You jump on the spot.


(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.

Author:  IFaddicted [ Tue Feb 13, 2018 9:46 am ]
Post subject:  Re: unexpected response

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

Author:  zarf [ Tue Feb 13, 2018 10:11 am ]
Post subject:  Re: unexpected response

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.

Author:  IFaddicted [ Tue Feb 13, 2018 12:16 pm ]
Post subject:  Re: unexpected response

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

Page 2 of 2 All times are UTC - 6 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group