Don't take off your shoes

I originally described the shoes as “a pair of six-inch heels” and said they are wearable.
I also wrote: "Understand “shoes/heels” as pair of six-inch heels.
And I’ve been picky about the punctuation.
Does Inform just not allow a negative condition such as “player does not wear the shoes”?

Got it. I had to use “the pair of six-inch heels” in the rule. Thanks, Jim, for pointing the way.

As I think I mentioned earlier (but maybe not), an Understand rule applies ONLY to what the player can type. Inform (the compiler) will NOT let you refer to the heels as “shoes” in your own code.

The design of Inform quite deliberately obscures this vital distinction. When you create an object, the terms you use (“a pair of six-inch heels”) are used BOTH as the code name (understood by the Inform compiler) and as the parser term (understood when the player types the word). But the Understand rule does NOT work this way.

To be perfectly honest, this is one of several reasons why I dislike Inform 7.

I remember you or someone else saying that, yeah.

I’ve had a lot of trouble with I7 syntax, and the appearance of similarity to natural English can be so very very misleading, but curiously enough this particular issue was not one that has plagued me much. Unexpected benefit of fearful adherence to literality, maybe.

Though for parsimony’s sake, “heels” works, right? On account of the sometimes helpful and sometimes troublesome recognition of certain truncations?

In most situations, it works, yes. In a rare case it can trip you up. If you should happen to create a red hat in Chapter 1 of your code, and a blue hat in Chapter 2, you can say “hat” in either chapter while writing code, and Inform will know which hat you mean – the one in that chapter. But if you should later happen to be reorganizing your code by cutting and pasting blocks to arrange them in a way that now seems more sensible, and if you’ve forgotten that you just said “hat,” you could conceivably create a hard-to-spot bug, because now “hat” might refer to a different object than it did before.

The problem is you’ve defined “shoes” as a synonym for the player, but not for the parser.

[code]Test room is a room.
Hot Floor Room is north of Test Room.

Shoes are a kind of thing. Shoes are wearable. Understand “shoes” as shoes.
[This tells the parser that there are may be several things with the same properties called “shoes”]

some sneakers are shoes in test room. Some high heels are shoes in test room.

Check wearing shoes (called newshoes) (this is the Player can only wear one pair of shoes rule):
if the player wears shoes (called wornshoes):
say “Before wearing [the newshoes] you’l need to take off [the wornshoes].” instead.

Check going north from Test room (this is the must wear shoes to enter hot floor room rule):
if the player does not wear shoes:
say “That floor to the north looks pretty hot. You’d rather not go barefoot.” instead.[/code]

If you try pasting this, adjust the tabstops.

As I was reading this I was thinking the same thing as HanonO, that Inform really wants you to define kinds of things before you define specific. It’s a bit of a chore but I’m starting to understand the purpose of it, esp. with all the examples here.

To Be Honest we do the same thing at work when setting file permissions - setting up something for one user is easy, but two weeks later someone else will want the same thing, and now you’ve done the same job twice - very bad practice. What we do is create a group and give permissions to that group, and put the user in. Next time, add the new user to the group and go down the pub. Slightly longer to set up, but much quicker for repeats.

Same thing with Inform and it’s “kind of thing” - now you can have multiple types of car(shoe/monkey/gun) but your rules work on all of them. Less work than specific cases. Makes sense to me :slight_smile: