Try examining... without printing the description of noun

Hello,

I’m working on Inform 7.

There are times when I want to use

try examining the noun

but I don’t want the description of the noun to be printed. I only want Inform to go straight to an “After examining…” rule that I have written.

Please note that I don’t want to use an “instead of examining” rule, because it doesn’t proceed to the “after” rule.

What can I do?

You could write the rule in such a way that you can call it independently of the examining action.

This is the post-examination rule:
        say "You smash up [the noun].";
        now the sibling of the noun is in the holder of the noun.
        now the noun is off-stage.

After examining something: follow the post-examination rule.

Yes, this will probably work! Thank you!

If I may also ask, can I refine the rule to fit only a specific kind of thing as its noun? How can I say that this is the post-examination rule for containers or doors only?

Of course, I can do it like this:

This is the post-examination rule:
      if the noun is a door:
            say "...".

Is there some syntax that spares the “if” line? Something like “This is the post-examination rule for doors: …”

In this case you can make an object based rulebook for your post-examination rules. See WI 19.9. In this case the multiple rules in the new rulebook will benefit from the ordinary sorting of rules from most-specific to least, just as they do in Instead or Check.

The post-examination rules are an object based rulebook.

After examining: follow the post-examination rules for the noun.

A post-examination rule for a door (called the portal): say "Yep, [the portal] is a door, all right."
A post-examination rule for the yellow door: say "This door isn't really that yellow, it just looks that way because of the weird light in this room."
A post-examination rule for the yellow door when the blue light is on: say "Hmm, it's really more greenish now. Or maybe you've been playing The Witness too much."

Ok, I’m looking forward to reaching that level of coding excellence!!! There are a lot of chapters of the Inform manual I haven’t gone through yet.

Many thanks again!

I do have to ask, though, what’s your goal in doing this?

You might even prefer to make a new action, put your current “after examining” rules in that action, then try that action in an “after examining” rule.

If I understood from the other thread, sometimes you want something to get smashed after it gets examined. This is something that you could accomplish by writing an extra phrase that isn’t a rule:

[code]To smash (item - a thing):
say “You smash up [the item].”;
now the sibling of the item is in the holder of the item;
now the item is nowhere.

After examining a door: smash the noun.[/code]

And then you can also call “smash (whatever)” from other places in your code.

I’d suggest going the whole nine yards and using another action.

After examining something when the player is berserk: try attacking the noun.

Now if, say, the player is handcuffed and prevented from attacking anything, their rage still won’t be able to overcome that. (That is, it follows the normal rules for “attacking”.)

Thanks again!