I7: Procedural Rules

I have an offstage item that I want a player to be able to examine and touch, but not to do anything else with. I’ve written a rule which places it in scope, which deals with examining. I’ve now got to deal with allowing the item to be touched.

Example 350 suggests a way to accomplish this with a procedural rule which turns off the “can’t reach inside rooms” rule, but only for purposes of a specified action. (I haven’t yet tried it, but the principle illustrated in that example seems like it should be applicable). This seems like a simpler approach than trying to write a “regular” reachability rule which operates differently for different actions.

However, the current documentation indicates that procedural rules are being eliminated from Inform 7, and I’m a little nervous about relying on Code which may not work in later versions of Inform 7. Does anybody have a sense of how risky it is, as of now, to use procedural rules?

Thanks.

Robert Rothman

Are you looking at an older version of the documentation? In my version, example 350 doesn’t use a procedural rule, but rather this:

A reaching inside rule while listening or sleeping or looking: rule succeeds.

Which should solve your problem about writing a regular reaching rule that works differently for different actions. In this case it looks like you can even make it work for just your particular item:

A reaching inside rule while touching the whatsit: rule succeeds.

Instead of just leaving the whatsit off-stage, I had to put it in a special room and place that room in scope while touching, instead of placing the whatsit directly in scope; I’m sure there’s a good reason for this. (Maybe it’s that, if the object itself is in scope, you’re not reaching inside anything to touch it, but if it’s in a room that’s in scope, you are?) Make sure not to put anything else in that room or you can get a very silly message when trying to touch this, as in the little game I wrote to test it:

Lab is a room. The player is in Lab. Bong is a room. The whatsit is a thing in Bong. The whoosit is a thing in Bong. After deciding the scope of the player while touching: place Bong in scope. A reaching inside rule while touching the whatsit: rule succeeds.

…I suppose it would’ve been less silly if I’d chosen different names.

Procedural rules will be gone from Inform as of the next build; in exchange there will be more flexible ways to express when a rule does or does not apply. (See the Inform suggestion forum for some discussion threads about this.)

That said, this build is not yet on the verge of release, so you have some time before is becomes an issue.

Thanks. I was actually looking at the documentation on the Inform 7 website (I’m not at home now, and don’t have the IDE installed on the computer I’m usng). I would have thought that it would be up-to-date, but it sounds like they may not have picked up all of the changes in the most recent release.

In any event, it sounds like a regular reachability rule limited to certain actions may be less difficult than I thought.

Robert Rothman

Hm. Looks like the text on that page is in line with the new documentation, but the example isn’t. I’ll file a report.